{"_id":"@atlas-engine/atlas_engine_client","_rev":"1542-8fa5517d8095f755e49b8648847c8085","name":"@atlas-engine/atlas_engine_client","dist-tags":{"latest":"4.3.5"},"versions":{"0.0.1":{"name":"@atlas-engine/atlas_engine_client","version":"0.0.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.0.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"contributors":[{"name":"Alexander Kasten","email":"alexander.kasten@5minds.de"},{"name":"Christian Bernds","email":"christian.bernds@5minds.de"},{"name":"Christian Werner","email":"christian.werner@5minds.de"},{"name":"René Föhring"},{"name":"Steffen Knaup","email":"steffen.knaup@5minds.de"}],"homepage":"https://github.com/atlas-engine/AtlasEngineAPI#readme","bugs":{"url":"https://github.com/atlas-engine/AtlasEngineAPI/issues"},"dist":{"shasum":"502ade1e0dbf5dd1939b161f4843a324695f0084","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.0.1.tgz","fileCount":4,"integrity":"sha512-vsD64VRsFe8S0d0siqj0dFcbS063orY1dJQVa1JwhmPl7JtKFFqwlvUQr7tau8/v6s94FHqEzl/BpuD4+xtY4Q==","signatures":[{"sig":"MEUCIQCxsVYUQp6VVjCjqHMJoiF82rfd6IG8+TuxI2Zx7vV5FwIgYFcVgI+1/+H8JqDNiqbrpGPDri8S67hUnFavlEN+GbI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc58hxCRA9TVsSAnZWagAAPqwP/3q6fgeU3ZlTfWnKi5I1\niAq9Kzul/afSU1dIsSLjtA7JU1xb90uDSBEWYCS64ROXN67jJC5IojTkSndh\nFbbN+gE+G4CZbHoYHX/Q/3GdE4Sz5jeiEFr1YKmaO/XJExblIspEhhnNNWQZ\nI7A+87hEEYnXcQXKltslt1DWTp6dhH3rUtuM9fRmvMz8D1eFnz+PiojsE4pn\nvGltq+oSt0kZ8JHyc/QkNY/+0Td408tQHJVD9aTLbkx8HAoXdRMaMu86fvo8\noNNIXXP57n80h6Y+WMryUii6d1daSxv2p5u8fmGrim335q2GyaRqP4819Ri/\ndJdk/ayYbKzHSfikrsXl67vetKndTlSE6/ltp9sZ8P4KAp0wO2SNc8isGmkL\nkaamZYfOdkO5LYi6XdKl0w0pDFfYXItwaR1Km5g5eSi/3YEdsNkA37IO5Cdq\n53+QIwqMQ99cyXO4jQ9AptZ2H9+8IAR/NtiVNfwYuIi71zzgwatNbg5JGsH1\nOkXwTM8mwTM6HtoAUohLtzrpm/09wroBdsFw7SbeeQRe4RhkWyRF6ErbzdWz\nt7svJR3whNdytY1lXphbGw+4rW3fzoUN340IQ4ODw0Ya7106AiWuQY2eIPGN\ntXscYK4iNjR3w6hwWt5AxNfWfM45Lo5jDrjI409dGEVScQoS1+IqU8j7441T\n7Ida\r\n=a1pD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","scripts":{"lint":"eslint src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","lint-fix":"eslint --fix src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/AtlasEngineAPI.git","type":"git"},"_npmVersion":"6.9.0","description":"Contains the client that users can use to access the AtlasEngine.","directories":{},"_nodeVersion":"10.15.1","dependencies":{"bluebird":"^3.5.3","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","async-middleware":"^1.2.1","socket.io-client":"^2.2.0","@essential-projects/errors_ts":"^1.5.0","@essential-projects/iam_contracts":"^3.5.0","@essential-projects/http_contracts":"^2.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^5.16.0","tsconfig":"^7.0.0","typescript":"^3.1.6","@types/node":"^10.12.2","@types/express":"^4.16.0","@types/socket.io":"^2.1.0","@types/socket.io-client":"^1.4.32","@essential-projects/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.0.1_1558694001086_0.16209611621552766","host":"s3://npm-registry-packages"}},"0.4.5":{"name":"@atlas-engine/atlas_engine_client","version":"0.4.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.4.5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"cf67cfc1b8af16162a5a1dd6687ba9a7e5dd9d3b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.4.5.tgz","fileCount":59,"integrity":"sha512-wTqXnIv+PSLBTGVfP6OkpO8gTXNkmV6eUxdz76UX8TXCGRsXVxIYcYKEu6s66F4nXM6b+y+7uClqDvL5jD+33w==","signatures":[{"sig":"MEYCIQDHKGS8Md77b0ltBfOMCDE2auiIv+kLYGwYTBRj+nAT3AIhANNlbLuK4vNmdBkivW+HQq2Wr/7lCeXi5hUvyhpL1+KG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVtfWCRA9TVsSAnZWagAAfagP/AxYikO5oInakKveL3WM\ne9RhgLLyYe554qQ/NaCFSy0XdcKOC6f2d5E+cZhoH0clThOvtuzP5aTfJYch\nWoYcT0v4G9/LFryBXEplqe7Jm3jngfZe/8vOcm7ftksKKI2u9JGZDMnYfzd1\ntfaRX4XiDdKfiREVBBktgET8L8xPjRbyjw2ai0yKfGExKas1goUgEcxZcZa7\nLs+mUAxrrOOsUhEgtR4Wsq11QSPTB5FXqbuswT3dzN/mr1tbnD8CQu7+RjAE\n6T37noo47AT5Ca+sanZ/+JzlmEIosCn5AyYsIhW9RAp7Y2jqbSZ7n5D4Mavj\nQRs7xHi34IwEW9NRgxGq8dssLXwwtJXKOsIAWbSAJJ3e/zLNP7Wu6BsrD0/U\nJTd/tUUzMPWq+AKODMyT9NhALOLAtzm9WQADWKVZ/RkWNZeuz7xc6xy19Vl9\n91jSFNmzlYImi2nQ9DKm+nFV977q1njPIGwxTj4JTR7b79ydamE+xdirTzpr\nwjZmU6lWuW5hXRSjeTfzOo4p0aX2h0G7WOb4jMjuzPyTu6dgzOueSuA7BqD5\nj/b8fVAegyNnczWMNNKsdCtJ3ylKBgWcLchT1yQGPF31+qdRlLrwv+IeHav6\nuCGwXU+wPAVYH3LQqs8JGvhu1AlnkTUvZo2ZM9cTp6HrUwmKeAehAaKBlhKO\n/oKe\r\n=Cn3i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"c0b9769e4201c4d5695c1aed498fd05ee9746a05","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.7","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.14.0","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^2.2.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.4.5_1582749654433_0.8507542039021798","host":"s3://npm-registry-packages"}},"0.4.6":{"name":"@atlas-engine/atlas_engine_client","version":"0.4.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.4.6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"10c0195c4a5228abf2a32dc6602cc6f01154c460","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.4.6.tgz","fileCount":74,"integrity":"sha512-OjdHmQhEDYNmtU2k5Po3KcJdHHnbyq0LjN1EQ+8pNz+A0phZWBa86tZGVz9N5UzOPyGtSQaN54UurWB8txveAA==","signatures":[{"sig":"MEYCIQCioR8ratUcQcVlwUiv5oAb/DTc/Zck5qpNs2LjpPs2UQIhAPwBlyy4N5NcBDtwsAi5/yTTYnvUR/8e1gWPIl2zqwrV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":182487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeV8i/CRA9TVsSAnZWagAA9EwP/1jsEa5jxNWpw3hQOHe5\ntte5s0uFqvcH83giUy559RQJsOt4KL/mMdfrgij+vj+lSK84/mG5NREJTi0s\nvO2wO4wJQO0yfN9icO9/Z12xgjnKFnHud9IDHIljUfDWNVSggjrxg9Aej7Pg\n0EJFRGaUPCCBn7NiquGzTPsNVjUAL/e1QlC3VFKyzm4he/TqFjBJseh9Ea9c\nQIwVwtVKM3b1LUfgAECyKllMXgtHwFkzTQ3uHtNbOkrMSA1jGvocv5cDsZE2\nfgcIRR1O+BLt74VZBloImw/vfR30D4BYdrAq8aV5bHzV7bmqsDojLGXuLFo4\ntePAbI8WXjhtgdP/MspF0OUrXV++ucitmYCQ6JUdpTUjMi72x9pIYdHYecXg\nwY6jc1ea2HaUkqf3H2ZDaL116aRnehIVfKEfdujm35+uQicABNW9nfO/3z+o\nJ5/ZhW4SZ94TZX12rz7nTQCHLTmXJ9GOlmdySCt2C9kD3yeXJUpbJvG1871L\nH8gn7ZwiOWLZmIjIpJ6HlM36Lt65Lyh5L1ietBh3yUxdR6baJNdjk/ifF/7t\nAecPMkRdubvY5iL9DwZcaEKaqUvTGFFvJvpgI2waZMd2HjQH8paC0ct3YaRt\nTj8QQ/pSpjUeu03LC0PF7fAUJQNKMrOJ0I3HrU9DkkG99+YyEzaGr1dQdhKK\nTiVj\r\n=NXiX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"e650b7a583fa5fa8ebbd04b75b9d1510d5db53a8","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.7","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.14.0","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^2.2.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.4.6_1582811326968_0.729603630475679","host":"s3://npm-registry-packages"}},"0.4.7":{"name":"@atlas-engine/atlas_engine_client","version":"0.4.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.4.7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"4da1e38e251ae862b32a33b8e63c2b159e50409c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.4.7.tgz","fileCount":74,"integrity":"sha512-OgH+v2CLFOxAI8TxWea30T0YF2GG1uEkyhp5VU2Brf/pQK08oWGmvyeMmLB/3q15uqOy77IM6via1TrHCvX7Jw==","signatures":[{"sig":"MEQCIB0h5km9gdpeduI3hD3YOmPPpof3ygSrYsLYNICDJHelAiBt9KoR8/Yz5wgcLLfXwybKLPhgp5ScYJbMNhXQYD35Vg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":182903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWBgMCRA9TVsSAnZWagAAgX0P/iCjzPe3NwsDEEq7frIg\nQJYeA7skCC8drFM5a21xluNQicuYBsKclxlwmMmglZHt9hZXMp8bfB/HL3b0\nv332qs5BfZMcHyiDSBZYfd5f8sYdCNX+fVJ1FhaePo0BBu0NFApGKxUJPhNo\nLrvm86Kf0ZobwaPTbfOvDvkXhUtPOkJvkSUY+GLrB0BB7BicxtAZbtq5z0Z6\nkOIcNZSJQVWG+hx2z36gY8Djm2Ehg8mkmGAQdgZssHESnkJ13noRkiVxcMpK\nA5VpMKAA2k7PBaIVlSwE/L/UYy3GQ9rgayvHA2C42Fz87GO14edlbWr0hVXn\nzECYuxTfJncIaFSDmivQotbtIQX+nZ3RH6pStCG6gaZAggBm5uU9ZIT0y+0V\n68iR+m518xXLGDKp3KjSQA9IAMJm4UbjYJEU6NoWkaJuW+FxliG9xfrZXwe1\nWsux+NtKh1tAfxsMMD+ufMmEcsYXOv0FJ2DC+iJsI5BJsWViGK8hhzTPjd2I\nyETKikZ130aV5+tjTH5DgYOINSnX8rRSJo8KksXybNurDfjeZDUPFkPEIl06\nGPlN8hhgnuqFml7ac9YwVnogEqMWz+AQ8JrBFFAO34V1FDGYqtGL2UotAnpH\nqMeX65ZiFCGFtJ4ncusjpB66I2oAaFAPdQHTC/ytzCp0JPwBAK2XBeiBwrFn\nDyDS\r\n=fhKV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"6f7db95164ba6e013a6e3606d157dc9f142b51bf","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.7","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.14.0","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^2.2.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.4.7_1582831628536_0.4603690745541613","host":"s3://npm-registry-packages"}},"0.4.8":{"name":"@atlas-engine/atlas_engine_client","version":"0.4.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.4.8","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"ac3b5c3ee85e3cf9d6f3942cdd736182e6d3516c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.4.8.tgz","fileCount":79,"integrity":"sha512-ErVDkbAvFYBO0ku3PG2fuXyNppXp6oOnGhLeFfLZRzdzPirTzCPt6ar3bcffX9lPk+Wqnlpi4v4bowDEEO0C9A==","signatures":[{"sig":"MEQCIC3q89Zh/eG9QRPvV74y8blQd1DU65M/gg5kNeq2deyBAiAsLI4r2XTowZZr8x8wwaSXnpLYtckgq/qtUxkwEAionw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":186832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWDLLCRA9TVsSAnZWagAAy0EQAJ2MHJsN7zRiPbaNUuUM\njCO/nVIkjtIFBaeaqZmA7OBIA+aRevp9mdOVCpggF62gKJTL2Qisk+Ey7omM\nDCKyRunQH/XNuhVXlvbmfN8xGQ2ewIqAMICq1pXv+DagwMvjL+Su3c8RyuWS\nWkAoWAiaoRhsbgarISRBTrPdR/KdzpXlGYAR1IFEjWwOM1uVFGSHEOlBK16A\nG1agkKv7LVGAglZbPL2cLC9od9ePoua+A88mLYWOp3+zgEkmFT1P9FmOlEj4\neJqnKmBrk/KF2A2mDrHvrP1KRhQtHrK8cfPXkJnQMgGxKdb8oXqnib0EH5d9\n/0G3Fz+TIRL4At2B+lPoH5jzVnkMCOcV1q6K3VF4z/1EmGkNZL0o5vJ/+Z1C\nwkpiXK0PUHdqGDDSCOSg4xukrAXlz02KYoJ4AU30SewRCAs4MxuvVxylLsIL\nwoUzHHsQQFNrLPYsshsy1na6cc8K367yFl2s9sAhN7sH5oqeKdX+hSYUeGej\n366S+wD1usbExE8/A27n2IRXlrlGC8Q6VRoj/rQwP7xnpbUUFyQyQsf18bOK\nLdY/rpc4plhXyzaVXpkmfNiNB7mTbZP4VwO/9N1NcMBz0WgjdHDn2dJWliUK\nnyLTkqI0OpHP2fOP1B3R1l+J3d6E1F26NXsg3WLNqaLhZebiKGZqW+AB9wVM\nhI0R\r\n=zfrx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"48caa6f2ddc892dfcb953b8d71c14faf3ade5491","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.7","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.14.0","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^2.2.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.4.8_1582838474920_0.46925378937217554","host":"s3://npm-registry-packages"}},"0.5.0":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"5a73dc709065250b723eb11546675b7626346045","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.0.tgz","fileCount":79,"integrity":"sha512-F5xqwUqnSt+pvk3SqHw5kUr6T46tH8UfF2znJsF+o+tnO3DPA6Sqe/dEvxMUAfbSJQbIr1WEntKDxtWrAHsZpQ==","signatures":[{"sig":"MEUCIQDNyBqkqkdqaDgylwXsF9WxmgINbuQ0y7k8uijmEJJD7wIgFSYCzw1cJsUE6gi/MkPkFLgqr4E2dEWgEHXRUtlz98E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":188170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWN1QCRA9TVsSAnZWagAAF38QAKAkT1UmPBKZTCyo6FkX\nGffPp9fp+gBjwtRuaiAHURq0kBuRtXjwIdEk5O3iiDBknUNxlE03QKIQ5nyJ\n7MVKNNH4dDLtys+Hw7iUoIsbn6bvT/jl+XHhdRmMDZM3OHHQ75ZzmKhgU0i7\nq5RMr5DogVRl9KfjTSMcQKPdFQzm/rAySz4zzOEeRdPlvE8ISn2tIidu3bWq\nkI9jAKsM12YSFFF2qVsJ3XvG6IJWMflEwbQCTEuneEMT5gUF4n1WXgpMnfcP\nSXtG81gxHY5FkT8eRYlQch+RjQ3G4uTuIRRkZb29nUrJSvu9rxbpQ3SKUyEG\npkRfRrHUMUh9qde7ry77KBjSavNCapp5Vhg0sOVGY4/ilGkN87LynVt2oHD6\nwEM1dsq6WHs2e5JsHND7Mw75uETu4Tno5blCx9vyo3J9AzpDIOlSYWwopIJI\nAhSMoN6z/Weqg3KZVywybACtAeDuZ4jfbCMfj2loOTkfFXf4S3dTpMlnA5dE\nxORuPzkWWxhXxUd95xAfZ1CsHuX1PjvcGpd/a6si2Tm7TFsUwV+rVLjgmHaj\ndEDBade3jBSyxBSnyzIMXVBihoIaUa6BJOcusV9MJv0yr785ufhje1dTP6dD\ng6huPAQLDGQ8DGHmMP+rNXKYUk6NoUW/DVks1qCBqJaTi/Ob1IoAlfdn+6Y5\nMqN5\r\n=0h96\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"a227bac850000f144d69a9f56492971a6339fc5e","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.1","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^2.2.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.0_1582882127588_0.4122790536014713","host":"s3://npm-registry-packages"}},"0.5.1":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"8dfb786145c401f22d0c6ec5aa559e1387145abb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1.tgz","fileCount":79,"integrity":"sha512-A3o+kHeE+PpFDM049iPrBo0Zju/qS5V9pJsk4jXuQRASfm7WT8x0X2NpwZEMLrn/OKjJEa6gmNp87jBtJEkQLA==","signatures":[{"sig":"MEQCIGpIo2fDCssC5XawgQYs2PScxMeubMRiK9EouaRWqsSFAiB6Js/Wa6CV2yMxAqGqVDJAmPuQEDhCEYWkzSce+60OcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYKsuCRA9TVsSAnZWagAAyQcP/2K6JKeiRQchn3ICy+l4\nyeuM+4XL890ugi45I+fGilZ84YI2YmAPlc1+vf1TOmBmnvjFh3VF4QEqFOAC\n4RZZ4s24wDogEkuElifedb9R/YoCLStp10U0bydU3ixZWliNXUxvw5tmn/Ig\nefjaFoxRR8cY9uLcKWDXRA/pH01BGDqw3gZwGxswHec/ktCHcxbICfTP3YL/\npacomzuQEcPUKzhSLrUTUmSQvo/Rrw6b10uvfCUTtHyUd++tGfdHI5KS6RDJ\njuFYKBDS2r2wW1W8lka+GI0H/KgQvEVRg6Uh9Js2sGYZ5AdpXU98ySEIvBtt\nAQUUVUZl6c2FQ6lFqsYdnSCGyy00xOagycOgyaei3udhtCbh6tTudGMDKoE7\ndPP+81pGkE/B0W6aWBmQgrOK4rW7liz8A1kjI7pqvrahtg7ug5rsdKma2R7R\nSZrTMRxxTldrTKldjx6MdkjT3+fuQyu9kNRvAC90j27eniLpsue3Rg1Tq9Py\nOlbNkgM+xPA9aOLgKRUHrzXfaTVJg9WVp7DzkoiT1DSR5tk6Z4sryGBnjk3A\nlxWS4MnYNppuX7hS9LMEOlCzxBvKu9Abz1kPQOEq/+X8KVLt6lWmFAd9jfg/\n1K0yWfsIkUq9ATToIKbJCu4nP99F2v/lFuixXfkWCUGU+VohirApxaRtKP75\nZH0w\r\n=kkm4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"b5cee298107db398f6e46a8888d93312647bce2e","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"obivarg","email":"christian.werner@5minds.de"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.1","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@atlas-engine/ci_tools":"^2.5.1","@types/socket.io-client":"^1.4.32","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1_1583393582243_0.05043106724631419","host":"s3://npm-registry-packages"}},"0.5.1-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"d17149dab3b7d35409f01cdb10b57fcf493b1f22","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.1.tgz","fileCount":79,"integrity":"sha512-/WNP9cBOJ/uy7t1blc83jmpFycObOL+MrWcxPWAN+u1yS4T/Lcvt3cbbUPW8YP8n4o2Oxb74mlRr38nEU8bsUw==","signatures":[{"sig":"MEUCIQDg7oHTk6ijdN2pn7gFSE1pBlR12jd13BJHmO0Qjtk9DAIgY3GzAjdYSbqcSw6GdtIsHt2vlSd4RTi3BLJFb84cBU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYLmNCRA9TVsSAnZWagAAkVQQAIlX2QK2JPooERfc1vTH\n1yt40C4vcMAy0jWgKp7eVePI+i2ADSa68i8EEER1f4wAu//TlRuQdkCJzxfe\nNj3y1G9phGKUC6DNZ2Uta789R3jSGuzqpZjHJEnYLcYnjVuQ7xYRdyfJSBlV\nVPzcqroz+QvdD+lfzJBtwtS5ea/Vv0mPWJ5CIuHdQX0MaKxEqfF9g3Hs8b8Y\nRCGlJwuex17z3+bs7EMiJSDttM/WH9/bLbLM8z0Xl1B8rRkKIkK7iVqxoUOu\ns9w/98g2A5Qm3F/NBu+fltW4mRGwcxSYA5zSaLj9L+Fj5pgRkQOB+QDkxsHK\nq1YZQmCVVNIwW4/re4hKG1SRkJ5DQxK7CoQR+dpvW/DLq4zalEeY8VmvZL+c\nVxXOoFyY581QbqKjJrcVCBzpMk6gMk7/52h03S6eakwaaqfvugBVqj1ooBAS\nUbYlVMKPrgF8Q3OIV2F0ZdCgRUaYmRrqo8KYBF3IkHn8gGpRj/Hgu/QSF6cI\nZegfuQO1WPmdXFxAt04RO5CQSq+jl5ljS6ig81gqpXlOZhDM2rKUCpBN5Iwp\ndb7vltST/e7RfQNsbYV2BRTHLaHh9NawcogNXKhuagLzy5RN01ILnoaplTmS\naIq2EhkducDAVvzjZQVNzJiZ2nyKqY6VO+2VS5bL8KwBdiBoNY7ZdiKMu6Ca\ntx+P\r\n=RUf2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# User Domain HTTP Client\n\nThe clients provides HTTP based access points for communicating with the User Domain.\n","gitHead":"2f2fa18159af7a45719916369ee1ec3450196174","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@atlas-engine/ci_tools":"^2.5.1","@types/socket.io-client":"^1.4.32","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.1_1583397261383_0.14986617237039446","host":"s3://npm-registry-packages"}},"0.5.1-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"4c2dc30c46c029a22c919f4b168b333ae847bf66","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.2.tgz","fileCount":79,"integrity":"sha512-k9E3HSkqcDS7TmQLuaiLt0jINTzT51h5bXUledokcFbcv4OfVw48LVE0hasMIX7iBY9QAmVS7icxQGgk67nN2g==","signatures":[{"sig":"MEYCIQD9yesojHhyHdSM6ahEyicFf7eEtgf+Syq00q6LBzRtMwIhANfFIZKeeDng8S+PS0u2O8TQlbFrJMfZan0hSNoDSsEC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeceNcCRA9TVsSAnZWagAA1agP/jM8mamdSiAdNVOCDUfZ\nIkaPh+Y6tuUVdOPi2JmIB6813tM8LFHlreC3GAudLJqDbT3YzNMNcjDB2NHQ\n2FU5oBcDKxwrENtyc4dNcknABt2C0BoDI5jW4l4ag296JZuBctSIsGYveisC\nZmJJwjtPVQCxjdLfmxe8NFtAeabS146VuG0u0VYbMXmVjFhRkfOxHsPcedj4\nhuLM9bjId9uzupx0nDlVC9pwUd4wpZheb8UzmAfgPTtlWE9EaUILuwLYxMPk\nUeOdJZPj0+9Ex56mLR/36J3mGp1bWkn9xc/afHegpEbSanblpRsn23sckLO0\nrHM09iJUDM5UMpuXBVyvNLWf+Wz+G043CwWCcFnMi+Be1yYKJLoIpPFf8G+I\nqPbM9gK+X9JwZeAkYyGvLc58y55ujFlVyBWnWH1W5z3suSbprS/3kfkBThFp\nI6x3M/K6p/OsrNXOOfqL5QY/e6vdu6M+2RzAfTyE79huJE+U6xAANF2d+isW\nvHgp9SnnK2MCWYpMP52XlColtmO2aA8L+2wUUhpZnw1NELVpRkEkVWrL47rT\n8QSpwlekfuCVubeEvVz5rS3VhjZaFi2B3tl/2VfCGAH+0pQ7R90PnOwRYp6J\nqPepollmQ6THIquK0KmgxOtUwVvRBxTAKUPv+FTasP1jH5UPE2zlivXAGYCD\nBJUH\r\n=vdJa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# User Domain HTTP Client\n\nThe clients provides HTTP based access points for communicating with the User Domain.\n","gitHead":"f16cde6390e447bc09169664eb43746f5c883eb3","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@atlas-engine/ci_tools":"^3.0.0","@types/socket.io-client":"^1.4.32","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.2_1584522076295_0.540213565869686","host":"s3://npm-registry-packages"}},"0.5.1-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"cbfb5b08afac061afeaf1ac2005488467a38af85","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.3.tgz","fileCount":79,"integrity":"sha512-rDe6bmXJkslSgXsbMnVJc5IPD9t63upN3Wh3WzobmJsgtbKR5ogH6JOXGjuTUuULGEdfoStGoY+bf1+18t7zwQ==","signatures":[{"sig":"MEUCIA+KZnzVLLDG/dfUCdbCgrkOcSXEMZ4gKyGCFR9I54x5AiEAnnw7x0ggGE4Liz91jfJFnMWETSRzBlRwHKiggZ1vFCE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecgXuCRA9TVsSAnZWagAAMzwP/R5Py1G+VeeYl1x9eRvs\n1LQqlUGZQhSX1Y1HecWbKuyPW2mlISR/HFJ562APU7BYglrbZ/py+JWfLQLk\nFOnPY7mybCbpIIhpsyrpU2n0t+TmtXwkwIL5s7x7wZ1EpJmRQOSlzoJGyoYE\n/oxhG7PDH4RappXmnkgcb/YuRioGp04bED1vIu7ICnAZvUfo03VdXg2P8NIc\nT9DlDqaeaE2qGPpPFO2iw7dpquvx0RfVWNwgR4AyInloKdSygFe1iDyBQ7Ho\nwCJh81C+SFiyvckLbGqh/ogXvrFJ0P/8XktOnGiVJPtvxY+e0XKT+vKcCzBu\ns+JlaWLS7U5KwzmK/HZjV3QjLRsVsQwdGA6tInZBHQsl6VPuZghgwkc9Lnv6\nBzBLzMjxBXb0/8FgfqOQYhbuGKZw8xxW+gx7YpT5XRiuZjFg03SpiV14BuXR\ngSjIryIqgd68YjUHEUda2/5IjN2vay3Ao/4ezteeDI15RwV7RfzLEKRJfouz\n9ML8Zu0OzTK8WmRHD5v0Pf1aJljQ/ytG61EzHp0wnJz/+jDd8YgKaKxYgcwt\nClLTLNLLBfciEFKNgzsQBIinIbqDkmzYoi0cMBUzvpDSUd73rXliKKL9jjDC\ng6Afh38uUFxvSOH6CVYB+3I74bC+cno+7kJuDT32eqZeluHXJBxHILvlTqm4\n0ggt\r\n=E17y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# User Domain HTTP Client\n\nThe clients provides HTTP based access points for communicating with the User Domain.\n","gitHead":"a07892731a847510c29a480b464960a90f11864d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.3_1584530925855_0.019935196159765578","host":"s3://npm-registry-packages"}},"0.5.1-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-beta.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"53096a43c8ea0d369f6be0515e1f903a8b1b8f8d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-beta.1.tgz","fileCount":79,"integrity":"sha512-L+DEIsn0QNmMXqZ28y6jrdt9hXoiCcN92snXdUAfXa1QosJO4fv6fxGPESYWhdyN7ecvaayNXUgNr3Wt4Wyx9w==","signatures":[{"sig":"MEYCIQCQh5786QgqslWfUmNeXhQlLDuxY6gTLGv/LvW+c4yvNgIhAPGcHcOvIHYjHfFC63za5aStINyVv0xnpbEH5xknwNhW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec70gCRA9TVsSAnZWagAAg94QAINW1CYfKHRy07NAnTae\nsZ/IAg5X17SKMlXeNXYrc0JS5Onzm4E56JlFO6/ojeNqxF+atnSb8BD2F3/f\nnnZ7KHbv4ucbCEtjWx4HQhQnRdSH/V7Q/Xrp/z9XleJ6zqoR9zn+IZh/bYWP\n8cQ/3SBMzchaGYWdWzf4uBc6NbnQyN5lu0pmfRMncl6Nhkwxv0aS8l60YrYH\n7SfBk7r2oYtefXJeVMgzptRIWAqfAkfqI4u27hXBbhUPPBcCKVhKYhw60Fcd\nTYBI1a4enk95QPtTFZJd+YDoLxEiqJd1NII6Zdato/I5Ucb3JgKJ6tEFBVqz\nSXzyf0t2+QpF92kHa2GMMjUXsxGPE9W90PS+1pPCeri0cWRVodUnnNJfsFdy\nofF1vUwTkRRiMODSQGxhXroZYWtf+NAga7xGobpaQ2NqqJjihdYOgCwVdIBR\nNKCVm+vgJCfgcscR3Vuaf4z2A5yxsMR0z6ZYvGC2Vek2VzznrXHt+zPp9Nbw\nj2VgYkTBLAu0LV2qrY+SZUlI/TRK+0IAQE4Hd28s+vhXB9Go2z7q17WNanPR\n4E5lpG8FGDd7lEg4u4cp4O6PrCQ+QYp8oyYrIi3s53MUaO7uVxqKLiqcpooN\nl8gXjHFBm8znBT5Uh6w14YI+Sq9Ld2EwHpl+RPqdr2AQJqq2W804vDakOkot\nCGfS\r\n=k7he\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# User Domain HTTP Client\n\nThe clients provides HTTP based access points for communicating with the User Domain.\n","gitHead":"27203c30fbaa51a37f9f4fe17ada61cad38c32ef","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^0.1.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-beta.1_1584643359840_0.3959223691104763","host":"s3://npm-registry-packages"}},"0.5.1-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.4","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"e17c9a53192d1101d09dd01b09ab3ede85e6185c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.4.tgz","fileCount":79,"integrity":"sha512-LK5iN+C80mEoXndyKC84dr11CgLjMW0XQl0L8aV3MVu8CKPrFBzazE9CF6IHpO/8o2WHHZxiulkVS+5rvTDjPA==","signatures":[{"sig":"MEUCIFwvUxdqTFhqNz3MslJfBNXeOsS+J5TCI+5zZMjFsrndAiEA/WcJW+grPAdp3DpaZmSrHfnE+HSPZfWvsvk+ZgpoXiM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeedexCRA9TVsSAnZWagAAWqMP/iH03+X5myCPZkrKRNB8\nfiMrKZchYLzeGCDAhlJdGBROKT1lnVky8ZkyTpONNa6YPfiEPQ1HlbPF0PGZ\n4/voAeFv5iprSrP+X5UyRukM0+f1rhi40xJ02rROPfa5BepsQkBh7zCHqN7B\nl0dMJ0G4D/pqEbrzbi7q9geEb9yk40jdLziS6GkGKZhh3D8ljlk/Lh7SJ/sC\np4uRxyUfhdVto9EKq4N3wV99C0ci1WXoHkb2b7J56h636BlT0qv4qzEMlxdY\nLWNokF86oMrvRaTFpWvFNQK5XYt6ngck5IW6rBg68E+vF7pe9Lau9jtWamH4\nG/JULeqaHt8WYw5iONG3TU2pPP8uSYIm+BP94dKe090jz0rvs22sDrFHG7aC\n93xY3oxo28ytBMEEL5jKbAYOMdIE9mwZUYyyQWR9P/lPw8QnDcE2Da1jYlcu\nuqrcZ5wOueXOKzzUiw0Cn8eifp1iBUgzyJ4f+qxkt+kLKDcPWpZyJmYTwbJO\ngq01YbO+DCcW+P0IAZmEU5xy8gSBvFe7Vs8GDmR46kNBqS1jdAZ7pZc1IbLB\n1NQXnGMRe+1YJ955Oi0ZShfuI3odjSQxcDtxDkcNjLjP1NiVFtflqvCpeXkf\njngixtjgGxoCuAMDcuDRKtqN8/tnCFh9t/mEiy3U6Xvo0nasrdJ+bCQ5Nfgh\n8E/k\r\n=tzVA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# User Domain HTTP Client\n\nThe clients provides HTTP based access points for communicating with the User Domain.\n","gitHead":"cb0094c9752245db17cc74f185c0fd890aa0ff99","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.4_1585043377431_0.7700444892226568","host":"s3://npm-registry-packages"}},"0.5.1-feature-fb1f56-k85pxdvu":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-feature-fb1f56-k85pxdvu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-feature-fb1f56-k85pxdvu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"3727cd533607dbbd2f55367c840d1f537584e37b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-feature-fb1f56-k85pxdvu.tgz","fileCount":79,"integrity":"sha512-Xj5LXj4rYxRoknNsBQUiVRAUZeT67AI+k/mvJ7wvGajtLXUjFdsGhfMgW4syz1pTj/FgVLJTMS5VOw3thXjR8g==","signatures":[{"sig":"MEQCIH9LJFuac8K7bOxSLFf9lnN9nYNEZzz/XgARXyap1BdkAiAEaQOUff2nMQ/sEw4g42AR0iWt/VRMjvUbGh0t2RSJ0A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":195999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeedf1CRA9TVsSAnZWagAAQeIP/1Lo2HYxTjFPrnVUOaEF\nQr8DUJYfsjssIXEvQvr4OOLl9Im6CFnYHrGBf5sZCZdU02Ncs1W16KYrmA2n\nOFE4BvpY0P7jobSdFCGQ0SYAK2pYfYRlpaVQzNSBxIL0c0i+ZaX9BBpcGm7p\n/UvmvgvNzgemoIUpGFdccnyCAkAxSgtHooXNVy8As3jDwnArn3+gXYayK/3p\naVfXN01tlLj6CmzRIj/f1L0fXwMhW2y7x31xofXXaRpj6t8OIz+W13DvrK7E\nRGXF2ONSdbfPHHgsanIKgUPW7pWzNIR5+6EXq/tuYPLqwCnDJqiff+D6hYF4\npmgMYwpw10TYJc/1gaLNFmWEvpuKHVtkcrbFYHsKoXAnspdZbsej3o8+LGc1\nM+Ym8Ep7I23QWrxU+39D20cbzZkhigcWVKcyfgXdY2eEJ/FjyLZsQZHR/Sc3\nHNnD8KyRU4YiK0GR2toKWu8lb7VWHD+rox35Sh2kRVqYOjm9hzSt6qkZhRFb\n0RhWkR/X2fLlbhBdJA32JlM5dJ0KfA8CZ686MaMZZupiuy3mYSZYszL/R1Jr\nc2deZxVVbcxRrznSRiY3ImP0/p3WS62kC8F82iY2j/sh+VWy/yO9pGdarxue\nJzvxbgNt3dKjer16mQ52jakccpvUxLH0C8turq76NzKD3okydHttjAqgU6Vq\nz/Vf\r\n=AAtU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiaion.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as paramter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the User domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"fb1f56415aea1ecf0313aac9362aba39242f0433","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-feature-fb1f56-k85pxdvu_1585043444856_0.745788731153578","host":"s3://npm-registry-packages"}},"0.5.1-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"f49922504c32b3c4d70b2e4022e2aa6e927bff4c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.5.tgz","fileCount":79,"integrity":"sha512-zCa0KgireJ4oPTPcD1dTzvup2CAlQZ1ljbWB3nF25rZabOUN+/I6hJ2cwjC6fBqfcfToYtWx4cqtuMeJakG7qw==","signatures":[{"sig":"MEYCIQDkqdB679qugbtI3L/qlYPbm8uSuPFHVKNgwl3pa85CbQIhAKIppn1hZWzyeVI/u6Vx8huSuPJtuvEQk8ni/hwAlVu9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeedksCRA9TVsSAnZWagAA/DsP/3IUa10DhFOl9F4tmT04\n0/ou6bYOC8ygjsYqava4wJOczmGe5hVtUTR/aKeHqowGJzTT3Zm3mCijoXbh\n2rICJwZlka5Z3rZc3JrfTsRmpCk8FvvrhFTdl2Y5/SNk13i+0T4HQPpy0gtG\ni4tBMpfx/Lp1W78talNLbomPSr2JDp6AHmJmcv5yppqEmgfVa8B2wil03Wcp\nxKnvrP5YZM0Mt3r9thz3sLGInydlzRALc63FuJjom773Tulxm7mdMSXdu7NI\nd3XVmRxLWWuqQSf8+/auphDW9qMamY/4XytiqPgCNPM+9CHfhF7i9OXqAhhp\njCLBIJwH8tkJ9xUqCnhdGYhRIsmd0Dlrjlc+u9tlTu7TYygnHg17uDGsxrix\n93kfHMBaqL8Sbtd6q6Gt9K3jJLkA8fyBjlAJLMEo1zIaULkaTXrVRTWnbRkS\nsFyh+XCM3pjk8QngL6OSVsZgkULYwH1qe1DowSFBsJw9CGXwUGxxRfrLPGpu\nQXAbj7dEZyrSDqhosqIxPlKoNM5Y1f9nhDC/+Nj75C+WCFq5bZwUpvoOx6Lo\nxzbs4u0v6NLgngQ1tPFllxl8VRp4a/35KhhRAYbK0ABZUUfWUDk1htG+BluZ\nmwsFyiqF6Zqj/wy643R6ChUmmzrfzKj9f+xEWuL+Od2CaAhzXQEkNoeRIC9t\nNPTF\r\n=Fv8n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# User Domain HTTP Client\n\nThe clients provides HTTP based access points for communicating with the User Domain.\n","gitHead":"8a358d2140267a8aa411bc8fb754a1614853de69","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.5_1585043755961_0.7887238461700328","host":"s3://npm-registry-packages"}},"0.5.1-feature-5ef729-k85q4x8h":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-feature-5ef729-k85q4x8h","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-feature-5ef729-k85q4x8h","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"63eab9723b923207339f46899a6fbf72746d439a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-feature-5ef729-k85q4x8h.tgz","fileCount":79,"integrity":"sha512-jpK38WduE4KoFQesPE0yzyAbako/sBJEIPRY2+SkM2IubTY10Ym7IzffJQJDdD8H8AdfB80U2pUs37dYRXPB2A==","signatures":[{"sig":"MEUCIQC8NSEluXpZSDB/B4rwePodgovQEe9xP6DH6bl4UyR7QAIgE6pDe+FNptRXGICyylepD/gq5u6MzPuYJ/dWcsgQ+Wc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":195975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeedlNCRA9TVsSAnZWagAAea0P/2q0K8XBkhrD65kqbtMs\nIAmOK2vcqlTz732tQnKS2ECnjyY7JQMgo/c9hoMqOKkQMSKgiWrez7olxXjY\nsMk7Rs1lhoUet/O1lan+OibZnCjZl+RybJ1PgvkUsJyti5idl3Tqsft/S9yd\nW11mLigvoRzCckWO8xJTUDXspACVo2jNhm3eGsex8pvYILCFG/zHVBGmnza9\nn0cWMze6mtIp+Rq0Mlk9XgkMP2QchKGVp05BsoNE9LkfbN37eu4sylzY/cIX\nW8O7s++ysJnvjgWb76Bq4epreUmHjupqikzNuCUe+NkE+eDJf/nr83goNMxL\neJ/5lN0sCgZZc7l17ukhYBB7pZuBvSYafnZuK2Ay9jyciC5RTs1mdtYyiOUZ\nl3HAbUcaSvCtxBiV77EtthUJRovP1Ok/+2Y8aBmj/jxYGJAeQubQghmIeMVq\nY/nQE5oEuEHVEinJI6J5JGSFgqppP7OmwqEJJw+xP+UB2if9BXlOeGh7zoLb\n7iXx4hhtV21gbVIK7L5EiEEiMnfy430Hhx+ZZzNWS9RMnKCZ7hM1Q9BaVfpU\naAp3DxjL5ddAhybmqriNL6NoT0JVg7y2ElSDXHbVkAhrGGifCnRYgwGFsnlE\n4Gz3uxd8xuEqdQp/AQZj1xZ+q9Z4S5AybqlPVGX98KjfUgVCHf4lMhyASkQJ\n+vxm\r\n=19bn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiaion.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as paramter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the User domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"5ef729d98d529cdb8ee6b349cdb9e50248c67892","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-feature-5ef729-k85q4x8h_1585043789049_0.3075281452746248","host":"s3://npm-registry-packages"}},"0.5.1-feature-a60f5f-k85q70xa":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-feature-a60f5f-k85q70xa","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-feature-a60f5f-k85q70xa","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"b71e2a4fc67ccd2d2007c864e4b27c2b96e085da","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-feature-a60f5f-k85q70xa.tgz","fileCount":79,"integrity":"sha512-/XKJeaTPBRqBlLMiLPw2rYXeChSExK2pC9fklRftIVwHG1s54amIYk6BRDsT1ppoMbisdTa10IMoN/wIPafF0w==","signatures":[{"sig":"MEUCIQC8SX+lYCf4CPjQNldqs+Vih6YpIO64CkYFTVFzxZCAfQIgc7hIWPUN8cNF7EGXDCYYexZIEmsje4pnC10az4pHF5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":195964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeedmvCRA9TVsSAnZWagAAwwYQAIDdlWqrdPBQZimxtnK7\nr3DnQ/KuukY5cPwTlbdJQf1DvEI5uQgitJF/pn66Gf19hpQPBX2D/jDLbJbr\nPaEASSgiRFxcdYjRN9kHIRDMMkyDvnENDJBZk0iGn4U9hD7ZJr03psmghGOl\nD0mGmbc59jdOTyaQ8Dcl9W0TWONFF+UbpLeXbPyWqoIFSSTwlrHfL/IlqZGW\nyvwS+klBNeb+/k91ivzX8C02tvEWkOSPFnn0nbSVKdQq8pIWWb+1dgdXb0MV\n2ZRwA87M+G/yQFeF+LPJwSxLc4LlIlajKtAyH1UHjpeDZQxmN24NIJE2Jk0w\nzgIv39NPghuTG+MHktOsYUiPmopi5ZelW+o+DoziywhBYYwnR3jObl3u1qFp\nEJBeiqbs7qd3hZ0VJsB0mpNqFGwhShatIx/f5gPdkHw13fdVr5ZmdXdxfQCx\nuc0J8kJTtP2SAFe2Za0BVlRu2HO/bs/YxbKBYbX7PlnPqZnZolClMbHMRJR3\ndCmtXFsNTyAxwI8G6u3rDnA/u7JpZb4rhhtsfE/rAS4yKDOtIqozJb4HegOb\noRqxrmy6NUFQnXlHNc2ITE119F6o9fc9dn6E7ZK4mwB/TolDXZtLSPaEtdBl\nUE6a5c0hlmW9nJluBbIvFl6aK3ZLdyGTHkwBm6qF9oSIfQmGvPC92xq98UEC\nM3DC\r\n=IGu7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({});\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as paramter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a60f5f8faf600f17c67edb8d1b0e6ee9e53a1129","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-feature-a60f5f-k85q70xa_1585043886779_0.4564088244417799","host":"s3://npm-registry-packages"}},"0.5.1-feature-93f927-k85q9jyj":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-feature-93f927-k85q9jyj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-feature-93f927-k85q9jyj","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"1e73e86088f4685e0e21d593f33493a63edd6d3a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-feature-93f927-k85q9jyj.tgz","fileCount":79,"integrity":"sha512-VO6qFkhxTqV472mjnNJ81SAb1DUte6vU7HWf4nZ238FZA1ZKatp40Wp9h/Sbk3jXZj5SnElbBjQq4Z7WFjejrg==","signatures":[{"sig":"MEQCID+VzMTIDvYuWLNOgp39hB6cYoql9hvdUjuuZJj+l6TSAiAMIdxh6AxPI60UDdKnJmlU9VaVO8wi85XlsEoYbaYbVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":195962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeedoiCRA9TVsSAnZWagAAfVIP/inuEFYS3+Z6DCBMLHNR\nlZ5vfDAkl/Elt6LEoroc+ecOkhR0bhT/lUax2WsE5acgheAcoc3j9yJbhEeF\nplRf3hAqU8WX3/AgMVc7vinSkpbUd5qlBEzuMFir+QpzU7mBOAhJ3TSl9KZ0\nLd//lwCfDjL/D/gj2b0izkkoiX8A1Ricem0oKBEa8YvztrdbMYxGnAFS4PeX\nR6Z335mFF0jMMXvbltPkrhavLDYgpcUPv217jPFskSIZrnPANZTTupam0OIu\nQ+leV2DoUi6J/xaYsTYCWZjG+o4I2yVwt4IYy0HsVci2E2JHG39bhwU0EocQ\nLdQf/0Woi+g8BaxzodEFDftSeUpEMG+aTOCHmmR4COG9379mBsXRQJmC04os\nk5xsdTEpSCLMRoodkNcuuk8J+i1cqpKOcFEJc5gw4MLRMFCgAlGsBIAFfJs2\nkgB0j3F7/uvffzyZPI5xj+BXZcJ5PPo2M81JU36rn3C0SQ2y3TGu/P2LIA1M\nGpA9oFWt75C7Ht79gHLwzCStGyWR6qz9Cx8cHHS+OahDc7WyICu95rz6HrHS\ncaUvEraPO/HZl/ujvBPau5O2Lp5kK37N2civSMcSosr/hzYQkJLeSWM+lSwo\nJ7mCDh5JYxdTGZFQnMh0zSMC7Y5Ix27lW7SUDKMniMnBcMMWQDsTjg3v3IO+\nrwZ2\r\n=7AfN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as paramter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"93f9270e9646148752e02930b6dc21c0fbf8d8b4","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-feature-93f927-k85q9jyj_1585044002473_0.13299823762787955","host":"s3://npm-registry-packages"}},"0.5.1-feature-1df8e3-k865ilq2":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-feature-1df8e3-k865ilq2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-feature-1df8e3-k865ilq2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"fd5cf63833ddd8d07b80d5f97112639cb4992b1c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-feature-1df8e3-k865ilq2.tgz","fileCount":79,"integrity":"sha512-73NxO7N7dSmvNh/vA8e/doKSUHoMvTrI8T3eAIIr884V4xrPegPr2B7R4Okf+zIJTZfsHH1RCe/1T8R1cbP6nA==","signatures":[{"sig":"MEQCID0MvbPqHJn2A6s28ic/ARauNSucm69dCzs3LfvWUUN+AiAOuhq/L3CMW0DIqUfI+sM52qO0BepNtWSigkGr06U3sw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeej42CRA9TVsSAnZWagAAm8MQAKGmzz3w7lhWNjNS0/Kr\nMLuHxEi/ZFruezNJESUHuFyuAVvSSy3oYlxQ/nf6DFW9Am2B1VHkz+aKUAMF\nvMqlnirMfISo2pwWDEVW/S5t4JTFmxH5rj+3L7U/XgGyd+LXmQxafYwEnb6Z\n7+9f6lCLzO91hoaes/XzvHz0YehCpekvzIp9mJdas4MYGBne4D8+CoK8Xgsl\nH0jLusHlPuawjno8BDf3eIjKDQUg2ITiNdrKxANb8B+N13je5WaLnsEeyBFe\nen93F6DyL/xhHFM2XXFjmfDdEyFARNOkTYhST07Zuz+puWhe6OQ4z8wghqKY\nsafQiHBNSJ5vPeS0hxDXwi0HOt2HJm7kB82ew0JTOVEuh8clHN8Zt2nt6DGa\nMGaTlPvkls46RNRyP/rn8TBhGHXoYApvxM2Xp1bQHblxWQrNrMvfh16sLEHD\nBuP+XgAA+v/i5v11UHXJ8rkiq7M+K2g8Cb9DMFq3i7SMFczEaQ84AzTyCiEC\nMfLQXJNGBhwJ9bvymO5HM9c7RGkv3wKP9s7DAJ1VteMuPAJGymHfg69dtWOu\nipEtb/wtF4jaFcdA5eo5m1afoOYWN3R1T8NjTiG547OlhDbiLmDL5d3vYjyK\nemKUAmk8yS9P/4jdPq3+GpRerD5+5xixyilrX/3NlZO0HypL0461mwBf6ofK\n8r3O\r\n=th/c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as paramter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"1df8e34653ea173ef651d9be0522f87fdd93a050","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-feature-1df8e3-k865ilq2_1585069621771_0.302852377785634","host":"s3://npm-registry-packages"}},"0.5.1-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"a642616c71000991d04b07a239c6fb9dcf1893aa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.6.tgz","fileCount":79,"integrity":"sha512-aOqEuW6wNsp57BiveqcS26Lzz9FY1GOnjad8gYhWPzCHpjfNCiqgvwWrWRM09HBL8B7HpT0CjvpOoi+rcVWtFg==","signatures":[{"sig":"MEYCIQC0atKD8rTbBRP/quFgJ+tksyF3dUjdzm0OiGILwxYMqQIhAP7S3T4j7UuyFuoC6lQ3vHcaWcfWlMmbI6RYapLh3Gm1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeej/TCRA9TVsSAnZWagAAdTUP/3fiY7u2Hcfk2cVtYMyx\n0IhLoRWgpDRcMCHvC5J4CvGs8xDydNYFIw4EarGRDRjJZnNuBTBJcD3LxUsg\nyKbeWVR8L70KcJzI3dpr/IkTMxnozJJryCfN7Z1DI2CAT9YiB+5PFKjkn8A6\nsiGX5st59xyWeqFCuPSeQPe/G4e6nlbeKh05a7hyHpVnj67YfefUywgtG0s8\nPS0hmtatM9fVFOb6hU2J8AITL2MPTbuQeghr0RYvRrOExGeP8kcRkbhjjR4k\nFSwUskyynBhMLQrN1zwAwz7tlTz+FI6HoUtzm4hjsg1N/hEfkdJdGHx2Nigc\ntPj9eF+AO5zJprixTta4hGofAJadiuyaAyzPgqGANUg5MD4JOIuahHdeIKn6\nD4rJvJy0mYqahQ702N5izV8P1ufbskE7U9fd70Pr2T81WPOwdGutUJwiKBxY\nnCNQ6XT6bCQ+Ppca7ug5csJLUu5Zr77XXPmcBqkW6lrphoPtdeWnlFWHU/RR\nwHb4x8nF2/v0hBd1WpubZLWd43dlgHm9DXIkwak4wCgheCJi0ue0RjbAiVSp\nQem4aDPkv54c3Yt2jOu03EynHkIHCOZDtrVczNhphSLFFryk53NtRAeI1Nf1\nwNH/n6ID2+cerPmxveCtSLO3zG25/rsmQ+e1v6nPf74Se2b59ieNkgfLJnGd\nM6Mn\r\n=22ly\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as paramter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a0ba257c61938039da644618fbf2d3f92b3b9615","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.6_1585070034946_0.2274068086240777","host":"s3://npm-registry-packages"}},"0.5.1-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"0.5.1-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@0.5.1-alpha.7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"c428633c8d26d9fa41fa31b0f7b2956841eae014","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-0.5.1-alpha.7.tgz","fileCount":79,"integrity":"sha512-XaXpQJzWW4pLlafFxQCvRQBmLsNjRRurqncwVqS3TAxbgQFXAV61Uo8qkFLXusPKU1ZerC2uhtP9ezXuBXSjxQ==","signatures":[{"sig":"MEYCIQCS1oHl04BElmlhfWZdI9WZSjuvrVXLNdpmCKILcSfnfQIhALLL7CgHBHzoWDoK5kEB/0wbeAPW9xSoIeOCeTwiYQS7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeekKxCRA9TVsSAnZWagAAjiwP/iLg96o7gUmBPUCckTBW\nYGz/jacoYx1H2SMBF9q8MlvVTVWhZTf9a8R1ampRP5nXu3tUo7/3UWMQCtpu\n8NPFxxQsABmx7RMAISXZHDPPvW1oJs/uyZYi5rx1UTgC/A/SlJoPhXWOm4lr\nA+abOftlySgnqVDysjS1zDChl7QRX8iI1g5g3caCG6uz7fJTJIH5E//1KzMC\nku5tnhwdOHkUfpV/iZh6iC2s8YItTKlOXrLHWfDuVo97CjiVoPkVC3IcK5W+\nN8Ux9KFJmUb5H2t1LNknsJzqjcG2Zk844LaMY4tMD6n6EfxVYtmue+6HTkDS\ncKd1nXTK/BLYFDDu1xBxSmPTImPOxUqHy5ZNSzNmZmFcxLoKulahLkhxXUha\npB++mN7N5yRamHPMcowzh74jg5O8SzIV1IwzgHhf/sOjveTsQSTNAsLqJmTf\ne20RwG0nqO3DS/Kiv5+n2tzExYbx8sF02gRJAnkbz7REFi7yYatyh/0vguDW\nKqPCf6QNkgFzh01VV8gnmj9/JPe57H4cVW+mq/yX8iuMgyW2Mn7dyQLIPYRk\nbxnPIWa3WHtgfnIohBQGw4XKzcbftpQv2DKcIb2OOkGZmhgoFkFxtfXlS8a4\nWLdqgjPabuFNNv1bejPBlf7gtAc1v4euIfzMgWdAmjyq2p0ucap0MxdyAtr8\nyyXb\r\n=dS+F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a7f09406e7f1c0ef41a4dce3702445d05f071666","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_0.5.1-alpha.7_1585070769240_0.3144171939240952","host":"s3://npm-registry-packages"}},"1.0.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"37d3f9ac7aad2d8d2fc9f4da7e11cd3793104c0e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.1.tgz","fileCount":79,"integrity":"sha512-JWKDkq/7BavQGWx7GXTf69N89pplgc1/7mdYxn2XOs540eLxDkljvBluv6DperUcxPt/ss7cVkJN1WmmjXSOfQ==","signatures":[{"sig":"MEUCIEW9CZM3se9DybywnmiS93jlit8JKJ01jhHb2uWtF/utAiEAnOMc1srVgtWUTPikdV+eUO/UPlE2RjgCS8wJoPPH0OY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefHqRCRA9TVsSAnZWagAARkEP/37BYklxLj61sY7m8uPH\nE/jByuvmkTFybXkxnmhz6pncfT0W5iOgiAyJiiRSi6WwYGWpezLzZi7AAGVr\ntBcVS63piJVRX7f1+dFMoswMkfOCXVETG0Dt9wIw0ZiolAnKPtkZ9BkHI9qc\ns7otpaBk4R4RiUrx/n3gUyGqalQuL4rp9YzBWQOcjeGCmwTVeslGEdExAhb2\nBjkoatmrTXMR8ngFlajBRaK4/H9Pkcu5vv23uBsxtrRS2gBXIEtQSOREfAd+\nLbT25jYM+LHI8Gycuyd3z/Gk3NvOdKOuvEgxzoiziwwo6fWqwEY7KOhN6ehj\nd6MJxpShBi3LM8t2AMXQ5TnNDUVMBgeQk2qMlqULS0y6SKfswhCQ8zpYWh5E\nQztvGfBwRi2Ulo10sq0pv5xs4uwRGcuYD2OtyoP5jja2Q3NYanh/KeW+AvsL\ndx5Ndj2pQMAwREe2XQJkoWaIkAoZOiRPCOYAbssE9ytANB9JVNxYzRZaVdEX\nuW0Py7hwGHazzxZ+ke/t1/dL0zAr29RSeqwCafWSCoSX5nw2jecrIXtZ7Fjb\nLhZrJfMQCwN45kfDLVc/3EvmUfVhEzhJ+ztNm2hJff1mnAq5Vc/tSYjIggU7\nKxr7xN2ixBctPzn+UtoOg7NSyyMsWdkDFngxcaRv40Si0NsGoXA4D3Cbj1yG\nZNYg\r\n=ght7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"6f8b90fa4160bf8bef159f56d6865e1039db55c2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.1_1585216145112_0.2036195432941854","host":"s3://npm-registry-packages"}},"1.0.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"8da8055e6fe571f4c429276ee326188ca553c839","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.2.tgz","fileCount":79,"integrity":"sha512-WlWUcKUYMXxCKc/zAp6wsdNurLT7MPeFOvmbbfR3rIHn1a14hA+wi5pnSCOVrP4egF8FpdwPnF2RiEwx4REsmA==","signatures":[{"sig":"MEYCIQDAyynVh7Ma+DiJCRWuCD3vrCXWI/w/eNKY1kIjkviSqQIhAIEagD1DbiFHkM2gtkNFcJdCSLJpmttLXxBAVDXI3kMf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefj5PCRA9TVsSAnZWagAAm+wQAIzAO5YumUwB/ZwhTB8t\nHP0BdQdI67QQ18JiTNAgyQ1KgMpZqJyD6lzfGCQBsuRNwhEd/JXZWyYVE7Jw\nTHvo9+HIB4zoW58i4xYlHS8M/bgCFCP3PbCmfwdDoJlasZgH0ylcGTv1F3A4\njTXwsh+FoSeChrfdFsQssi1WN9GAwhcdBHFcaO2VlHMTOC0ATJA41qTu+1Al\nRIoZ4Hj6S6AJjo6+Ahj2VMQ8myQK4wh21/QvaZQUOSem94xvLQ21dIZMvS36\naKxWVjM747hh1zOxMTnPEO526MnN8l+QyfodD761ZAwWeQpHvz82nXwS4z+l\niNc8PN9uOt5IB+zhzhVXNFLHZIyK6cNxX/ZRZqwix1lQaQmWTJDrCNAD1+eN\nclCl7dcRVs0lbwM3fvV2Auery+XJtq1iX/edGOh1BEF+2wydpVI5KP+WnR4C\nXa2hM8MzoMISX/kqOK35TuG5OdgyxLbgiwQdqvVCQOhQJhAwOb3++lzkGQmE\ndRu/bveTfM1yh7l7d1NFOPAPNsBEmRzA+kpQ/v2ly1M6loagrzaCRvq3KUG8\n706fAbBuiE9FJmsIfIsUmtQ14lg4hTiVelj8A1C4HOV07bI1W1BMxPs/aPFg\nmUWy0+Nrvo64Df4RxsbxZXyt0eo9wjAsFaO2AXRpUx5AUIih3g5FVWhep+l1\nKXaU\r\n=RN4N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"b2ea0d45b308338fa46d138aab5b05e2f73b1416","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.2_1585331790686_0.4480382801995133","host":"s3://npm-registry-packages"}},"1.0.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"bb88cc4316d38e69a6e7a9a579800736239ddc01","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.1.tgz","fileCount":79,"integrity":"sha512-byCyXrqkvhMMhMvcwUbCwNPTb+yJHJgc6ZwP3do0HB+nDkV4qIvFe6m0JdgO2EyyyWa2wPsCPBBvAWYOLx0cHA==","signatures":[{"sig":"MEUCIQDE0jQlo5SzfrAX2OdfAWIDwsi7+2o4ONVX3r6d23uixwIgbaZ7gwVIs8auF0LyH5q8Rjkt5xgug00wXHwbt1SHQEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegfaaCRA9TVsSAnZWagAAqgAQAJXl92s9hzltv0q+7jrx\nud1orz499STD+BLwgaFUqDsCBCbbUiTrlfGT7qP0UXs5pSmfK4Oup9Xs1inH\n9UXHLO1JO402RklczaMlgsDzkpqV39I4Ee2s7RTXjckUse0SzgAzIitkORn3\nX+RD+UpRPNeo17IwJn4y+4Z6Vzv6+V6VtDeYyLiudNuUPYyoi898lEuq4aeE\nWsy07QgdbaVnWR9hdgZUlMEey5zBb/o9o2qA1tn4cGKRIFq70BKqOsitvIsx\n4KxWfhmhPs8aJtQK67Y+BsJlrtKc8KrAQtgThd5PiQBTLLP07F3h11k9/wjE\n3RQE1aSIonUqGYLAZXgfijgoFjouINTcAem6KQMdH76rt6+kt6FJJVYLWlro\nYUlmfHIkbUWD2w8PDys2MB9bPZbf6HoM+rf06Rjj75dPY5cI/zNFqZ++QEb4\nJpgauEK7Nm21Fb1/QIBlVLw3AhNWAeq5V4VZbUSN7d+Cc04/foNZ415eErOF\n5U/1OjcXQKLJIoqcOhY/soY3OHz4LHCiZrNayhspXhk08KA7ZinCIN3duFgB\n7V933wHc35XCnzCAIWYh+Ztztm/BX4IDCCs/yO9UwCkzMNrfKxECIS/qY50X\nv7X3Hav9VVgqvepIbtjmgX6McRBZafHyNwMcvZWdK2xL+GDA387QxaokOZrc\nyMH4\r\n=jwRJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"729ac08f01e34fb067544e3476b655f6970deafe","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.1_1585575578234_0.8032318501314499","host":"s3://npm-registry-packages"}},"1.0.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"d86de7633cc9ea32e01f4494a0b17ec0a68c81ae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.3.tgz","fileCount":79,"integrity":"sha512-6RpA+CVlXNDIxM1jBEcecVW5ik5dsbJB6p1ixkKJYOAv+ODBygIRrgfebKjzeX2T1BFnQPd1k46UXDd8ZGJmAQ==","signatures":[{"sig":"MEYCIQDf+4cfGMynnp0HOk7Hw+HNbFW1eMxlkbXhlDDv20na3QIhANiJau4/UrukmNiAOSrA6XWDa/9kJ+4zd26VbxHgUmVa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehfl6CRA9TVsSAnZWagAAO04P/2nWud+lDJk0MqAB4sDm\n1LqwkARi72sS44mO44STlU7P7eF2pkiXmj9fdIWNTnVMWjkNPqKADtSOCbMw\nPeb1orUm3XsqqlrWPaBolod3YzViTdikuvcz8lO0epjxdyaCvwSarcWl1BA1\nqMs/fNKEfC0hPtyAfxF2CH3SuMCLi6F9hogtDFQL9LUK2iCIbVw6NvtJwy/f\n02Lq4CiQG/FNLcmcXtf4Cvi0XPpGmaXSzAWEje9/bJ8fZ1qUDIPGNhbVY+wy\nh9L0WArAdkCvjRHTt5eqDhFQwS6Wx1dUy3LGOPdsB/q4WQdFWlsWYvySPRCc\nL4gSmeksUHArZXT94FId/RIqit5krxMcx6Gd5z1Mf9hKnNrSlSmbdveAQGPr\nmsE0ciyDyoZIWPFdqUDjc1m7WME+jotyA2czqYdbTgmUj8XmXLR3DDtUIFBd\n1FZtidvXlXAXlAaNrY994X+bJcuNrgwGAwxOiP0fJuqdzNmqHwAZh20D6rOK\nLsRRcrIJSOu45g7Y3SI8zCh1Gx8EZFff8Q5j8Ar6Wimpb1nwOtMug21FqEcK\nkQGKmrnUx7qxPUCuSA8biU/7AIi+ShOZQt+15fKQea+jSCAElSHSVnOL568t\n3+qyZ8xyw3JOEX/U+R8QGwTHY51+MVtkaPIRiiVxs2x47qhBDThI63wOkAdz\nQDVk\r\n=pLqQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"d526a64a413b84dee342e39bcd86b01337474ad9","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.3_1585838457784_0.08560089580781871","host":"s3://npm-registry-packages"}},"1.0.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"af69142d079fd49931f2565621db63903ccb9d04","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.2.tgz","fileCount":79,"integrity":"sha512-r1wbHlpIdD9H12dN8mE2qIdUu1MWJX4HUssVC23/nCmphiEAFxmNvuMe3UgZtYEq3u9gZm9Ev0C32sQje24Xdw==","signatures":[{"sig":"MEQCIH79a4fLyWuqUfdJtTIlHUaxVOd++2xM/2NRZsJrGZnsAiBi4UYedELCiFFUnflEQvK0mDkV1LNGsw2V7rrzUAC5vQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejeikCRA9TVsSAnZWagAAdMMP/i5h2lnYVypSLAc9D45S\nc+ynOsDBBIiR1jufdi0mueIku+tcuPbAuTRu0kAaNVDiI5JrMj+CXLPHK6Yk\nvAmffhl8RZiyV3MWDY75h0WhmvMN2Z24e3sJqBp3gDhUP00oFtCj0dkgnTA8\nhAi4Js2VkCp/bU+Kmdlt02A5JFK+IlTtcDCMVgQkFezm2P/ap4RO0uOPAD+T\nX/CylhdaR2NbSnHdBinZ9c/x6nYhhdYrOIhekUEw5HsjrDQR8/qvO+0snVWh\nGjPv9U/3cH6N7NCm+RUitQN9+Clk1AhZNclYrnjZQSQ4TCQDci0g3fStdysk\nuKnspAcFbwPK82JCQAhn1IZu/hiRXAPMT+7UxnhPYopDqJwgKp+ajHrnsogj\nSrDm//ZGP5Swo6iJxSwxVQyWCF/CfrqAcOeKU/lTHKwfZ4g9QHvdUgiQnIOK\nCdjN1GvArlHNY6EPFUeUx1FBJKz07Le8seyIN8sCAvnIW9sXxDpNhZ29JPcz\nPjMaFR26U+tpXo1HqJZxM/Groc0cbcj0xfPEHuTWn/p4wPwCwSTvSTZKIF12\nd0fQ6Nml3P58nN3zP8DFeeQGzridJyBGeaRG3/roJG2kkOOpFl4eP/6p1t7b\nh2v1KDt/je3M98Qau/geAG/KyinEm+L+eSKNL/nom/5B6g5KI73ub6zcNayn\nxEaV\r\n=dghq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"190e242851c3e1417aff23bdcdfcd32cd44f7d41","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.13.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.2_1586358436264_0.09088821730233598","host":"s3://npm-registry-packages"}},"1.0.0-feature-bbf574-k91cmxzs":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-bbf574-k91cmxzs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-bbf574-k91cmxzs","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"c8c95b93a6a7995e5392fb89cf8d2a3ca548d25c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-bbf574-k91cmxzs.tgz","fileCount":79,"integrity":"sha512-IlsP9g9DKNzzQGM4yKSTYYbi0tB206uzRPc2TSRtqgoEQBnk3UEhxcXh3xNNASaLAc8k/wzSsd8YxjJc11MgQQ==","signatures":[{"sig":"MEUCIQCJS0xdv8qFIaQGOciLBPQQI9R0V2oongHYpF03m0pGFgIgFoxuPt/wqZXG59vPXDUu8+PofHlvOgWNup9vRTek4Tk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelwb/CRA9TVsSAnZWagAA4aIP/0jkHuXX3lZZgjRb4wN6\ndfVy67J3hw2FNkxsPEhaT18onC4q892J7lit9OqJTxBfnSeSOrjMqhwKBymf\ny4LAvDWBTZBKTIgYRRr232LvInhivo/rAG6rO4OAaDZ9YGQ+OS+sLRGtm6zX\ndg9Y7F8hwAa5PPXDWlWWMvAXQBm00TwkjlZ4mJpb0bkiXldqTq7+hW7V3hEd\nFhM6i9dIGOebtf/MB7+LurX3MQP09gR/cI3TyXYBDC+ptdlDWgsDiNvgkfDj\nAIpRwIEXIoGpK0NsA7XZNPbM9mQJgmvuIxUU/DgebvIlBlcqhlePZlDa8hPF\nB3vQB/0C5rh/ZY07aUaJJd+cVTMCrXoVc5tW94p7Aaf3eUcdaUNrno9UFzFo\nFKR6qcIPg47lQO0p5fqexVKAQ7LfPXcAJFZ5onyaVq9jWRXUNzsMsSWmMssz\nK9GO2cV+UtlG49UwrokGzsxiePoysrnoF3tASFDA+0MpCb7BjNeDgOlTG7Gz\nwgYDD/+LD2k0GEFnoavo9Igj2iwJhhDF3A90FbOscIXNqlpC8hlhYi4ePW7E\nTUCdMGRAFrFwAEtbXJ0EHix9AJUiJzRNksxhbMgFzYt5Chqy3vrWyXa+Y2yQ\nbM7UyJxPbnWRM4b2IcRHfIc4D3dtGsUckxa8Og0oJaiO4ok/D8N3DOBs7jPn\nCO5g\r\n=xZZ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"bbf574d72bc940e41f1cc35321142ee751adc53d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"feature~add_process-instance_termination"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-bbf574-k91cmxzs_1586956031423_0.8143473023883636","host":"s3://npm-registry-packages"}},"1.0.0-feature-5b7fdb-k92bx2v3":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-5b7fdb-k92bx2v3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-5b7fdb-k92bx2v3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"cfe9f03b3e7e8ff5daee20165f16999d7c0a74b7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-5b7fdb-k92bx2v3.tgz","fileCount":79,"integrity":"sha512-0hdTOZnYRIZfleocHCYhYb8XH1uAHUz/oXNMZSpZJ7GbsIFVIRRdf+RDqvorxU9+O2ZQLIt6PzYUXM/+D8rNZw==","signatures":[{"sig":"MEUCIEze5LEJZcgZkmUIePkXjk8slYEF7VTuTzeOzAtm1qsWAiEAhx8YiLRlxUK+A0zrqKK2DbDYplebx/oInMLqr/gA8uY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel+57CRA9TVsSAnZWagAAZLsQAJ6mFFL6govzLPtutkUY\nfwPYIpPCoYIFKiY2FSRgEYdw9U+uA8PzSWUsYe9YJkPcLpYsBUL8tkaSD42B\n7DtabmLO7Etv4twmquK84dOv46Aroimk7CkArw2BacNDANJSlw/TL7CX2k0g\nuJ48qPJvOMfNkzG2O1585AWpCPiIv/XA4AK7xoROUTEvK+CeEw45y5U9b1sw\nWpxWebztQXar3OuLGTbXSbqqz1vOMvO5Hp9hUbXUgYU8Iio6JQbob2M3arfZ\nt0zEQctUKNRTCm+qwKhoAYHli4Sht7ZHPYw2qk8vJtM/CoCnkz+sHMCUyfzg\nIoKSiQgF4T0jxGag9GoFKgu8kDCkKYMnMCUa32cuMCgZ2qlMd41i9dqHDTre\n//+qS9wEwCq8BDqE6Dh/igPlBbLDhh3kjZrA8f9wxhcz/LqDiTU4CXNWmt0J\nxRPY6PUBXPI4UnX3OAkJjjuqj0z6yIVZL4RlOX/OXuWhHHT+DlbNuZ99wac7\ndQ5BphJ67jMy/eUHdpNtK8MvyVdXBBtIKIVwBzJW765cmmg4IXJyzt9faTxH\nw4D9YLqF3hQ3t9Xq/kcMoZyEmq7ZyOPY9bnKhV2A0AV3ZDx//2l4HAjoYS7E\n42dBFP9MI3+mJ/UrDV3xBJNk1a66BrNhCpfKX8JQ/isR8XpDJ/qvgtvC87H0\nGiQ0\r\n=BW0Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"5b7fdb4d0b719fae286f6f3643c96c955dda60c2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-5b7fdb-k92bx2v3_1587015291201_0.865712116837084","host":"s3://npm-registry-packages"}},"1.0.0-feature-5b7fdb-k92bzgab":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-5b7fdb-k92bzgab","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-5b7fdb-k92bzgab","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"9647b022c595f08b79372db3dd5157a9524e5a19","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-5b7fdb-k92bzgab.tgz","fileCount":79,"integrity":"sha512-m2Jrr+m77MznqmNDbBs3mToqdCL7VpPDxLhx675TDr8UVVwpzeb3y2QWCwIN/Ydcf7v/rznwM9Rc9CY0pC7K3A==","signatures":[{"sig":"MEUCIQCl8sKZq1o9aizGBSRQhtnEU7qVStDMfaz45uD8WOWuQgIgZxI/2YhvyzvRf8UhbemvOg9QdBqDu137lay+v2dnKJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel+7qCRA9TVsSAnZWagAAtVoP/0bDcJkztGtcmrkhkyu/\nv171mfA9fA0Z/gBkFD6eSIJKmim/hvF4q9ETQ+nI5CLOc56oCyXpZe0nmOtp\nITOWBII5ok28ZqViZHtYE2D7uegbo1ZehDmWbszLSxkDVDCuwRKCujuWdvFr\n6Yq+d8A8DETimeTW1RlIq2cg/ukDusOrHDI2V4RSK9lyqQRaKiYVKTJoGvsb\nQv2K+Fek+1EZshi1QKS0o4SdDNKsimUKTplLZSLCR2jtTLtRacHHX+B1MEI7\nPs/+6Qt4dfWR0eYN0cIOUBpnqLfqFWwr1LLSgc9H507XCLi9OQt0B14epCYL\nbSfQBDPFGBwM9ycK9J9piT/5+cVM3p9FFTqnkaEPZ+W9geXTgEys+WBseGAZ\nDUnaLGaM0SHhcw+R+tkj2u/L5mQNpiZqO95VEb57la6GcmiVw+YadfPelXGQ\n+2BcG4q9H0zKR0VGLDQiQhkSc778O5v8aYh/p2TWJW9Q5gClR5WVFLiKUZWC\ntY6lu3p9mXGvZmysgXlm4o22MDQb01z8TmyEUBqux8zhHOnhwyGrtUK18tpk\n+6JoFcXzKmDjwDXlEfLfCbrW//Xqkp9DO2AMvikBRqD3Ct/6OZmT6OGjcM0l\n8GQTURXcBSriPB3tW6iZdMmA/233fOuCujLK52rv2QPsGCDHMDSJqnZ/KqEd\nXASX\r\n=JTOC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"5b7fdb4d0b719fae286f6f3643c96c955dda60c2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-5b7fdb-k92bzgab_1587015402246_0.8707721244596467","host":"s3://npm-registry-packages"}},"1.0.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.4","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"be3ca7f45a350e3c916c25994fe967f19bc090ba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.4.tgz","fileCount":79,"integrity":"sha512-G5Do8lCfRCncgULgFZHBZmmh5PM18IAKlyvglm7bN0uqVyiJVRBroDpUt8v+s21kVJmlq/Hdeb8XfCuX2KYN7A==","signatures":[{"sig":"MEUCID0d6qHMk8+kbexyUB2+BFAZm35RImeovUXHM+KD99LcAiEAg42b2qaAD5SFqxeFfz56dnNdbu8Qlx/xjnVf+9yZ7Lw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel+/6CRA9TVsSAnZWagAARNsQAJ5Y0QTJe4mC/aB/3Wcp\nI4NDusYivh6FVm4Zwnk6+mEyeVF220V3Pq3iVpPEoX3HMTUDWb9XUgNnKfLp\nZiavUZXqHW8rl+unxETZz5yr6DV7dDuZtnwL3JCtqW/74TwIclW3EFqmHq71\nAO7KHo068Lljvq0WC/KngTB7BPKAyZkXwmNQabeiit+Cku0dsWN7Xjr9d2iw\nKAtw/CzcNF1e2EnREW1i96TjVT94khigAYZ3PjQsoPE1Fw7LyAt1iymm2nNw\nLdZc5Q812Bo/Hl+xIXgqp03XC9brIVVA4UzHWAUU7aHzxuf4FwTWfiNddSef\nzx800CRFB92rder/grbk9rzwbSKK/rozmax4pZgDQiMYp9bERVwi4przlSg6\nDQn3LVLeEp2nZxcXMvgwuLq0FKJ1WdbJ5Jdxw9JKGRkEd9Y1dIYP9gHcWxMR\nxzdidyRNonyzWE4/IMJqwxMdYibkf7isXZkr2idrCziLaTIUgEiYBZY89XQm\nLwmKuR5LKVciwMo4hZCYXn9RVcDb2hNiPd/LTMKESDDuukCMGy6l9ckEd2SV\n/8M5gOxEznX0yvV0sxUg6Ni7yutvDOkMcg/7A/5LwKykpL7hjzWB4CakgoHw\nvHk3m/UMM3W5G3fGD2JSkG+e0rMXkQD3/8HjwrQtAjthB0e3f0swHcrRYsJL\nhRdp\r\n=oci6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"bb16cfbaad6b6a7e8f89b6204d97f57e9639deb2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.4_1587015674221_0.6250097613499965","host":"s3://npm-registry-packages"}},"1.0.0-feature-159aa3-k943s99k":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-159aa3-k943s99k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-159aa3-k943s99k","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"775f7f5e2512b88a5cf4d70e65ecb6a736a07ab2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-159aa3-k943s99k.tgz","fileCount":79,"integrity":"sha512-OmA9UCRPHIcPjhgityftAaFTx0vVSA5WDf7AF1wkhN14r/aoaYZGC/NhAZMD/GfPwFCy5xAZ6UuDZfHi7xHILw==","signatures":[{"sig":"MEUCIQDJpMr1aBIsJLJfz393mBAbbwmL6fJkX5kJPBAV4A9BXAIgCBqQSjfqHJfg/G/JXKZXiz0C9U70TiI1JxUgd4FmayQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemZGBCRA9TVsSAnZWagAAbBwP/A52ieBQJf4XIqmBG2M4\n5T3sORgfL1IgLscR7nKTpeqd35PAoQwGQVyrbxKW5TwGWG1D1mvEa9KQknHj\n3akTwOihZB19dv6vsKUfjoIgHmiWWY1H8wTALbysusI2TbNNBNvlbHyzbhEv\naQriZB+vZm1P+8IkAh3sHrNbQkZNYbdp+E5+Yd1GybZzCMgyoPiP+iE5C2/b\ndKltog91nOx/CgJhbxVYJDFRexmv5ohs6mc/hexqoeMwRsAVenxzDqSyt1vY\nLcQ6C6ZEdCdUthiyb1K/2UE/jY0i1mUvIrVhB3vlZlAoLDFtOdcSCGNFIV+C\nvZA1PrNNqOfu5P64NNThset4BKXToQ5lFHXS9cAGzybk41VqaYLEPYHI4OpK\nDJ96/xt/fNDTqUBmIdCeHndKfIOxGjXLl0TtcJVYi7ZAOsCRPcBoYQIoZQTk\nsMFB8de/iSJtGUQVoomocaVn1+yvWTHnkiUHWI9VSiQF/UD5r5I+bKZ5zozp\nYuZF3LogqXqKqFQAHo6NVWHdj18v1BepPzhen+5xwBFra5BG3bOAnMDZYROA\n1peR/FF968IR27Fv/qLHMn8y/CDH3KUtrrP3TmP2tXDwUGbbjb52pXHwg8T1\nNel0Iv63oZVXBW6PwOTYBx8q5p5uI48+XnoZJEIV59oP0erceYPY3kXwxj6R\n3xev\r\n=7wzj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"159aa38d538aaafdcb0798dff1203aefd8f239b1","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.3","socket.io-client":"2.2.0","@atlas-engine/http_client":"1.0.0","@atlas-engine/error_provider":"1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"3.0.0","@atlas-engine/eslint-config":"1.0.0","@atlas-engine/iam.contracts":"1.0.0","@atlas-engine/http_contracts":"1.0.7","@atlas-engine/event_aggregator_contracts":"1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-159aa3-k943s99k_1587122561110_0.22622723678440648","host":"s3://npm-registry-packages"}},"1.0.0-feature-7d9f87-k9459azd":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-7d9f87-k9459azd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-7d9f87-k9459azd","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"98102307dae00ae8d60962fac5b7f656af40f40c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-7d9f87-k9459azd.tgz","fileCount":79,"integrity":"sha512-eN293KsIJawfGnaeNVILJRWbC+XrugbFUIx34FYtwLPmf5LRpgsx8+5AiqXd39ssLgII4nXDqp/u5s9iKGPaiA==","signatures":[{"sig":"MEUCIHa1hXk5S+3SnNpgBsnkwSULnNEH/BlmpAcGRjHTcZIaAiEAoDhkj5uHTzD72Ctn8/SoIbcyDmxrWcfvStZ1P3IMMPY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemZsqCRA9TVsSAnZWagAAxi8P/R0+m/eopOcIqWm5n2h0\nbju2tnDH/9+OCryfSOoGjPqyao0MO6NVHxVvsNS6go4c3iEgzP5yRUtDn03I\nhGYoBXvxCWhexLruwy/3QKbDHiafm6DKRyKV6AwbThjvB1M97fDKgLLxlAzu\nclkqwMhSYn0hYf1oDkH2eSi8ditNjP6eVXQq25XXbLum8DLNAPz7O32nNzuQ\nbyy48v6CuaWem0GE8e+8nLZ6cSYoBPdN5oKqPZsckAgDk+0jHIS8SAi3K+J+\nsul453xr47aUhWiHxPPuDG+e+F9m0nXZRcghKPifc/v/lgozLJuTiJvS419G\nXrLNH5CQykbhwpDgNr/m4UqVTCfpbbZisSOW6FE/A0OFL+B6nd1y4XYGhqu8\n5Q2xa1Q+fV6D5onbDSvW3MfvByNf2e1LALs6O4VgF7LG0cM5rgYolhUy21/k\nOTBXCJFp1xJ3Ea7x4M0JakB/LZVYg1PIf7l5tVJA1Dk3qqDHqG5FHvwDuMld\nXoJX19wyoW0YLSR+sy1114+FdUfBkWAaCOpxNU4Y9U7Zb4D05SEd8HAFck5w\nTMgIXgu0frObKeNYhiarOpjMAkdd23Rw3KWnbPZSNDF4kHfLDM8aXLQS7PDR\nzVWojDrzAAqhnsU/UEQn68/oRX8yqG5rv9zEaDq5PyBPZGy3yXrdriCIIH8i\n+M4C\r\n=zlrk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"7d9f878ff0c7d9fcac2c12c2837703a809fce417","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.9","@atlas-engine/error_provider":"1.0.2","@atlas-engine/user_domain.contracts":"1.0.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"3.0.0","@atlas-engine/eslint-config":"1.0.0","@atlas-engine/iam.contracts":"1.0.0","@atlas-engine/http_contracts":"1.0.7","@atlas-engine/event_aggregator_contracts":"1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-7d9f87-k9459azd_1587125034398_0.6027160828878886","host":"s3://npm-registry-packages"}},"1.0.0-feature-e0b190-k947hzxm":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-e0b190-k947hzxm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-e0b190-k947hzxm","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"666baa34546f735323cc9e1b1d153a439197350a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-e0b190-k947hzxm.tgz","fileCount":79,"integrity":"sha512-jnrWyaC3n/8vUGHZ/XmvjtOVGeYDa7hVEKcJCXz8rvS7B1JZj087S/Ivesvrk3f9tX0L1LKidOuzMXLWlsD5AQ==","signatures":[{"sig":"MEUCIFkmiviABKkRIlsraX9PQiXzh17LYjzUmmS1Lr2nSAXcAiEA6T8reL2Q4s/Mv5Q1Df/qDwYfrGj3TUc7JNgGuB5ctl4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemandCRA9TVsSAnZWagAAb6wQAI5fFxrXL/JVyPbzZqxQ\negX4SaIdue5oty1Dt4zOARWHjW/ePBmp8bLk186wSNBFPaC33UgZE8EH/9gs\nuO4LOpwLhS622DR6z+IAvxQNMknJzNersx3iePfzjElCvhqR9aCmimxjBcuk\n0EHVYt9ZCkBLQvoe1n7keed75aRtGeVyowxPsM90uM5Es1NuVl1RRWXRSU5K\niNBJ9itJ9Fw5gjAnS+kBNgqoMPJFFKmC30Eh/WlDcB8DTt0nVG3IpIxHCaxr\nXcy6bBXteTLabgN3+FGg0SOdW5nvIlPWDE7r8lLGJCsoprYMcXfwNguP860L\n6AoMW4pgNLtshuVIVAjxWmoCGpic1ebZunhJdDim6mevqDMechujao5voNVV\nIfNuEyihcioxLLzXjk7u4BOFWoOKqrwTfd/gixhgqR7TSIRwKJFnDmlRcT44\nM6Pa5NHcSaQQsbjblgyc20nv0/MXr6KX6o2vCEw34KVApsmcDRqvxm/Koye5\n62dS3Et4zQH5bbWV06g9VLsejOb7VRDSDPbJZ+leNAMMh8yOSAFBVyGBpSlY\naocT3BlInq0jR3XG5BrxZJ5fsAiB4DENWQNp+62ls0rlbmijckdPMJOeHOwt\nFbaGnYMJ+WKdmMZXu6sFlWTOue1HMA63cmz1XmX/Nj7dQtHxCCc9PWEchPwe\n5KHs\r\n=afqA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"e0b190390b17926e01a5f0f52f68d1f69fa8fd8e","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.9","@atlas-engine/error_provider":"1.0.2","@atlas-engine/user_domain.contracts":"feature~pin_dependencies"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"3.0.0","@atlas-engine/eslint-config":"1.0.0","@atlas-engine/iam.contracts":"1.0.0","@atlas-engine/http_contracts":"1.0.7","@atlas-engine/event_aggregator_contracts":"1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-e0b190-k947hzxm_1587128796970_0.5207256799046158","host":"s3://npm-registry-packages"}},"1.0.0-feature-763216-k98ysqfx":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-763216-k98ysqfx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-763216-k98ysqfx","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"a50f21685720a49323967900cee35c0fccf142b8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-763216-k98ysqfx.tgz","fileCount":79,"integrity":"sha512-SsToFI8MRMkqRbm+H3hqAL2OUQiK2dNZzdqblZtmosBVqQnmQkIHcHHzkWOmvhzwt04R/1WfZw1r13G7VULB7Q==","signatures":[{"sig":"MEQCIGtoUQl341Co6c2h82yTpHu8s2CX4bZzwgxeOfPBFyQeAiA229RxkhI9MdOIEk/GWRPNpWbeTGg/n/XowBQGOlruMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeng3FCRA9TVsSAnZWagAAecYP/05kQ+oQXRyAF4SFKpBC\nVuLVH96pcPEsV81v2aElkPMR9cKAlNcpaiHyOGox9SUWRJn32LFSl5vD59qZ\njdTxGNcCYN3oZ9DWM0aQuVz8EYrXd27ABGtcYRf5XvOFi2ejYI+GqlXXOhJ/\nNrVB2dcaJv2bUg1agq/ZOkl6gAtrXiOfuZulJc61bBlIL1WMDym2FcOdvdT3\nBzhfYyYVaJP1g2u3yBhQr7YxeuERT6BNrX7VxwNNaveyvXPXoXmbSf6xmIG7\ni06fHJNN/HryMR0y8AC6umhQN4zEt19zklSrQW3kleE2nWCUKnaEH0W3n8Q2\nFqK4SMczYAGWw5W4ILkJI/kUn6YqPnZK9kD4+6p5D9C6a5e6UL7vQCZX1Y8O\nPtE08SVk6rqn5UQbRRkAx8uwvog3OR2ZBSVdDhjoBfI8YJNXXmLCRIs0z+L5\nnZc8TgKsTEBXzCHTlopw0YRfqy+WweTv8yHUTCRE9jDprf2Dt1BrGHm7jvz5\nIhTzvMnYtyVAnggEu8fiybyYbXRe1TNUK09YvvUgDr1NfjwpyPgB8QImWTaA\nUNSKfwNhzqBwJVGvqFONm64coRU46f9cJS+VpoJe+AArQbxKTx+Wf35oYdnB\niVXo/yvMagUaHpBhmKIPrcgJ5wQNEnC9XBxMgKrXeaSDDikN1y7gfadaQlmr\nrLJ4\r\n=98cx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"763216c9fe77ed4d1db843c7e31842fa89f7e7c7","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"feature~pin_dependencies","@atlas-engine/error_provider":"feature~pin_dependencies","@atlas-engine/user_domain.contracts":"feature~pin_dependencies"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"3.0.0","@atlas-engine/eslint-config":"1.0.0","@atlas-engine/iam.contracts":"feature~pin_dependencies","@atlas-engine/http_contracts":"feature~pin_dependencies","@atlas-engine/event_aggregator_contracts":"feature~pin_dependencies"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-763216-k98ysqfx_1587416516539_0.8581049657314259","host":"s3://npm-registry-packages"}},"1.0.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"309747b3b390152d549e08c840c3c0eab86e299c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.3.tgz","fileCount":79,"integrity":"sha512-+HZ3ZQcxqUi2qAL0Y4xrdeZAAEOhwck+drWhh6CP+POCKxW871wcFYOfh8/Nh3iJR7bcShsLxbSe84WQeo1qNA==","signatures":[{"sig":"MEQCIC6AWtHgRbAXUL3ySTZeDvGEDmBIQGYBjB9IVNT3bKi3AiAIFprzMOtPbUOqj8jza+d8dpI6ydXAPvYRO1c1BE/XLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenyz/CRA9TVsSAnZWagAAGOwP/R4JEZx8jq4+UV6Evxao\nv1Q3fldvfNty8TWyNL2c9QL/G+nt3cgqCw+fw7SHZ2xI0hk9RwdpydoubXKW\n2vJVhvFHjEfIsROq5drGDdUPQVemr/vqhxAZDYLiJWPFySNA45YsWp1mGwBg\njCDOxTVIYJhkBoEq23Bw9PYQP3EMUmywAuIuNg+ztkbde5JsqMLQDp9HyXIi\nUGo781BufAcQVactlgNNhY2HNO8tDoykgc0LKI6TGreIvCUzUump3BiDp9KH\nEjH2k16tl8SYy3ugUugWq7fHbUWESZg8wOepKyq/lMsQodsiUJne7Jd1gJ7x\nvw5DoqJTMY2YAnh1Ao2aUSP8ptO3ykeNf2rJ6w0xGbjcSDIF5Re03aZUKeWQ\nBDjRTmlqTTDv3YAnbFo1+zLLNf+KxeVxilhHoLKQ0hOZKj0b2GoPjpgOFIxb\n1+3s/kI3QPdJJfEf2h07m2AmxFUk4yoGwV/ZfxxCVPSwdLt81pqBctcVOVGU\naQG+v7N0RgBxlPiWk1wPz27sFUFfTeF9XWmd0bl6rUCSHzFv7Pq1u1nXvrF5\n57dGM1iG59xFxely51loCiETzXihiUpsAis712rp5tnI1iHVebzwXptEi1ZL\nHiRsCCPFhmy6J5n1WhqYQTfspwpHZsIjxBJFcJtAW61PQuFdziFlqF+5RzMh\nsg24\r\n=3pIB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModel`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"8c0fab0d7d8911ba619e1c50cf1ad5bcef403acc","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.3_1587490046836_0.8105649923812595","host":"s3://npm-registry-packages"}},"1.0.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"34ffca61cd27808082425280198e19471b83ee05","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.5.tgz","fileCount":79,"integrity":"sha512-pr54d1eBrH0yuD/wub6UZzquKm2bIkG7Yh/DKEZPUmr2Uos5JABE3Dp27hALmPLgyOdzmkv9BRA+W2sFNk7Jiw==","signatures":[{"sig":"MEUCIEd1tEFK0IgYXNwaW8wb/Jg/6Wq6iUA7cX/44foV3rgIAiEAoeZ/iNXicLaDKAe4tmKARJRhPSjP3wCD42FVNR/+Ol0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeop5KCRA9TVsSAnZWagAAZ68QAJuVEWopqPi0T22P40oY\ncuASFn+Q6dgW0sdqQoNk55dSpqR+emc9h3LYn0a1GfhyRgiIRKFhKT8S234g\ny7opXVZ3pflK/IeK8HCFtBxibb1YhGefObyjpDHgbF8MJFymt8AKpalWfeLb\ncOM0yL8nj2MyvyHagwbyLhVwiR/EMpKDgi19Lo34L7LCdp41pdZedBNEr2JP\nChAOJxcDGFwKigSogqQi7S3wq56oQPYeFyH06VfSuys5gWMgdUDx4Zejh+ho\nNB3Gw2/8kj+tkXcIlAX7f9O2wYFpjbQheQYT84uHLSiiRak/lSB98KOPw+ag\njxNGVbyLYsn03P7kh3gRbcIqDDcPkIDY9zTpHO1sw5usnxOq6PBlq2gHnBhz\n6XL0Ks02L8hXE5E1Z5FI7exaMQv4TlrIE6VKHRf2NGpNLX24RknT2e7HzuaZ\nAptYdIW5KYjJzZ0v0hBNtIMKpCh+O94i+niyvBdG5aEL3ZMcbvZCnLNXnC+b\nSzgSLiiv40TaTrXPwrm4xEO13kpHHCaBotUPQSHRWzJ9WglF+aOnsjS4BSWh\ntVXj1PuGwD05mpLtr6vddGvhGJ4DPexwkOlZhnaFTm2lrH01XqKESgI7Rh4G\nbI6LgBXbLx1d8v65tITUF+xF3bVJ9nMGBl66RtQcp5XMuL2Kr8OUX+aFVfwS\nkxoH\r\n=wh6O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"8f56ac6965643742c4b6e5ae0165410cdfb74110","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"^2.24.0","node-uuid":"^1.4.8","loggerhythm":"^3.0.3","socket.io-client":"^2.2.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.6.0","typescript":"^3.7.2","@types/node":"^12.11.7","@types/express":"^4.17.2","@types/socket.io":"^2.1.4","@types/socket.io-client":"^1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.5_1587715657870_0.38404480461818036","host":"s3://npm-registry-packages"}},"1.0.0-feature-35aee3-k9eantv6":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-35aee3-k9eantv6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-35aee3-k9eantv6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"20a36041fc15cd7d554e1c9450426d0aa41c9881","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-35aee3-k9eantv6.tgz","fileCount":79,"integrity":"sha512-bGOFe8N30b9f9rkWmxWuXlkmffX/FtkH5opmfBmxzYf5sX7M4kIxO6ksv0hdt+10g02DO9QM4tYljarzp+Q94g==","signatures":[{"sig":"MEUCIESnTF3GHKadXZEpgNji8VmJ+Zg9m1kUwBwVdprR8vfpAiEA6Hy0nJNRqg4zAyTUmdlz9xbSnfrsXo+t3JcVfvmEMB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoviYCRA9TVsSAnZWagAAWgMP/RJMeDxaDNuxGLfVS1aD\nMYPKfX038umcmo4TCne73EA/p8WocHasZs5i/RWuSlEBNRTur4R+iE9Q43yz\nxaeRjw2FCal5nKG4ll4d1MtcZ4FVqdnDewE4/+6JZalE2qRHc06mRvhDaQIy\ngQ692vuzcL2EHh5YJrWdOaIjlIeaGeQVQ1ZIfx/etCoWWNwmLVxV0XqmmI4y\nWZLNf/6MlROqpmUoHjB39CgO8jrWoCcuXldKFCqNvXq7e+Y0DHB4bbOqT2ZR\n08wwPQyTg0KjdyiCOTqXmLuv9bBAXsvD3vPse4Obez8CZcamzZ+CqEqXris9\nGnGeGkS/0hu0rcLoP/34rHZWAvAqJM9fQ+RXOezVOpQPyjQWQye5yVK3KD1/\naSILUYKUF2zk6n2PdEzNqUnQE1qq9km5J+ygOl0DGjBZ11jT/qElpwOHSZI8\nVEnqsA1mYVaUzqqqTKy5xnIyC5dh7D2an2UoWD97iMqOsYD7ec3N0emrE2D3\nSqefYUQa7Ls1K8oSn46w8LaWplxoJ2/f14bcdH+fL7cOJXvFXIQuP/PkHjjJ\nsfBB45ZGxDz5G4a7mvXhAJ/bb426ohtH7f33w3udYkmh9p7O9YuIZH8YapkH\nlc6lqUWgxxtccPUXaxO/5mEdplU4qYqsH0/QJu/GQ6BnQSkO5PtbYwchNurP\nuNM8\r\n=KjiF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"35aee37148c77f85d9c2464f07e0a5fddf386a70","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.9-alpha.1","@atlas-engine/error_provider":"^1.0.2-alpha.1","@atlas-engine/user_domain.contracts":"^1.0.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0-alpha.1","@atlas-engine/http_contracts":"^1.0.7-alpha.1","@atlas-engine/event_aggregator_contracts":"^1.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-35aee3-k9eantv6_1587738773476_0.6600767807091297","host":"s3://npm-registry-packages"}},"1.0.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"ce4e26bfbc1d09caf25a04beabdbd19ef30b80a8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.6.tgz","fileCount":79,"integrity":"sha512-MClxU8kWV0vpK05mUiC0WTIoMqtr+YQ6fUfDSuKTU4fjiG4oj0P1Uv7YoBMl6lrk/UAU+ykdxMHywFx3kbGS3A==","signatures":[{"sig":"MEYCIQCxi9qhr+ErrnCyW0MxcUEtchilCQz75jbFwP52wyOy2gIhAIg1lQ9cuQQmUdfWkUcKls37CUapYrrXNlgaIm1Xp+/O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeovo8CRA9TVsSAnZWagAAEpkP/1xwZTzwuWb4wkw66s0t\nEn3qwW172AiNq/wUHHxC4z6C6zM4u2iMF1+SQtYXS/+2UbyZ1lmA45xXvcoQ\nzVwIQ5JtP/wCjS+L1J3haqJirEXeUQtkLcjLRTTYOR6XkVvDbu9JsrnWfy5F\neSKkl+vmAhhC93aA1Xgibl9LvxIWmavfjD3EvZZigKLtN9vDMV9mIJEPkR7C\nxoNehlyV6YokPAjos7LoTVahNRrXMwfqgvYlykG42RFgZqZIww5hhte/9R5a\nDWFZl5x1CrZQcWKxUh/P0cVTeuYl2SujPFWZabp4UZjKN+H4s60kSiWNoKPO\n6Lr8iP871SEHttra+lg8uni2/KPyoYPrVArqVkigrThoZyPAWaO4Gz7myoz2\nxGMytl3sMds3So39tF8H/VG5lTs3Qpi99UvHIyp7kRHB5qyfVxjVMBX5xvX0\nqztvYLITIfxZCBKVEy5hgJeoqgBi/5780IL+nlJaPFyj4pko1oJnYe/F9vt2\nau5cs5MtkDJR8iHSsZCd0tj4IMBO2+Hgrje/Ne+1fkEBRr99Z1YY/PIculnd\nMzA2DZqu8EXuUHiyRkP8RzbmgPEn0zDG86kS7eiTyYpqFS1MXrzhWUWs/ju/\nPKYg5qk1qrfOhRhlyvw+W8cur61TknMkkp7B393znPfA2nrMdjqCAiCcMC4H\nr9Gq\r\n=bVv8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a9111b460fcb8dd837e08d4fe1d739922305ff58","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.9-alpha.1","@atlas-engine/error_provider":"^1.0.2-alpha.1","@atlas-engine/user_domain.contracts":"^1.0.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0-alpha.1","@atlas-engine/http_contracts":"^1.0.7-alpha.1","@atlas-engine/event_aggregator_contracts":"^1.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.6_1587739195644_0.3777297508240631","host":"s3://npm-registry-packages"}},"1.0.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"3a47c7bbdc1d742c62062aa679999358e8b5406d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.7.tgz","fileCount":79,"integrity":"sha512-XGgIlNuJt3uOKLPtuJ6Lb0PBZv3ucDICIUQaSH1ZtHLhe5GqpFiTAaCOEb8T4xuR/34wP9Z0OyCcms8yDNrtUg==","signatures":[{"sig":"MEUCIDtXYqF5X0BqFSpJAzvvXcjeiwmZYcQf4RYLISW3KLo0AiEAtmdVE4unQJe5KlwsQT828v8bsR/C+wLQewnbar97LOg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepqWUCRA9TVsSAnZWagAABVkP/2JOx/fJGNFODNYQOwZf\nVD+KtuLdFqbE26POPqcRZdPFQlH7fomU9XBj+PXG5LwOgT5itt8L1x0rk0Ik\nY1UoP5VXphQ/6KyOYQ/AullIixsG+HfGM8a0gwun8RooWmlfSEEjERwXlrpN\ngYrzy5xL5a+6IZJE2zNlSDzCUmopljl+psipROA/KcLL5xwiW6qzv+eUSbaJ\nNlUUxZ5h24CIRLPYDyIt8pIjWQHwaTMtgYPlpq7qUQHHmQ9urImuXJe/evXg\nA/8OccsQWHH4xmGQQwPbbbI6OkrFli7kn74eBXqq6N9taRe0Q/XtIyWr/Gxw\n/FPvKvkOGqSkUSxxKXrGvItnv9Y8CV/ORlNgqwSnWXY2cMnrRLgCzLZRuCN0\n0dFmRCfILRnAjXKFM4wVKjj+pUfE0gpQykKMW6kiQEnTqlMz4k1zy3ZuZoPu\nTlbiPPE4lQr6jCLWHPWop9rOHj/W4nRqbu/6kTBxWTS1Vgwp5YIG3pNflrjM\nYKcHY8mOPfFZe1D0ly2t7XTIo9URRgb//bTyGedR45qBdXpWXmjUcRAT1K2V\nuILO0i8K/vVMQ+suw1e2O6e26gU88OVQZFXRYAX3UGO4GZtLfUDH/VCv2nG6\nKPz2/FiA2z/hmm7dGMO+tz4DfKXug+s1ib9sdWbUx+Ipeut+p0h0s8RgI5Tb\nVww6\r\n=6+Di\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"f4b6f98ee6d6b45d26c59098ba447ce8420f22f3","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.9-alpha.1","@atlas-engine/error_provider":"^1.0.2-alpha.1","@atlas-engine/user_domain.contracts":"^1.0.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.11.7","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0-alpha.1","@atlas-engine/http_contracts":"^1.0.7-alpha.1","@atlas-engine/event_aggregator_contracts":"^1.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.7_1587979667610_0.2872805173037185","host":"s3://npm-registry-packages"}},"1.0.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.8","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"fe19732d4e75abfe07557cf1860bd567e301c03c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.8.tgz","fileCount":79,"integrity":"sha512-zVNqaG/6nqK3UjT+l5I0gewrjiTjAKJSnOElD0GHCwg1xEbm7yl+vq1HYzPOQHeJalDfAjRQKhy/HVOcfO2G6g==","signatures":[{"sig":"MEQCIF6J1yWuZolDUpcDR36th00sWcQIv6RwohAkFsnbjHbCAiBSCTUoaQodO9U2pRQLnfyhNWCuHRigoAQ5p7EgzykGkw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep/39CRA9TVsSAnZWagAAIqIP+wb6+D8U+pOXCTeLPz8s\nP6Dt6a5zI0sdrMCqhRre2SoVNDNUDXLsBm43iDRdzp6d6TrQO3JtzyHzd7n3\noafMp7LMrkS+lXS2ZuJ7Se/4ykSU8jyGhHAoChvrPGYT+q3CIF6qrMnU9XgU\n30c03XBmIqwpXulKTBmbZ6LqR/lF+NLIXshCr6elJYLT6sQKe5DmJQIZWzzd\nLlzlDFCPZh6xVERqM90+NdhRmMogNBGlHw1X3Yoi6Eh7QrzKc/ktY2NXBZgN\n7HuZxVV6SVoXntcW1y4XxIkwrcCppSBtWnQQbz3TMe1YVB9ardOdqMjK0sxt\nBo13e3qRzQszDPRe19+7ZNSjYTFRoyhUseVlsbBRqYmDXQgnEgMJPEAR/c45\nMFaW4dpWBNWIZ+rxzDYtiOLYaUm1LSI3JEQ3aHgij4++3QvJpfSPtfUwvL83\nKjyC12Uzzo4NlGjymf2YPsq6C3E/KsZHE/gS11HM8q3OWYReal/YkYctfxS7\nfXLAKo3XYT30Ec11f1grogJXKWG6r+MDQJNwRmnI1OE86/x89VxcPXxh1mWP\n+kXadgjex70OJd7WJL8QTyxTnewXtfeOTsmObDHDGDxIMGhi4sbm2ug7O5Ie\nUol3OLdHZbzQhgptsm+jQ1ySD21X/DXRSJx0m+dgpNfefWU7u12yPKMcxaF6\n6rm4\r\n=zsah\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"0f570d7ab2630af39e6c97897734c93b75ba8f12","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.2","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.9-alpha.2","@atlas-engine/error_provider":"1.0.2-alpha.2","@atlas-engine/user_domain.contracts":"^1.0.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.0-alpha.1","@atlas-engine/http_contracts":"1.0.7-alpha.2","@atlas-engine/event_aggregator_contracts":"1.0.0-alpha.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.8_1588067836689_0.8993818647244065","host":"s3://npm-registry-packages"}},"1.0.0-feature-f4e6f2-k9l12az8":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-f4e6f2-k9l12az8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-f4e6f2-k9l12az8","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"b6f4fb777d2f98f6d769f70df997d50a897c26a3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-f4e6f2-k9l12az8.tgz","fileCount":79,"integrity":"sha512-uExA+equU4KO4l1nN8p8Kz5WcIJ8wVmip6taRd/x49dcQIEh3wtIRpgAfGwSVLOH6NbRUgcJ9X6wTjHFOAt+OA==","signatures":[{"sig":"MEUCIHfxom5X1N6nr4y1s8XbtS3j4f1FbgIVvJ3fnfHqCmlDAiEA6Pski1LszOMkaRRXsgARa2wjdW3ERJQj2m0OafTwd50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqS78CRA9TVsSAnZWagAAyBQP/jwBPFLsZb3FLQZEhUl0\nKN0dSu9iPbG7sLcJe/WpdSiRDggbFbwtwWL45ZN9+FP5C44hAdYNB+VUN6nh\nTEzMkqeF26yTMwkIP+CrKRlyEz3ofOGk2FpoAKnYoyyNvLBKRCW3wRpCdCkV\n37ayQEpCn9IGxbWLM+WGj8+lzisW4tMVtaFdsbUXIiwiWPMYw9q2nvAxHeOG\nAS7wfADjj4vme3p1pzJD0XAOX2ejTm/WSp/R6C7dVWw+HBRXYuusPYCe6WIe\nIIVWTM3A2oTJJHp89iXgfS9nRCwOZd0m4mHm5xN3vPnJgdcG5TlVLWjFCj6G\nzGjrFCptiPPXD4O2Ewo3L7hPzwRmwyrelaKWeve8CC3ZeFTJaBFEaDQCyD3N\ntq9YZLsjwjDDL75lot+yeedBHjrpFVkg2vjSOxfs6BEbvG49PU93Yi/GNBoS\nTEDxhXi4guRjDodSvsPkQUd8rp3raDz/+hbCcV6uYeQsX26ttiVd/pSK648G\n+jBLFDRNq0f2AI4+ohpcwhxPamkzhB8zzYRObzOpIbzD4C8oUjFRBrcAwJOL\ntd5zUv3KR6F6iWCJUGM98peF8nguT79hQmxjBEMSNjP3XhoLfUSxHqXJa13+\n4fCqjwoQrzxyNY5Aq+3h2xoEXxlHv/7GJfGwxW6U84yDQAJxfqOCWTNMzxzt\n2qyv\r\n=nact\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"f4e6f297477f2c3468a70bc51197c783ab527b29","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.9-alpha.2","@atlas-engine/error_provider":"1.0.2-alpha.2","@atlas-engine/user_domain.contracts":"1.0.0-feature-9ab377-k9l0nrus"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.0-alpha.1","@atlas-engine/http_contracts":"1.0.7-alpha.2","@atlas-engine/event_aggregator_contracts":"1.0.0-alpha.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-f4e6f2-k9l12az8_1588145916109_0.7426280185429155","host":"s3://npm-registry-packages"}},"1.0.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.4","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"3bccbd81869c881a81bca4b97f596b62182a0212","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.4.tgz","fileCount":79,"integrity":"sha512-sdgyJrqeIbv2/C+pLeWisPvTDtQxx8/G3rkcNSYAHEuBJ6t1IH3yoUelXLP7B0OjWufRpKVgx1VqW7pxu2mlNQ==","signatures":[{"sig":"MEYCIQCXEr1yH/pN6TiumUmnRm85c/ZdFr+eXYEASwjjrRlCpQIhAPpKOVgonvrvDnkzA+36qOt0F6KWWcHb5JikO0ZTh2PK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqXQUCRA9TVsSAnZWagAADzAQAI9kF7Mser6HOV67VFFq\nDJ3N9bR1ja7lKxEtmtURCkQMx4GYoR2VoG8vTQO7FuDnqEqU2C+ScDegXVbd\n2MzmzuMmvqLXjyqNKKZ3Soxh4BdhBFdq7ZKcAkXOoldO5sLpCY1/R51YS94n\nYMlyo958j2Sbjk1RtAk8RqAeZ5EdM+dlku38TgvLFcX2LvnImVLRXYrUQAbz\nQyv/EiRhuaKZPHRxw0b2XNAIVAjelUjHXVTEpME2Czg5FyycsxQt/il8H7zL\n3Db2P68K9Ei0kcE1e2IZceIqNtG+2PIt4LkwcSX/bxF8vfJKM4lmFz09If2b\ncnAkzy12FEdTYSBs+kkzcinJF1UMJBPl41ktSjH9aS4dvI1GYysPbOh+7p9O\nNvCkmI4xKfW5N2mYjxXkBbceKWgaZlyHn5p26pu5zhuq42wH9Y0HuMSYVa5V\nlesBXAf6qy9yR3Eb88kXSVNeO8ffeolU3gdUaDC3F8JjyTUWE8zWnpbxtsJd\nqUTZtevJGYQXu5ntBKmnSfAjXKsFcuif2UzQnEk+uDO/L+2uu0e35VtGzF6r\nNzAO5TOG73PqmgOqu+1tptyMsOPBgBbT/Yt3jW4tN0DYl3Y/K3FSDp/+UrfY\nCZWsVeGww8g7cB8XvNECwkNhq8K9FHKlLGuI01peZIzAeSHDZGcukWeV0nxz\nmrSU\r\n=zl/B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"8d89b8be91fe491b60616a8bcb9d9f2c366e3c2b","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.4_1588163603712_0.6931994714766907","host":"s3://npm-registry-packages"}},"1.0.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"d36066843f0d82f1fff6b89cf5e52ca8ea6a6023","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.9.tgz","fileCount":79,"integrity":"sha512-+RRY1TlavHi0wIqsdIG1dmZK1lu8auAHP2SmZC51zlgQf3gNMxhBXoRf+LHlgVFRlcPNjfhTM0pXw10TpNIfMQ==","signatures":[{"sig":"MEQCIDoPNxuwdvQBnBrUUnaDVLu5B1PawUGJzXarPH0rQZP3AiAYhcsrmY4LjapvJ/zhdAvq9rNaEItB+0QXosqwnG5dtA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":203935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqXR/CRA9TVsSAnZWagAAgDMP/0mSn6H0Pqs11m0FYjkW\nijsqqKlI4Pk3m+9oAf3JSIXJWshJ+SXg/d7WeG9DjYATrjYFMnl+aB4kQuVr\ne4phJkxSQVkZz/dj6BUkVWyRyj10m9vBfixMsKS6o0fDmRpAnPVaENMYvF37\nf1E+kdECLN3Q5LF0Xk5sN3xIEV0tz6/hJ6+SqytkkrisKyvEGtSyUh7+c4JL\nIkDKX/vV9Zvvm4uJPNxWkRM+o13GN8ZzlE9Eqx30ksX5BGIfkrw48EulNglM\nfpCJ7r32ES8xCw4QZjERvp/VTbqUDnfn87LvKsNeb8eRC0aCS19KlYF6rjWT\naUGkjCbs1pRvQqAwFjYkGntkZF7QkTFywdEtIyt90ebpP4YEc1SuXo9sUWXg\nptZM+1gJZY1UqOka1gEpAUWOx1+wXaD31y0NjoN8EpycWvFcyZEB6qjR7a5R\n2qSITWiR1yh0rLXFw2F11lZ+mvwHYVSG8/FTorl+7bBnbwkM9l49J1eAZvjX\nyrh1+uBzsjCFGslZGWvPAFHlpkW4txJW5lWEp4GjmcY7MUZtxtNF1iZkJMdc\nIUmWm3xZdxtDyAxxjvbnlwx3M6Va7xQ6NTFhoillh+dTmixNfOK1N+wqBpW4\nPmcgdo7hNda5w1eLfkgTIyD14VJhXvCfLqj5kKhvSQdtkpytBYnnNzXkiNzD\nxW/4\r\n=ZxRf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"48267e76acefc8d4b1eedd2cc4ed83673bfab0a1","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.9_1588163710958_0.7220402786466658","host":"s3://npm-registry-packages"}},"1.0.0-feature-e61998-k9lcwhq6":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-e61998-k9lcwhq6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-e61998-k9lcwhq6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"2a33aa6f449ef6cc9811f9079daa1481cb4cfbc7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-e61998-k9lcwhq6.tgz","fileCount":79,"integrity":"sha512-+o7nTdlIELciAdRzxNCuxubtd/DP8jSe+0OutBGVSEVLbzCyb88EewO0R9cyt2fhut9dZNyZVFZiIa8vZCbTFQ==","signatures":[{"sig":"MEUCIAzlVH//SobEvgo13eppHzVjpbvappquFiy1eNxad0unAiEAmNGb9LvJegK2Z+MT5W16F36sjDTPFECT4qqYWg5a7oM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqXyoCRA9TVsSAnZWagAAv9IQAJWbfdnMh+PabuvSzBWU\nBd2E7l5mz/szvk0DvJk9soNTJTue7JRzdRb+1bidBWdsYeOOWEGl3UBs7Tuw\npwsE/4/7he4gSRUErtgu+hAquErLuKWWnowCwr8nLyrx6yC/fhBdM8/i6YCh\nICeNINQkieEefvjrJUsGruxT5QfNTgm8KrFXwQ405jhh/uoD8EeELVKzLpDT\nOf08ojjKTRwZ5A0O2PDscCIeQKMVK/2z1mygz8+h3SniUp8RS1Mi9dO9xjqj\nyxJ3+5AKBTEMf2b1CX/kNR5IgZ1lJt+dRgxKvppTvL00wXwLfoEEjJvF0z0G\n3RXsfPW6aX3KCNrmM+XmS2WMrLqT/GzuRwdrx2RaN0XombMqmyGl3GbDQgF6\nCMVFpIr6TBrGZ4DQbSr03e68VU61TrDebmrfpHQqQBFA2cqcvz0iv9f7LN2v\nAH0kCP8HoEGr8cxoYgWNbNxvS9kA2qufvR8fn8KN+yPdk5fdGzClHBBlvaY6\npa5HZjX4lU0XBaBZySNpAfAb/Z70Qz+7gxczjC5BZB4JYM+PLDWYCLlw/sG+\nGdKPXag4LEmMlL5b37ou0zV2Sf7wcOdRANp4jHdO0AruB3xjUSFFmpgcch94\nDMdDSE2rgB179p+/7AhP/Lj6Zp2EFyYSf/vhFOow/cfknPRFGvbt5jAQ2txN\nD82t\r\n=Rmmh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"e6199819e9f28482612c5492b21d943d7a825d1c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.9-alpha.2","@atlas-engine/error_provider":"1.0.2-alpha.2","@atlas-engine/user_domain.contracts":"1.0.0-feature-473707-k9lbwqsa"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.0-alpha.1","@atlas-engine/http_contracts":"1.0.7-alpha.2","@atlas-engine/event_aggregator_contracts":"1.0.0-alpha.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-e61998-k9lcwhq6_1588165800277_0.8159740520901195","host":"s3://npm-registry-packages"}},"1.0.0-feature-4d321d-k9ldj5dt":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-4d321d-k9ldj5dt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-4d321d-k9ldj5dt","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"01a482ed3540104432a865927f3528ac193ee7bf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-4d321d-k9ldj5dt.tgz","fileCount":79,"integrity":"sha512-otPi12YJhD+EAKASXBiYM1e21ZQArq8ynTJ73TWJQx9tUqxJeyhmGqYmvHC4v7rvjyhjZm0CHmpe+CU/2hsorw==","signatures":[{"sig":"MEUCIQCn9bxsb0v9ZWouQpm8Ld52RW/E75Yi1uyYpdG6IgBCbAIge/tssPueDd5SykcWmtgC5hS7WlhaINMxDfWE9x9vGnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqYDKCRA9TVsSAnZWagAAG+IP/3kMwC4Dq3IYnlj0qm9M\nfl2m5uGz9oCcJqmTXt/XryGsPH2HRwj0sUWueQoN5YNhFzKtDx33ky7E0iYc\nI50VzbMmToFEAZ+2e8nCfdRqyW5XlICdBOrVS37eMErVNN1UFU09dU1EuvkK\nJWQYtkTCVNsf7VeYHwidp9A60z8QKlWSjC9qvgLpI1Ex5Kd60gVd/8MCBefr\nf/kkurUd1CQLPUsdYikTHq5GkojsVKUY8tX3kMZMX0rol5gxItPwd5150S2b\nYH/rS61XA22zU4yZGevvvkUjvKdJ2kRjE8bcPffI5Jwutb5M3Y4evRCzgQoH\nbWsIllF8wPmle8AEml5wtbuhSygwIlVSJPTKzWtWnzufFWkK6+JJ6fdeUqIS\nfMQYwoCI9cR7Rulul4QpRFRXgxpcU33/HC4KvbEHrhZwRDBEkFxZF01h6nYf\n5LoXaqn46wCYlLHc/1qjmChChUrEa0T31+upRR24msRcWwkdvwno/qI+Cx5e\n6ed8cTZhe3Hfbrw9Pcp0itztIZ83ccCAvTwlqI99qI+vOWXUfNprsomvH5VI\n1sAfEzkKNU86j1gh6Vo5jglH/gIsAE6omLpflbSktHacypyxAmnObTbJAd9p\n0D9ElMN/LbAH7At+foXU5uhGakvNkqWOxAY01SjwmNVmzddVHa9qCHKFGjnN\nlFUZ\r\n=fZVV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"4d321d03fd6fa2bcc11be7e2e6e451be89d23b04","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.9-alpha.2","@atlas-engine/error_provider":"1.0.2-alpha.2","@atlas-engine/user_domain.contracts":"1.0.0-feature-473707-k9lbwqsa"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.0-alpha.1","@atlas-engine/http_contracts":"1.0.7-alpha.2","@atlas-engine/event_aggregator_contracts":"1.0.0-alpha.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-4d321d-k9ldj5dt_1588166858244_0.36265226003325","host":"s3://npm-registry-packages"}},"1.0.0-feature-1cd49e-k9mv3n8b":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1cd49e-k9mv3n8b","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1cd49e-k9mv3n8b","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"532535ef593596454f5e8d1ff8abb0d9a6535d9a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1cd49e-k9mv3n8b.tgz","fileCount":79,"integrity":"sha512-6ouzt2qJaUNKrJ/9m3/2U0rmbeD9wlo5ma6fyLbX8XEl6EJ9x7FKREZpBdYXDf+dmz9MIda1TY1Nx8rHwM+waA==","signatures":[{"sig":"MEUCIE52+W2FViGJC8z55qAPtIldm/eauPxI96TLmA6/sXicAiEAtQsa2OugcnIjpkUIbKQ9bwUoyquGOAuRHoXwGvkLAVQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJequBCCRA9TVsSAnZWagAA6A4P/A5xqbkLLLkWl8VH9G6Q\nwKfm6JYpCAYhEYw8qVFs2kyG9io6scTctWCR103LCBTdnGQI4zdo2ZtHFRN1\nfjCmi3B8ml1AElaj3zDVLaQBJmbLxQ9aZwWt2Dg6AyUold3Hub1x0IhNu5p/\nZTge/Dz/Q79GnhtlgOm6GFsWaaLKzZGOhHVb9Cl8ejoCWihw0n7TaHUnNifH\ndDKNEzrQSx+HRmTnJG9edyXsZAoCrQ3NCReXaMowT0E53qBuNimocVtzJOHQ\nENlNhskexrrHrRfdVhb+nDRMQOOVQwXb3xmtIUHCZX7w52YOkNQ//NKWokQH\nC41SdYBoL2BQFwSx8aR1LviiG4VG/YRgbzPg6jMI/qbzAsi+os+CHqOArBwM\n0azDg1GGDdtV9ShYlyZM78sxpULFyinkBruaEQ3fnKMJuO8uvJ6GGZr3ix54\nAQkRJrTGZQIHLdU/GWtyeZcsDAL1pHvKwXm0AqZc0Ce+bxP0AdRg9/ntUe6v\niXkGK0yFTb0DwJjTPILFrXgWNiy4v/YeS4QftvWh/oJp8pHNe89Le0ixasDP\nxZnk3pKAfllqvgW5v3AgFgsRwPG+S8wvkdsi41W4s8H0IPjUOEbHchlLdnwm\nceFuSR8M8ujkPDyoVe7ka9wBrqLevP5thpE9W1ZLbugeQxvHa8jfOmuwHPf1\nE6FP\r\n=3gIt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"1cd49ec968cbb58bff27b49383b3c7762b419674","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-feature-473707-k9lbwqsa"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1cd49e-k9mv3n8b_1588256833579_0.9726639108602202","host":"s3://npm-registry-packages"}},"1.0.0-feature-c25694-k9mvblin":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-c25694-k9mvblin","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-c25694-k9mvblin","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"4ac79ffd3d1d878efb180993d1e2503de578464d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-c25694-k9mvblin.tgz","fileCount":79,"integrity":"sha512-kYZVRoQ/gBJpuSTO0zz4nc0l9vqbqQICA6u3rQWX1StHi/wJSLHu6m6lWGfSxTdZ2gIXvtvrX5Z3fOJ3KRiAiA==","signatures":[{"sig":"MEQCIBOl90EQC+F91urDThcRgCtPQSsqKI3MbqlovlLsZdcaAiBOAByOlZ+mjgy7Gp5ZRMDOeliLpJp788NvUpu9n9HJLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJequGzCRA9TVsSAnZWagAAZsQQAI3pMUMEzwDzZzq6V/5m\nthTGj4RSslVLqwit91IKzNW/yCdO1ujZ+XcjB+iljl+HIIP/uf3NV3JCuXqf\nVkZu4cEQYsQIn4u1CZy6i8jPPF/M7axNv1hvl/LGioqV4ZCcIEfqzL34qBup\ncgDHjMzaZmOI3svRrG48g/bL6iS1aLSrb1iRImt5wNiKCJRxKM6ORBcJKR0U\nNfJgwv6SISfXNWKzWoGmFiGYMpRqsb8RvE5qnHkoACAL4D5gdNPHEyeelbDK\nlNPpDtP99cKRm43HTZJPdDEndEprdFriRTvZQTyFNbCMGQuIgaqYz/oIfVT6\nyXhffU7HMrjt2Kj0oPeCW1WcYlQbHH4YvVtNdfuE57zEH59jTj2F4p2LoJpn\ntnJo4LgzowQQa/ZRxkMVxVC7vDcpGXO9+i+PcraW3lOTiab/t5pVH5fhFG1s\nShqYYlK2rgvFAcIcnH2PBDaPsqUU3L1kyFL34HBO14B+e0J3AyIyL4F2tVU2\n/8PvPYTabBokk4ABVHlCLsCuJvc3c7susWH6Mh5a+h10VrXpoi7usxviL/lV\n/GGR8Yl0J4p0294FTqXla2MIdv71GhEdKi5BHhhjKvElxxh4eewzK/shMvhw\nmTwZQ1FLOUjo46DPSbuW17flh9kmfOcZ8ubNJhzpkKXDcFooCNqnT5zkFeeb\nHeNB\r\n=EaX5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"c25694e4275ad24a559bd9bdb3cd6fbb0ef6ca30","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-c25694-k9mvblin_1588257203379_0.2330000812378874","host":"s3://npm-registry-packages"}},"1.0.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.10","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"ad8d726596e28831d90bedb485766cc954518ce1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.10.tgz","fileCount":79,"integrity":"sha512-G5X4met/VVD574gxSo+sqNfNBrTAF2vKk9io8X8xjLFY9fnHZA/1A+GKsZdCViuZ2MQkUlVWRw0q/ZDZEoywUg==","signatures":[{"sig":"MEYCIQDVcXm/3hr3I73kDLFQIdiFCNDSczSIoX4u3SWFrFs+0AIhAPs4puQDzK4UmuN1nYH4qZcIhKJm/rQN7eY02luh0wn0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJequK0CRA9TVsSAnZWagAAHGUP/1cc3i6lXhvqqLXK28m7\nhluXWj1qZhusNTav0hebn7rtVTH50lWMneK9M9LseH9qQ5ZjZtepm0jdKJFd\nBLvxDPSKPybQ2Nxwr2zAVJ4mbM8aYPbyD5K0fMzAPeqdgFLdtLi4Q+AQZTRK\nSm/pC5oBlnbUfK6t+3lftVpO2dLn2EAMmrs4iWBbhieAvu1TJ8M1EarTkUro\nsKJ36VUm/+hE0xHQQraIod0TecY3vmDR3PoD/kFcFgD5MkSM3eEOYyQtXP7c\nzJ4mbA4JmUjSCiqOwlq8rj0KXD37bJTmchK2QBbmTgmnLDBpHhfl22PwIyah\nLlDihBWzZuMBZq5GLUbqQ5ZRScLPY5D7HmDVWPsK0tP06mdi+2SggO+oHOta\npF60vxCwJdwLTDyoFt+awmxpmN0ZdluznF8vZoJ6OUlHwgWamPaVULtnUDnS\nKgKzULOps3WS2suFTKBOK/LKv5BiaG4ERneEAvnhN5x4k6W2xmbV0Z+ZDpUg\nWcuKaUDhR6m6t9ITCW8tdmpANzKui/qJ8A1TWigl+me7s9b7vF5pZN8uUewF\n1V6CtnYWygSpa0u2gyJGKv1cLqxz/PdEy6CHj8xeKWfnul3fsiwVpvhAXtri\n0zEYjbHEbj2YUK6kGfSC8pih4hf1OPAs37k8/3inLJIKBzxj/sLwNIZEBDa1\nrwzT\r\n=C5Nq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"3707fcdb14b2c159d29b186870e3353284d02d01","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.10_1588257460100_0.49917787775290856","host":"s3://npm-registry-packages"}},"1.0.0-feature-1a1c0e-k9s9sldf":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1a1c0e-k9s9sldf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1a1c0e-k9s9sldf","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"828ff67a343cb8a6fec8b363beb83e56f28e5cfa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1a1c0e-k9s9sldf.tgz","fileCount":79,"integrity":"sha512-q/22vuhBT4c9IdHwGm6HXIigfmkhjsy13pjs9TgkJmVeBf0oLWWYQJINwVWlVznz46kf4m9eQvxvcFSSFL1eBQ==","signatures":[{"sig":"MEUCIQDYBo+6UkPaVaAFuioWcNpN8lLnRZ79kMQCH49+c4Ne1QIgVE6MW+hRcixlDN/T4c0NYA/Yncn4+5rBrKhcd2vqRbM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJer92jCRA9TVsSAnZWagAAM8oP/3kouivYEEofJ0Fjts0n\ngNUPqzGOpW9frf9cOb4f4UNWu5jdBpSvFNf8gMon78XtrsqdhgfrEb2kYPEd\nv2ZrIdE3rb0tNdmZaHT4IYBFt+J78q1ydKssYLNk1O/8F+XTh1AaryQVpwAu\nfEnyI0NVsINIVavBqpHp4EBNiEvLZV0P/MR/tnK8EV4i0xVkq7DlTXDTCZSJ\nsHCXnSVYWOgwV7TWaVlLfHWhRBfZ6Tf0lf9WVXL2FV3edd5jRNqMmlfaq1Jf\noZ5l9xG4xpsZLTotH2cYp9+aHw3J+nHdx+kFAVPomA9Y9zsSA7x+zZl3Eyd1\nj/K3vmjQcdluWiJqe2pllTMdjL6wz5/KshZvG6CxU6fMECDXDsJyB78yigNf\n7c6DEPPZiFhknoHdPt2g7H3f8dWDxebjMHgA2x3FTiBcua2J0FTd2Bespv7h\nkx1XdfyvYPLhHf+UA8H7ruY3f2x6zdB8vtC0uDVyc9ITaNAKekixB5aRkqSV\nq6OhvUuuJ2MFLHWZpLcIjFUctrsjWQSI56YDVBODVJbC4aGZMzAG9KqoybnK\ngzufxLeCgU+jb/etpmtn3QoLwedT6sIZyk3csrPasGOrL0kUhfTbIQ50z0hz\nICuI79HG54PBwqYvywChRfrNof0uVJhHJWzh3szG6j0WLXQIhSrKCBE49T09\nHpcu\r\n=oaTa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"1a1c0eb9b15c85733d15d1413d800077073a4eb0","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"feature~remove_inversify","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1a1c0e-k9s9sldf_1588583843281_0.9250528547448851","host":"s3://npm-registry-packages"}},"1.0.0-feature-8bf16f-k9scgzz8":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-8bf16f-k9scgzz8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-8bf16f-k9scgzz8","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"cfb58ff4dc248decf0913b4e411bf9d36a519f52","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-8bf16f-k9scgzz8.tgz","fileCount":79,"integrity":"sha512-Vf1WmY5NwB4tf3xiJlfrXKRiBc3k7oREsqETzYl4j2o2kf67ReGXU5h5IYy7c59Y642KcL1A9AJt0o1EHpfv5A==","signatures":[{"sig":"MEYCIQDNIlQlMB2ldibT/SCy41Lm1WNG/3oTq5DtkPo7H72GjQIhAIqk1DGde1P5SiuqeMgLiKEtHERV+lcwn0wYOL4e+qVd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJer+80CRA9TVsSAnZWagAAT9AP/A0xFjhEMYJu9emRw255\nPRmG/roOp0vqpDKEQCzu+OBtBNBVcTjOjwzMbhqBgM95rVScdDzMGMO6eYeW\nUig0akn7nZHwTKWAjTIKWvwuji6msYkN3fJAVLl2lE8rPPuU7VwfDMgdDgI2\nqdCLhcZjj/VRp2/q+NVgrk5gHW0BgLFA+gemo1vz4oY6B1Pn5fP3thH/ghap\nnVrqDRPK/qVx4lVabQ/qA4R9cg643P+d3NW/2HM1mMhH8/aJ9fAKU9zWIjmp\npYnzBHjK/VOehJp/OqMB30+jvS1rYBd3TOJtaXjiMigDKQmltREh4Uw8rtwH\nU+Ib+7yu1gnqTNIhHXNZ/HbahTsBZHHfZGPYksplprlar7GPUCEmhNH6r7SP\n6z1oa6TrPF2dzSyzdF15bKubyoYoAJbvAqxrgXhvVtJhAocU1OOqPHkxntG6\nEqlBnt2CZGykpxEyboEeIOWb9PDxddE7cKL+0Oeyzu45TA8tXYKtRxGErjI+\npj8kcyL1a0MPzZeWWgTvUZ7iyZipwUe27KuoJu9po05S+TYvAGFMd74Kugox\nKY/w87rgtekXeffO8W7hVBGkQMbv7FKDJJm6MEqVOQu1kWQs96X798zxsbmE\nB7vcaAzlcgY4+kSh8kiAD6fQ5l8ifmZGVar9niPr1H++KDeM22rxM68Pfjho\nmIiw\r\n=Yjv/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"8bf16f00b47ccdd6adc13a9444a08d8a1273d149","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"feature~remove_inversify","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"feature~remove_inversify","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-8bf16f-k9scgzz8_1588588340155_0.41635714580523797","host":"s3://npm-registry-packages"}},"1.0.0-feature-d57137-k9siik1a":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-d57137-k9siik1a","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-d57137-k9siik1a","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"f67df4c0390ea65f3d754407c63ff21626722735","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-d57137-k9siik1a.tgz","fileCount":79,"integrity":"sha512-yiK5pMslWvfmAfbOyxufUeH5Por0w2o6pj1HjNhCpJzzJRRLydxMP3ATVzH/Tm07J1zxX+OtZB1QEMHccQ0dcg==","signatures":[{"sig":"MEUCIQCGa5Bug1yqIhgY2mEPa4yjTtBJAuvOYZnRjbttrOvzHgIgd85b0RtQMf+jGgVdxyiS5tl6eenlqJ87ZTCpvLhYRtk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesBbaCRA9TVsSAnZWagAAENkP+wULZsjNMfiBv6BEOa0j\ndODxC8B3J+aoWUBToO3UC8DK1jyQVn6iNl7r69p2qO+GVMXk+DHxKfeXzX44\npFxmH/rHDzAQThChR9QB9/8s8KsZIi0eXrR5+hT2zkaA14+4ClkGSvqsAGox\nzRJnxYwFm1LApttwP0n7xBpMhaA4g0FLzwI9OhSJH7EM739xtIzytElNZmXh\nj4PzMoc+IFAEy6f+OCeKD1AXtZjvLTcNH3EvIiLBM3e7sj0N6k/pVYkApss+\n72VXzhAJtfnRSY4GYIXVANfxB9I/pAHl3PPFIzlIbMRYyd5e+3NoWoLYV5Vj\n/excZQDLIeTJxulamnnoDO/7XXqNaRypqtwrrKIfOgRGpUXdMTNvN2lwjeBx\nsX4Ye5FFy0c4opHBQlehtToPoqxfRhB/MzAQISZ6SfTAY2CbxuxBeGsNXryv\ngduHMRnBU2rpylilcrPCwpe1Eqp17g7aR9X3JpIenI3wkE6bOlkcsOzXAiDB\nTfjkScRs/Dk3yyIuboN46SGe7zWQSG4EGEiv25hw/dA3MYgqJaZVqQEgxxYE\nvIEaRQ4SmHOZB/YNJlw0zCvQ42FcLQjyeBCKyyzy+LwvWPD1wirCJQEz1e+i\nm9jrkDN2Pmw/+nDI9/R/nyolNx6Vh7oONxHPtSzZYlb/Qtav9Q9f1Lt3JacJ\n+agG\r\n=4Oef\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"d5713709c5498df71f52a864952b077687777690","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.10-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"1.0.8-alpha.1","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-d57137-k9siik1a_1588598489916_0.5150733006682737","host":"s3://npm-registry-packages"}},"1.0.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.11","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"15f6a41b2b7d52bfab9da461e7920aa1cc15ab5d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.11.tgz","fileCount":79,"integrity":"sha512-mIbggjLaRewtRzv5X3FMbVn1smxXS0itMbVwIx/PaEa2oZgg3hPhYKMPKOISdRqdSox4eIUVowXiOiF5TpQQsg==","signatures":[{"sig":"MEUCICYwi/JhvLEY/ZZ048xVrMPj5fgMz5Kz/RHZjgMtKcJnAiEAvdk64+A7gebzoUeT4ZY5/+eqbcinGluofBgRb0ZMlqg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesBejCRA9TVsSAnZWagAAHIIP/0GfKXwlThP0ZL3Tfcvu\nWNLOj3V/0sV7GzCK5ZYxbaBw2it/5YVEzuAsEyaf3L31rik3tkZSZ6/z8JGg\nuFUPbEBMd1DPRN2GQ6ADyrBZDsPsiDMXR7DBPBJh5iC+npAWmhA8IOxsOMJl\nV4NMwhbi3iDdgr1v6q4wy8BklBAUb1S+y648I41yjVQYg5zz2qlgCWq0fyEQ\nPuQQzEM5bKYste2RLi+DdHLuCN/T0+I6PyjMaUeaHwrY5Lv1auBax4RJ7HLd\n7QdgLgj4cRCaTFc+ldw8QCj24exwhEM2zIiav/FKEPWSckk4ebzaxbXCdStR\nVnUbcESLOD7NmD8jbgTKV2wUQn48JqemVQ67skBn5H1W41l8VfZuq9gqXIAa\n5uG6b/ksLkq9XHmDTgPWnmi4jB5kZi/77/3/Hrrqd27vpeJXScMniXPdxt1e\nduKjgdYjWQMv5LojSCg6MTRWLiXS62nckin45++DFTTwK9VFU15OaKjbWFIE\nrXdmhtPzEB7QsQiXIm6BQBf/PA9+4ybsIr02QJCvQWkEqDB0OaDiVKJMAluR\nXmNMS+usFFeXadrTtLHBwqUfxGFVailpIs4cfSJhxmC68emZpI5QpfzM9ziF\nbz6MPeZy+LNQ+btnqW252B/o3zz93Ef+b78O1IcX9mLKNf5ncKKDBM3hZvm3\nauVX\r\n=LTwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"f5484a2d5d238e3a235c23b2600373188f22b9cd","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"1.0.10-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/http_contracts":"1.0.8-alpha.1","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.11_1588598690648_0.30584867882626665","host":"s3://npm-registry-packages"}},"1.0.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"12d8fe0198cf823feba2ddb9ad46deae82fb8d7c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.5.tgz","fileCount":79,"integrity":"sha512-OnUpP6ALD7dk4Z7rexe9I3NFvxCcA8aSQEu27PWGFJhWSNpyvw27fM2MvbEBGuc9vFpSKzrIcRS4EbasO923+w==","signatures":[{"sig":"MEYCIQDqUrC+lSkQMxTQXB92AdRyjJc27oq9GC7D+txnqwyFbgIhAJc381J8sFXQFbal7ZIr5VowyzF+MgDbhDQAIb1VtqD2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn3gCRA9TVsSAnZWagAA9DsP/2uIe+Z0BqmwSyhKqSAK\nYPY11XyujuLrN8caqkyoMnuAK0Tiy4qcwuf49aCzS0vTUgd32WP7CLxqsuBe\n3tav2NadwXNlNVUitA/ljKoeVp8svqB82WOltU88VoaRwPOJSFHgddhestIm\nRladDmLYrbav9RUD4C1jH2H6u2p3Yo0wcbqdoGXmJ8sNpsi4oH8rt/Pe+25s\ns4Cyj3bVGkZ/+DPO0ZdLCDfBqj2Ja5aN4ZK3Wm+tS+Ix34yiS9VapzD60+cZ\nyX51U4Memi9YySn3aDBibl7bJsK6Sc/eMeUizCfLSDEXpAvTxbfybbIVqf4b\nCPojFHCOUSkw/Rs2xOHSVcmGMEIgBMQ7ksSKb0Z0ir3prdhbnRuX/cPbjEZr\nq17CKwd9UeKKoengs4w49Y2mhlfL55sdu9kd7hAr3YWC4kzU4oiSkEacF4dO\nAfVk+4VM9kM99z4TLdVSlGxX4lwCgJu8YJppHOfkjG30MrGLHZLs3tfG6kAf\n9f9DA0fHuYFXAflsK5KY32XxXzam6E9bxT2/O2dDfewpwls76dx1ZX4P+DlK\nAE/VOzyGcElEDB8eV1PUao9QpIpb03okVfi2H3fXMQ0yq/9qBXL5Za6QAzWL\nzHJwYpMXOONISUwaMUwYPp6Z+hhQ+WMj2Ng4Aks7jmxuRdjdAyJDGWCOZ/ij\na00B\r\n=Ip1N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"2c097854886e1920bbeafe24bdca5e4a708083b9","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.5_1588755936587_0.7415601751794669","host":"s3://npm-registry-packages"}},"1.0.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.12","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"836e61002e37025b4c125cdb6f0ae811856efac1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.12.tgz","fileCount":79,"integrity":"sha512-Ah8WPkzmjItzXbFzd13xJI/haH37VXZ1+VopYrVA3QN4fUxrtKyApn7M5V81boG+/u7kgCKooh76wYDs4xr8hA==","signatures":[{"sig":"MEUCIQDFJcZfHOXrQXt8TfK0VMi3yC7IqDhTglqTa2TogLjLfAIgcf0Y3dNBL8iQIXtv98vEvO6k+7TT/lCfWbIhYhPjf/I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn6bCRA9TVsSAnZWagAAXa8P/AqdbOmlzY7iauZHkr+d\nuicvmpNg271hmfv1VMVP2K0wypLINaiQhcqUbGZTctpcZ+OEEI37Ve3zusyK\nmOYK6hYsQZvbkLCOQAdzGiKtYC/aERymP1f0VrwhcM+LfvTV9xMRXEzvgZ9c\nhYGvlHxswAmNXo7f93VcGovbKlS6sZ2Zv54yl8jdZRIN1ahqbD8EyjU4IIwg\nOaUu4ieNv+1Hyri2Ph9D220orjsRYio1EHvB/0YIz4JBVyP7816jTcr/BL3k\nBC4dlZ6JPcXUUBA4gDEJR9VqFIZfBphs6WpArlth2XCxx5zAId/2N0DEL0Ys\n2lMk81BTkH4mUqHQQBt7xU672nIS9pxUjHXdZjRaXufSTB02rZabalYQV9oA\nXu8UlIvf6OHIGeweUNbJSr2Cu9OdLg6RIUukMmJwIyG7NzorvoLd70oktrRV\n7Ku4lIm6mQF5ljtZtWEc6iqJC0dDIVd/58C4hzN/sdl0WDSKFCPAU1rKEGyE\ndPpyQ9NLsFbWizNoE/4K68U7OiBLmsGk976hgt3/fkD+mVOCYzhY2rOk/mQ4\nYbgS8x0yOp+l218cU4lmLmY+/LT271d5AZJ2kAkm1toRCrm9QGFCahCXfH+k\n4Vl6nQ86piGp8TNhmgKKMhY5x6owlVLT1VqPuaPdrjhtti5W5QUJgSFERkbc\njjpH\r\n=D/JE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a5609d2cbd21b854602cd734542f644903255e73","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.12_1588756122612_0.24626142552824848","host":"s3://npm-registry-packages"}},"1.0.0-feature-a5609d-ka6eaisu":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-a5609d-ka6eaisu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-a5609d-ka6eaisu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/UserDomain.Client.Http#readme","bugs":{"url":"https://github.com/atlas-engine/UserDomain.Client.Http/issues"},"dist":{"shasum":"81ace252523332e6410dca3b4dbdd9c5c22e07d4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-a5609d-ka6eaisu.tgz","fileCount":79,"integrity":"sha512-gF/T/kczx145ukneV/xLdExRGYcJoeZWbp2xm/7QO8iqJmjZcJkJrrBO+pVCXufyNQErkACJVQef8Lnok0FpQQ==","signatures":[{"sig":"MEUCIGks7S0qyhUvCo/XhEOB1aHDYJ0ESPBiadNGuvRrT8NLAiEAoyaBcwhOBHQGYx/QSwEF9wv1TxA2/w5Na1hFZTfDn2g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevOXjCRA9TVsSAnZWagAASjoP/0SLYJ1iArcaMTKucbl0\nLxIQZVBWXMWiCfuY7+3FzQ/UNyZQzhYfoI5mHYl39T7rwu23xvpiEhlzNB1s\nX8ORhu79f8uFvHWu9sqyzbfIpd8OXIMAxow2M1YKMXcyufXM8q0dq0gWX8Fm\nmDHoQ1GG8RHlIy7cdpMy6MAkHRAr3ZfW3gkAbqd7gwU1Cpr8EqQo2Y8xkctu\nxMyX3rtlb/dgxMphykoJj8bNRmb7HJAmFqTRHR1p3HXGHif4gPumJX6Tg7yg\nbTaiBFkklFpJHCqb3/ZNL4ayopRHADXmZio0cLx0KHx7xykC1zyH1Jeq0uhu\n1VDfl+hn5VGB2Yp+Sl/ju1i/L9eG9i80j5uT2wNUuijfCcaf9o/ZxK9SzUJf\ngV7ssTI+06NiJcNUbkrYwf9gx47pcWt4ou70/j6s1+x1kfk6KDdDUbc7lgFs\nQderYu/WdSTwFCj0CdmwN6ZHI3wWdg3lbHKa5ajRUVBw/5QSPcH688bTb0Mr\nxw5a8nC5DI76MECYrWeYzDyj/wcR3ms22T9XJ3QviQuXJarThZtukWuNfeAu\n868T+GAl0N+m8nOVTxWxbe1gbV6Wq7b2RQMB0K82vc5ztlAiCK9DdMN455Cd\nn5rWLN345aRjtw3VyCeF6bl92bjGVvHukJ/rRrCOVpPTVqLDpfDit9KqOYCp\nNprz\r\n=30/m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a5609d2cbd21b854602cd734542f644903255e73","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/UserDomain.Client.Http.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the typescript client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/user_domain.contracts":"1.0.0-beta.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-a5609d-ka6eaisu_1589437923329_0.3939148324627846","host":"s3://npm-registry-packages"}},"1.0.0-feature-9fb734-ka6muf4c":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-9fb734-ka6muf4c","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-9fb734-ka6muf4c","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9f57f58d0381bcf0bcecb7c295bfb8d4ed1603cc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-9fb734-ka6muf4c.tgz","fileCount":93,"integrity":"sha512-j3h49OzDxok9IeaX6ogzcaaHzmqYd7K3C3T8SVuIj1+SEuu4xD6m7d1fKqS/+HqHjdVvVEJ4hWjPunrnGpshAA==","signatures":[{"sig":"MEQCIF6G/+evdiQQgbf7c+3T99Bpl9Nytse4JNJAHjJfd2jAAiBXSXLmHtkQIMqo60reQuuAas14D2DEgvqyYX3wwW9ZpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevR4ACRA9TVsSAnZWagAATt0QAIl6k6zHA0VKNhcMOEJG\nBEyViBBcn0PAlKpkziEbN/mamR5+6JxYYxaw/0Xw+bL2l8fvJS2oEyJzXkgl\nvSkliJqsOphfwsbKq7SjDSpTMmIf987YaaOQ1BbHH6dYqsCGHweiq7r0YkDC\n4HUrU81gPRO5CXvvTNzahJIdtO6yIUHufZRCW66WN+Oew+4mxRk60p0rDXV1\ndYNarlw8F0ESgXfnh7CKrfn60DlAS6qra/URN2fNB+LKHjd3c+ZG5s2V1H5K\nrS3sjmqP5RAELFTQh/krJub0NOflNoEn/z6f0YkQ/I21SO1cpjsezg//UjQ6\nS9PQ1tyHFpZ66fRkSjZE5F1vGafeYBGgS9oTV9HwlXcwpDWOyeSwR0eadX5/\nQjnHfTotJh29r3oHuRguRkKv3uY74VCONoj8n1ClJw8jEOdiy5c/axpajRlX\nl/EgB1M7NwHLwZsW262QqiI/B/jV1y5okAL/3qahbrY1liBrFNQhZn4GLMgD\nkOsLKEEQo/4GCy/9KMQm1cY6cg4XNXLEeRnHwtXan5WVNMg5LfIHqZv2XX0Q\neXjvIWK0yI9vTg3i4k1pZ5T8J4Ut8DCwU3nd+veHSU86Da/mG6WxqnDPL9XF\nIAGiW7eear2nBLItCYqLMmRR1Rs9j+D1o/fLrCVxfCRWCkD/77DHeqoivViu\n93Tw\r\n=/gJh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"9fb734d8ae02e75a94ea72de531e0c7ab0498bf0","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-9fb734-ka6muf4c_1589452287819_0.23919043271098905","host":"s3://npm-registry-packages"}},"1.0.0-feature-cf7872-ka6s4zw2":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-cf7872-ka6s4zw2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-cf7872-ka6s4zw2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2943e2d56f3ce0664a58ab5c9b88181255fb947b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-cf7872-ka6s4zw2.tgz","fileCount":93,"integrity":"sha512-qNV65jLkcQFjn9gBJrXXMJD9tSN68n79NJSdP+96O0288hH4GQfawlysrE4PtOVGEDZNRNRVTpdDkyG4znF+iQ==","signatures":[{"sig":"MEYCIQDt9SMk4LTozMT+PgV/xlEdA6Hg9lRF+iOCRdEB13yR2wIhAKNRmNcf57KkitL3WaFHlaGtuhY0EWHqN52k8N4J8Rli","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevUC9CRA9TVsSAnZWagAANMwQAJPDqqDXlq2v+jT0Mbyl\nCd+ryx5J69B4CMvmDcCrNx+ZcAuzjLV6A7eWST2R1hLW8W50DBJ+W56ATnYq\nQtaQZ6iC3Niz6xhqVcR9gZrExW4sr70bw1nXVum7iSKXIDZZnYXtiLlP2Ns9\nrnBhz1jznuiOcjPeUTF7Jx9cKCtqtkap6PXFSgNeXwn1OBdhbgIGnTpUNWAy\nuEDP/IGNHDYNLF1bFNIsBBDuzQswCwvqxgaUsSY/AQ5TeXOwHWLSWw+71YkD\nVMf7eN4zqfupGpiyBbx5lFGYrMkSmwlisBNqYFrnZNiCq9LBReckgjk8rtNN\nb2AvWkpEF3jrXKn3j0F/xseTfwR4c1/dbBrCMUQsE42LLFSpIROu6Ke2uduM\nu4q5cn5sNgOuck9IwT/2TsB/NiwVA9eEFLMURqXPoXN2aKlxC0y4VPSQoK2L\nWzxYDw1McrNAH/cF55ugXI1+Bjxt+Pc6Don+dGhoYlkTLyE0C9RUzlqTl978\neLWmUBAtor5JnnAdF7UA0kWWhqFgNO4kF11lUFxo+IsscP0fI7b3xUt8DDt/\neacasC3imEA9LlW4vR0LuBL1BXupMQvf2+4Q2A8NXsADexziO+GjCMdND1gT\np/5lKydpmQ1X8rSCj87weZ05P3+eytyJEzDn6qhosyZav4w+urXG2aNBEI/h\nO5Zz\r\n=peGV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"cf7872539f785893c8241ab380f7abcd69227406","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-cf7872-ka6s4zw2_1589461181200_0.9697867118052041","host":"s3://npm-registry-packages"}},"1.0.0-feature-ba0967-ka6spfwz":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-ba0967-ka6spfwz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-ba0967-ka6spfwz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df711d9d9b1571d1f45fdbd10af7f14bdf27d928","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-ba0967-ka6spfwz.tgz","fileCount":93,"integrity":"sha512-/d+cs+WInerunsoQoKJ9t83Loh5HZDehAHfjpKrW3rVrL7dG3MWIclUBW4LVW6vNp7BSFrJceShRwly0QFBypQ==","signatures":[{"sig":"MEUCIQDgMEoaK1KBA0TiTyrMc/I3D5xRqnbMqd40a0wMR1r8GQIgIuf3ZYH2dfRtbmrsjRbpIEFePZtDwaFrzdoMrebBZ6Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevUR2CRA9TVsSAnZWagAADLUP/izRpsUMsNDJT+4U/ptG\nhwcB2RNGbQg9EEy4Nkzhmx4oqIU8vgnEcChmXGxvlljelXAUPrX+wfEIw/BW\n/07wE/6cWTLh+PiywtXDS0hf79Faz1zI0viz1l4ZQuhXhkjsWrrDLEWhzO/M\nbnG6zDQbpOWGmPHbJ8D5uwDYlTjboshWO0xm5/9io+0LBFdTZz15HBIxwqtc\nGFogwnaNHW2cu3X6Xn0spzyZrAIpMalFa/LCX4/VHFusCiZuWRwBJk5Pk4QT\nH7pGNdCYTofX1d/0T6qzXP7QOKJ/Sp0sPpDAJagNjrasOix8hB49xUL11Rhu\nGGS/q/EnC9Xg4hI9vDpp6dmQ/zqbYt2R4o4y9O0XbyuDbfEPV9ZY3sUnRp93\ntW6xq3ZTXn3JCm04a4hULlvQ8UjmbygExGRacXoqeuz6+Na1QhIdh1F6Ue7e\nBV3jB+syf5QtoEOTXoHo7vSgQVGsB7Q/k8ltT/F76DXCJvJzrBFROC5z6E4C\nDzPOvhcGPlbklfMWM2NiY1ZZb7zxPhGehN1VUum15aUbEDYnlw1DjBsbwiMU\n9i2ZoRTpzVofAaeK2PZrNWqzG+P8/631J2RsVqW1HQi4ji6I1XMNbk3erEAx\n30N4kDAvq1HXh33yyR+9/4CNSamomQGbdOJ7E4v27oe1P1GaqdHb+FjlqdXv\nAC+N\r\n=7GAd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"ba0967594f21583ef7825e4b6bb19ea66782865e","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-ba0967-ka6spfwz_1589462134259_0.9760026700893703","host":"s3://npm-registry-packages"}},"1.0.0-feature-fdca2b-ka80w5go":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-fdca2b-ka80w5go","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-fdca2b-ka80w5go","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b09dda75af0e5e42df7d7c7f81c0f00c015e40d1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-fdca2b-ka80w5go.tgz","fileCount":93,"integrity":"sha512-YHhTsfroeoI2yjlJFHRWWYz6+9I8sM+8CiwPbNgDzvPYjqACAnh9WA7+GcwdR7O0vLYlIJmprnR0v7qfVProFw==","signatures":[{"sig":"MEUCIQCb7BfLM8Zg6TII38RbFLk3yplzhT+kB0HbFhklGZdwFAIgVMSt8fMusjKUdTnuHezIWqMz0056uRaImsxfkYdSmEI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevmZgCRA9TVsSAnZWagAARoYP/3DI8rWRUN6E2B982iQd\nX+d6BH3W/2UUw50T5eTB1xM/CSxaa2XPD33F3Ni0p9ym0CRgg77BLBQcEtre\nZC3GYslqyPkTaNrP1dt5yHgLyNJRsZff0vxb5sX60PZtyMLqFbvfcjcO9Pcs\nv0Tz9Svh1iTv5AlM/2G6vy/glLPGy9kLqCNRmiRx57aUzhkHk+nPa0UM4OvZ\n4essf5v/tc45FcNB3Nnp0v+yyW1ZBqY2b8+PBCA54uXbPMtXA1wGmLQ7LJ4m\nTdI3E6Bk31dxTEa4IRz3hx5fHL9AxW67E5JkSUFsepqXEmw1xFeJECS/S+3F\nxBHIdUvbcl6KqEQ29qINLt9qCLPXv0lwjjXQnDJeOzhoeSRQqm6fs6yB7kHs\nm4Yw/tul2PItrIOdWCcqVHhy4L/SV0k84cWI+Bjt8M+tHfv22xhRJAlR0V/V\nIUIxDAbiUP0t7WgJqGynKarbxOYO+XZTJAP0GrGgpgw28sLK+rbyIyyNob4y\nuMganadrzVQClt0Cyh3RaVnXWtoKGpXd/3iuOzwxOCQ84w71s9coBgzEbS9O\nHyY+9O7P4HIT++Oy6PI1TZU4O5ENnvp1VcJZ3dv0FjlijkAGb9cTT405Q1NN\nrWk8FvRsjvD+pvk+dePOK4XDbrB7LNONasrnBt7npirp9H3dy6trKw9ER+JF\n20dU\r\n=c5j3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {UserDomainHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new UserDomainHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"fdca2bcdebdce80b1a31fcbce3f091f34825f923","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-fdca2b-ka80w5go_1589536351815_0.0839546377766669","host":"s3://npm-registry-packages"}},"1.0.0-feature-f8a081-ka83om83":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-f8a081-ka83om83","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-f8a081-ka83om83","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3d09d8d449083aafaf6fe84602b2b80337909db8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-f8a081-ka83om83.tgz","fileCount":93,"integrity":"sha512-YoomMw9PgrIB1crNdfZMWdoVYC7IzNiyjpb0Ii0q36KuEzpwNflO9ZFt0csLOSIWXGQFZIV8dInk8ZIULIag9A==","signatures":[{"sig":"MEUCIQDb99HihfixyQV3YOA9TpXjTXIImToCmQvPU9mcM9uaowIgCGgOk5Q2Jt9a7o3ODfrA5bl16RNTW+tlZa2Dzn6vKoM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevniuCRA9TVsSAnZWagAA2asP+QHpKlRvAD12JmYm/QWt\nmcgSkjeHkHS7B3LhHUREKSph4mMQrIpYDZKKgrcMZEuvRNuvK+K0o1vFsMbT\nSEt06VmYCTlPDOsEYvBdilQ6/zIBtxzeBcLlbUBPPAvJnG2mMy6QuVCZHif/\nEfYiVeLZyvs3NpWkZZnbP9VvpxtXYnCAamJulU2nMMb9gEgGxGeO0SDWlOnu\nGUbz09dqj0xN/jJQwOu3KQEBqbnabCtGXP7BwkUFlJDYNGykRiKTRX6yWbCp\nhAVXT6SZnk+U2nesejbeKlU3lK/Jc0J+aeGwVuln/g6jO0O+yTPfnlGKlIT1\nqGpLjY/sQPdOBPlU+UvkCyhlLQSUb3dOVQTCumDsPf9fpVJWKXlGtOxs4ZdU\nlSeQIvMnpbN66efdt85+xTHMERrois3KKavgEONz1DvFoAhEcooiI9gkBrlt\nsPSRHU5q7Y5TJumjSe0+QXQo3AUsTnrihutiOV4pL0s7PDEwjKgtj3GPrtlc\n6YAhnX7L5O64RqDD84YzLdzkj+IG91zCYm9emme3B5ehu5poiDVQIWyX8UJr\nqyKLxP6a7+kuBa2fU/WL3iS+Y6jPCROpXR0eJpC95wlSO4eKn9A/7pjOZjnY\nEKCFiRTR3lMMNdjpNvC44u2a+w3gTr7qUtaXSwJNFzvfASWsbTozpVH+GAwA\n+VCx\r\n=zXzT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"f8a081c94814e33bd434c38b3d9758ca356076c2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-f8a081-ka83om83_1589541038274_0.9015695260011505","host":"s3://npm-registry-packages"}},"1.0.0-feature-f8a081-ka83se29":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-f8a081-ka83se29","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-f8a081-ka83se29","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7375ea3e32acb87a87ca8af6b561a9941999c0ba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-f8a081-ka83se29.tgz","fileCount":93,"integrity":"sha512-gOouUpL95Bg2qZU/JKL739NnYM0BcYoJ2aGUEQWRtqz93Up8ojz9iZqiBu7Fska5klfePrf/Ej0twwW9IWK9nQ==","signatures":[{"sig":"MEYCIQDb/+h1omOiFV5D8uz77KbB8f+9JFx3wNBpTWbvI2z3hAIhAOEw4QORpR4O4xtAMm9WrwbR5DVn+SMgjQo5KiIIa+3y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevnlfCRA9TVsSAnZWagAAFO4P+wY5XJULiEKSsDpyehGN\nThTH15hcYZycmtY7BnjhX1Awmod3RjTKbqx+FsgUK7qoPomSaAJuNHmIVoQ9\n4yFbcdUDQCwhxm2dPbbWQKFBFDj3LqATzPOmcPl0wkQ+3GyCkNlzrX/bEA7I\nh7BiSpgQ/6NbCs7olcWfuKRJzoJ+ksiDDepb95vU8qD7823GekarOdpwRYxP\nhOQEyCJu1OoPCvAveW00kUuIXEejoUpgypxttgdI7Y0pXbULFdqn7vGVYOIr\nk71LJdSdHyso3LKA3k4A82l2nepTlAbuiah7r/+FSdhtuQY2TGUk03kyUfhd\nZ+yegLUyiA7zruPidv8whyB+7Vtf+zMkX9dbLXaH5RPqzQqq2WCpp2i02fuE\nPFeKDqkxdu8wXD8waznxak+0Ao1gZIjex2UKYVFkizFToMoJDKzM9vXV0blD\nWj1DMryYZDc0wHAjDkBFdbEGQALKF+/j/7om0jN18fPdrmcMkYZq0GdUhlHL\n2BeqBkCWIvx670GCr2OdRZh/VcZpughrL1Ri4uIzXK9v6qskOxVSLqQhOSmy\nJGW57JDUWibdrxOdm3awgxehelYiMFm8FY1AB+R0peDyLkzjQBhyLXGIzEW0\nrotw3JG48LoPhS3WznCIV3IMdKK+OYriUGLICILTMSZ2A0wmKTJl4GC4NITo\nrqXB\r\n=AYYL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"f8a081c94814e33bd434c38b3d9758ca356076c2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-f8a081-ka83se29_1589541214867_0.42232120601152334","host":"s3://npm-registry-packages"}},"1.0.0-feature-08ef84-kacihp9g":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-08ef84-kacihp9g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-08ef84-kacihp9g","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8161532332e7fff18fbcea9341600f3b5a5440e1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-08ef84-kacihp9g.tgz","fileCount":93,"integrity":"sha512-ZsiIbwDAGyZ91fUYuhbOq2S2wMKTvfqUpeZRSzk52b59ofGPP30+G7cJYhKmE6l88Cfcf+eoPYou1p+LBJmw0g==","signatures":[{"sig":"MEQCIHxDKCD74tR+5X0/cqKlylBOS02AksjgX3MgVE+GwPclAiBsuCglWRRtCaCrLq2IrFfcD4vPvshOYUpl+99IaHL+kA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewoqiCRA9TVsSAnZWagAA7oQQAJLD4wbychPWDG9ebgDY\n5edjdmGesA/1gYQ60Sdn8rHoPsKq9wHk2Adb06epQgaku1bM5wYsao37CHmE\nuFL/Cw0w6izskb8eHcPYWZtFcW0k5Kv0vr4uNH6NJg05j5ZifT48OrmsOTLk\n07PUxX9kx8ZZe5kRJUlUk7w+FeH8l+jMM+OWK461pScQGm71GbNyuQKQ6FuA\nvPEpbK8PWF2U9vhG+eDxoKGAnS2JR4/QYXSlQGwFDxivwG0GcgAN+lypw5wh\nozM3t07/iVOOGsrDHWzQGIfl0j5eK62rFiHxXTCiUg4rgoypghFBRFg0jfCl\nLVJtSFeBsjTHtbQUwwu2hrLPxcQkCr7rNSdeoL5LXrZgQK3wTUIC1I+zXg8F\nGdNIApURx46uH2mfJG9+z0ZDwMZMKqeYjSmXTKuTIY6CEphY40+azcZu+MDV\nIoaECngA5YwbmVUGirpaiXsDjKg7Q2Q7wM29wjkvuIrcFLDmYqUFHBYIzZ3N\nYb9BDo956lMQBRSQF6eInwEWrfxFFOBQkpkIUEXTwRJkTYfbtAiWrFt5YMJr\nYrH/eFmsfKEYc6diLCA4fmItnxn2mfLihyKD8tvsbUrzgnsjXcyPpRCwJ0mu\nO9Jej2Qt3yyzr7jQ6tOydENuVxg7BniMyIDUIsQDIQ5NWubJL6FCSxrJwOb0\nOPBf\r\n=Omqc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"08ef84bb1a064368268f8f98c7bd81a5a3221b92","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-08ef84-kacihp9g_1589807777791_0.0583541807767074","host":"s3://npm-registry-packages"}},"1.0.0-feature-5af654-kack573v":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-5af654-kack573v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-5af654-kack573v","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"da508399ee1299c89db177a7a123eafcc890c98b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-5af654-kack573v.tgz","fileCount":93,"integrity":"sha512-oE2zviTHRS06kV7LXSpauz4PBKQxUhX6tMIxfpLgXKCcVgf27gaIwq9Fm0OwhZiUxoycHExuMTpvJs7W4/hZxQ==","signatures":[{"sig":"MEYCIQCjXauZbHu+CsmkyRwZco8zSepaXKvvfRtx8Gm6JNwReQIhAPUDseoxIfzyzGC9CSXjhS/nMuK9srSCJ6CIY+yDSvrz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":249524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewpV4CRA9TVsSAnZWagAA65cP/0xNgBaYeH+IocfQ/s8b\nYhes1+xCSTR8g1JKDJ7IdApImPy6cysHPlDx6C2D6Uh5Qn1o11bs/wsSDA0A\nVsdaoG59W9BZrrwYWZINu9wgt+2/S/Qtz1qXNgbAhgDNdbzhohyUWji6MJrt\nOcQJ92+qrbEVao+8iocJWpDC1kggdcqHou8BRos9xJBXjhmy1Ww41MJ8xQwP\nH9N4IROR+blfEpOEz430t0Z2F1+L6z5+CIDTz1OtTUw9LNmFstXCrR1Jm6Xy\nyNpGtxyoHi2J2gJ2z/qak/5COxRZYTTP06RZ9tvXaRiwgB9+LLaVh+qbkScL\nUus/AGizpt08r29CPmmwRykqTDXGiMlK8L4iPykShiOzfOqRpLOVZySZ8sF+\n51U2hcj1viW7+rX2376TuEPQbZcHPY0NbtG2Il+ui4IdVwsSUICgRDZWb5SF\nfv8S3RtuS7BXyYSXyB5OrGaMlGe60AjKOP5OunTJWFDnsSOGAn7zE7/0xOIc\nnnNtroy/peMjKfgA7gAV+5IzZ1D4lLfTUQUlRxYaYQD0kvhpJAFF0TP8qNaC\nTUHC58nVUwdOS+Sx2VxEIpII2ncOJutO4jOWWInJqcU4s3nc0jaiYP/9A4HK\nLLM8l/bU+qRLt1d5OnohF1saH2FKklg538PczH911LsKxxfuqnGZorWGPd5d\nZG++\r\n=sgi8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"5af654ff9f2742f90775ae1f5bb0d21c742201c5","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-5af654-kack573v_1589810551826_0.05685818056586056","host":"s3://npm-registry-packages"}},"1.0.0-feature-24fd4e-kackau3v":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-24fd4e-kackau3v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-24fd4e-kackau3v","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f5252a67e63e45c32b998f43a123ad9b887f760a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-24fd4e-kackau3v.tgz","fileCount":93,"integrity":"sha512-cwUYuNUks9bN7JrK/pzTm/zWnQ+Hl21B1kSG1CVVsuCMZT834E1WnLfgwvENcZItz3POVVJ0rggl6I0vNFdppA==","signatures":[{"sig":"MEYCIQCaiB/6uA+rtxJehGM165IuauFRsYSu7ti82HHusgZh4wIhAKNRYIZlEs4ejCTtEowvrOa9dmjHASJOcCZiU773uYfR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":249502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewpZ+CRA9TVsSAnZWagAABOsQAJKNvA5dEXG6bkBnOw3X\nks5URIeTWWFkQrhdHeZBOcBz15frcC7oZFEUgNCzaAPZ+vvOrr8U3A8Jui9g\nVvJExq0hmVPn3OXSG+7XwcxLM+HP+K0YwoOstw/FIJtW5VgG392OIp3OFgKn\nhP3J3T8KVp1hNcIFi+JpnPV3fiCSuCx/6lSnQZ4U98dl1LzVR/gY/U0bm0M5\n6Vrxmv8YbqTS27Fqnnxc/JMqfvQJXxQZXPRynBu9YKFUZA+wj8n4eXmmXxju\nlJmdWeZZjBb7dCN96DP64FYZrGM01P5XSwdgNhS7mYAuLODb4nwCb+CYLhtR\nYFUG9ZieoUFtHXXWmDVssfb9uk6yiIcC7zinX8Cs7BbLsvdIMvgoeLWo50Kr\nvnD/7jvvl8t+UH7i2lUZ3rwSPQB1KaZnszYBrO+IBz7KYYMnnGPY8ZrQSxq/\nMX3n1IumTROBJqsD0igTZD0fyfmUMVBbABPbafegCPkwHY1uJUC8PdoMztU1\n91no9y15rqqsSvqSVD9I25Q6IuJtRV5ATdL7xPuAhc5gPJZRJy28p9fgC7d1\ni7oXVVz/S7viaz11sxLAgyurEVnpxf46sy84jf7eWE7JYdM2HCDajOoIk8rc\nuwIWpal54hQwxa5VBpzoPSVezsa7tW/oODNZC4LkbFOMEI1SqBXd1E+FAM1Y\n7yhb\r\n=pSZW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"24fd4e7af3d745f403db4b39efcaf89a5f1c36b8","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~refactor_to_atlas_engine_api","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-24fd4e-kackau3v_1589810813986_0.6688258897272161","host":"s3://npm-registry-packages"}},"1.0.0-feature-d1a6a3-kacllkus":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-d1a6a3-kacllkus","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-d1a6a3-kacllkus","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4819a3e3cfafc93e85d8e6a3728fe0c0eb26f4f6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-d1a6a3-kacllkus.tgz","fileCount":93,"integrity":"sha512-NLZTJOXl+Vk+HXD2GaKiXX/dpZqFm+G02CKM0+pALxFB0tfP3jNjDngqamMwcbARyziHDyRsA5Z99YD2bGGZ4w==","signatures":[{"sig":"MEYCIQDULZ/wUVJI8+e8I+GR7NOq+OZFHwvlhkfnnDkJkY8qawIhALHuzaJRabhu3he+emKon9Gm2r6RnQ/Q5Ooz0XXcHneP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":249479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewp8ECRA9TVsSAnZWagAAs0YP/0GvMyiAhczl//WaubqX\nWtPoaWqly1COdlfdEAXiWlZqTVq3pHKWT087+GjjRunk1HkjWm0TDEZIQJrn\n+8spVmll8fCG52nx7uZN7uLcFwjTG5ubALGXtvL0lxJ3vSRBZtAGTkJGxbVD\nGkgfVavs4u0BcXFeD8xiD+7Hzap+J2eTbFYp21V/G5e8KEMMYXGJHsvOThyz\nnb5G9NIYYed1dQ7PTfrFzNpJR6fpJAQEtomBl5KUYJxWRd5IIlu/PoZPOD9W\n0t3vxINh1C2hPWrnN94rjO/YpJTt8q5qYQYwmLSma89wFhRf60tM9RPv8BFl\naxB4n86o5/0NXs24K1GW378bAXRjjBAwXdzsG6sOugumgstSrxnP6GLGd1zH\nx7LuXf+VcVSfzCtO6GDwk2S2e+fZqH79hqX4Ub/fsT8671qHuTtN9zV90Cs4\npL00csTzDPl7ITyIainoA2U5kC3zm2tRiPNrIieuk2TT7m/gmHs0o5VjKamD\nH+jGi9K3d/y1p/KYRXNO1Z0rzGqvkx832X1BD9W06LacB8rvJglpmy34utQw\nNtHMVBwJhVNU64mND1VVz6knyQTtAOX5I/VvNq34ANtoZSC5gD1h1Hdwypd5\nFPW/qG94iNRbUjqqP8tz9LGOtJk1FNJZg6HHpprsZsylsqUtGzlkAlvJyRt3\nN3sA\r\n=xmVr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"d1a6a3a566500c13eed33a3c83d412f94ace26a5","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-d1a6a3-kacllkus_1589812996002_0.47959831549862963","host":"s3://npm-registry-packages"}},"1.0.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.13","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6c3fdaadc79213881468433de7ecf682d28438bb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.13.tgz","fileCount":93,"integrity":"sha512-6eSWFcWPOKHxtKi2cqCTua2eZey3AoknjhFRAFFKjuR6usVDhTWIdV06iDgftgPAefqPxJ9AShYwnMVbbQRKeA==","signatures":[{"sig":"MEUCIQDcuWnEfUT2ymf+zR+9GrkMZbbh1Wvb5wUdatPriqS0agIgVj1NslZ5M3vgJVUy4+Z4Cmf05J9kjhRdxpSR6PnAbkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":249464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewp+BCRA9TVsSAnZWagAASBEP/1HqocmOB19waAxzN68T\nKKOpRlV6yQCzHR2Mqy3w1zb3YB7IOLPUqXln+fBlgDp9YNyPyh9lVhmDTZfB\n47eCjfiDZNyRd7PQ6Kmwdo8wo0CIZIUYFfe0v5PKvQDBDSvRHYRrJ+/suOaZ\ntQfPd20bZmxpodBUa9AfShSit9MVmHqd8s0/tgVIo1iAqY8B9UlBoLqbfvz0\nFn5U6svxYswoAD6CdxzOpWRhCQbp+AWOf6ZAP02x8/6JN3/wJXptZDhhXP+y\nuzIqaopMsTl6DAtXotMp05kuPsBp57HvkK1vp/jtC+tk/LSRsLLwdY1A7IFu\nvdr17qYEdUuqbdyvS0E+ZvBi0IJvVojiFm9Vr5FKxuhnlSKWuhoxDMD4OMT/\nYTtWDthbab2v5dJcI5ynRNQHKkILwJydfsSBH4ekiY5srtMS6Gl/lk5QOLCp\njVLB1ceV/6GZoCavYEpPpo/0daAkY80QNlNjQpsgsIjDTt+by9mhToeX9lx/\nTfjJPp1Aelkcdkwgsmv2j+cVq0JVKFKhqt+338ZPj/r4DNwh2XmY4edANatj\nuOQUXtwjcmHcO0bXWuV0bN/H6EyHCBTQ7AWkb7Jq6B/4BHtcAM+riPc+vBcI\nGIYTnCW9B3qZB4pjLBVz1UgVZ1K2PfIGYQMQp2T0jAq+SX0ZO0VD+NV11DLP\nSfcp\r\n=vLr7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"30326c7070b31722937bf11f81104c71c3b2d8ff","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.13_1589813121052_0.13595948134884273","host":"s3://npm-registry-packages"}},"1.0.0-feature-30326c-kadoduu9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-30326c-kadoduu9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-30326c-kadoduu9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6911d3db553d3ec6d33f5995fd45c2550e2cdd78","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-30326c-kadoduu9.tgz","fileCount":93,"integrity":"sha512-zj4J7JllRTG9MayfzQaktrgBCt1zZPueYe2E8cXUTCFCKPWj49AcpWjZKEW03J4TVo2SBEg9aIHWbtsiVZEW3A==","signatures":[{"sig":"MEYCIQDDXVHToWugQQNE2o1CKOaoiHgmV1TRnzkeENBBWqBNzgIhALMPIDr1Z4iuHbEKNsT2JJf58cLcW2i7ZM4jMmk7q4i8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":249479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew519CRA9TVsSAnZWagAATZcP/jssVLj+lE2Vi0NU+UU5\n0+2WcQxYtCr0Q7aQWcyjB4nnMtFL+7Mk2tK+fdyScx1YFShDRU3FH6SkZSuO\nOC2wKKqWmFUSmP6OTcnA56uSb6KWkwAgcmk/QbOsWHuni7rffW4T+3JAlA9q\n6OzKtsF67uVihdTA/i9mYkEfqP0UJPWsfYDekBiDgaUtkvmfqa4+9IfPinsw\nTOhsNdcGyS6+y6OuuI4deV1mkkKxe/zHDgvdDLtX+uEv9MZcMPFzO2Atgz9S\nmqhJIdfid0KaTEPFmqlI/NVm8rqL0OHDH+U88XSVcUqSkHU6EsXoRFgDAw3T\nC/x6jfQ6wibedjg24xcQQetAv+uzMnANxtX2N56vMh6TaLsCW8SirVbMYS42\nbHB5k7RYiTYx6TTbK6KUDIT5ERb4NSx1bkuOwFFPwHdMfEYQJmLDZNdK5/PW\n3m47l9whdRN3xr/pQRQDEMNoX60mvXVCRqIgLXXJrBNL5lwPvKL/lUgCy2bW\nPayZm0P7/VSawXegWATREdM6Atnla2dMj1x1SCz9DOXpO6pVfjZr+fnpNVAT\n2cQAOh3cp3sypmF47KH4YJLMD/KS01FdKiw+/+YpxYGg8sn4/yn8xD6E2uiu\nJszOod/7EtmUMgWSZbVhaNs4Mqt1aCkBIzerS91nzzv8ZLnDNs41wbtSkrUW\n+iZM\r\n=aJZS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"30326c7070b31722937bf11f81104c71c3b2d8ff","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-30326c-kadoduu9_1589878140455_0.2764128000071555","host":"s3://npm-registry-packages"}},"1.0.0-feature-c5a39c-kadzsncz":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-c5a39c-kadzsncz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-c5a39c-kadzsncz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"95c53d073c06d86cce58c306b1d0f9a807693b0a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-c5a39c-kadzsncz.tgz","fileCount":93,"integrity":"sha512-pLJgpl0zAaEStz61pq/7hOTZWiZm+N59ExykFYvkVnPfOQo16bx+sk0JuVgWZINJUlVUcE9dOJMDOQEqlvsbsA==","signatures":[{"sig":"MEUCIQD4gEbnnWOe9ehVkW7cwv6dbGBxj6k9xT81QG6n0MqEegIgLbNFllLj3C/AOcdcQQKVcmOPlColvHe1KmIIrr2ztko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew+haCRA9TVsSAnZWagAApX0P+gLS9WycS96e/W5IhOkf\n0Q+gT0s0RGYUSJGmdaijsi/Pl+dnRo4v7iFNlsMXM1yFCVG9GTZ3yFw6oIKy\nt6ebYu8lo5vaQ/38GH9g1pVHbvHigYVTpU341J+wJ9+IpoZ5durK1TstjwR4\nYakQZW8fbKCkJLkQEbKjI6CtSdkOLA97st0ufIDmTKJoKKUfmwdW3AEzwNoH\nu0r7sSaVT3bN9DphkbtVopVkIiBynBJ9LCg1UhaLWTzHtY53DUpNs1zjHfjB\nAQ6w+3xQGDYlibNgjlhNDLaMckiFfMYrh2n81FC8fpUPXT0WSHYX2fubjzmf\nr/M4IZGN6tWOMKs58BiyFWjsqSJRyyzR+dbTvmbVSFXbJHdVkkzMTDggw+ae\nqJy6BEndJ2gIHV85dgz4351X1jy3+4MwX8aRQJl66mhcH47fo7qoulpbA9Rv\n13cIvlw+Kc1XenTAHH5Yjnjcu8ZlaFPc43Xwm265+TD5PX2gaIBZGb/VGGK6\nnGutcj1+Xe7kVT5P1Gel1GsF1NPBhtwkitFnQiPuB6LsnlHlv+XxzYejYXxU\nNrhbol6QqZQW/8Nk0rzHh507yuBhMWDt7lpFZoeH1ZrddRzbIKp+/Os55lAZ\nDq7YAVa4Fl024coYvkKjaJFsVL9YSRx5hA4uf2j5sm9P7+3vfFQdeJ11Qee4\noUPH\r\n=qZQz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"c5a39c2bc65e65b9c99c724a8faf67ae4a487e85","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~send_message_to_process_instance","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-c5a39c-kadzsncz_1589897305985_0.4300946594844395","host":"s3://npm-registry-packages"}},"1.0.0-feature-1ec9fa-kaezbhnm":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1ec9fa-kaezbhnm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1ec9fa-kaezbhnm","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d96c404882701bba322012a8cb175fc1b544a9c4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1ec9fa-kaezbhnm.tgz","fileCount":93,"integrity":"sha512-1zmNGsOuYQTmU8zVmTaDNQeFIUzVIW+v/8SBxHp9ctQiBftgxvySdCf8JI9ccqjcXozcdKM0KiZUy5JdJsFqPg==","signatures":[{"sig":"MEYCIQCtBLm5PPG4lmKTmSTxVLal88efSrnOZM5O/h+rKo3NZAIhAMIpFHvGwjAb7rfboLSiccxL6d/QEuZSLKg3Qtnpgg8F","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexNFpCRA9TVsSAnZWagAA7fYP/2pcs5KOx77NsPz8mop5\nz9jg9bnwfRNqNw3n9ql1W09nV4KCVbtx6ImWhBbVPqbRn139DXFPN6FaOaEA\nXneJ8IYMZkkd3LUQnh0GiN+Yx89Hx34JKGpLIZZBRtZ2paEq/fWzLSG2RRMj\nWulhB6OzRXT80xKCCGD6a971B8IgcnocfUtJITkJH/Ve2FKHRte+mytdbepS\nF96NJQ2abLZOTYD5vp/NPR8DQ92kk42PIoxf/HiD618xlFld8tTua+zzgVf+\n5f5SCPm2cj30HWT9vA36mzzHL8i4B0lqiF6UNEfr8i8z83/2LQOAWJpbdaEC\nJL/P6vjOLS/3/k7hefvyc+HZdtzN0kDEBs/FddUbQEyL5Qw70oYFXEy/TMad\nkBE3odA+uo85dGJ/RADjPaiMnHx1IwsPQxZtGcIoqn5naBxnNIOv+ZWt3jYk\nBw+pnM2bRU1NE/xhIwusMbDr6ARx/9y3IGQktYwN8dkDrcsaZpvUxEUGFPE9\nBv32OWqnvNDxErj0ykxQbiPAaD3eGCYdW/esdbFpRtNt9DM2geP6IVkUnpFQ\n0ELZh6Bl+w/NtXTfd3M0LjtZdrhbvUkI9TY7n94ODlsDqOGCBHVTr7XpAdQe\nluNMmhUp7+g9ZjvEt88SnUI22aw0WMsvxXb4mYJX7TukLx0lqWPA6dPKWzVU\nR7Gp\r\n=loRb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"1ec9fabd28f575a34f5a5b687a33dc389ac98424","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.9","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1ec9fa-kaezbhnm_1589956969373_0.8559687657454849","host":"s3://npm-registry-packages"}},"1.0.0-alpha.14":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.14","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a05f5bc2d6d707abeb2ca4bd075c3c8bc71a7e2d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.14.tgz","fileCount":93,"integrity":"sha512-JhsuAncy1PA2+OO1dRDk8bEtEgPsJGyuJSO0BzBOG2xGWfBomb0IZjjJZfkcvslvqlzAQilQDZsFeSTfP4BdBA==","signatures":[{"sig":"MEYCIQDeFNDY3anEGEyC9iLF92foFvHTUgfzvd7/msJEM3AdXwIhAMI0AlsHTf54bBr9roZ4e8IckZg6gRs7a1QN0w9RT10i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexNJECRA9TVsSAnZWagAAkpMQAI64Zr01xeMraUDA1R7e\nAcJhvzS66pBp+K08nMgi2qElBQt8Or9Uh077VcyYWJMpsQJJM81I1HyymKgg\ngRY8RIARKJgOon05pFboPfa0tP4ZtrvuLyTObiuacgaIsOluI8314rKaHUpd\n93Bep03AfNpo/LJvxckHpsPvFs3o5Tn+0kY2D07AF3CSVIlIAHBCwYmbR0NH\nstXBMw7nl8BEz5ytUF5xfSxR01cXueZPfHi1X+2Cs7yetAp1gm1SOhGVLiTd\nPuKL5xjKP0pVnEo0ucyU8pdWNJEjsv3LyLMmvzmaqPt/bDZVeeNP6FkqvVZS\n4c/k+BJP8kTK94lmxIzADf6hVLSr75LCbd1Zd2pRAideMmbERTGp3PwGrSCT\niFpYzZco0UEbAsgtPwaEwikFpJDs1cY1tJtkDfbzTV1rYGXAx+SQcVPwzNPu\naBVbhfG3YW2DO/fJCg1Wm43GjfZzgBHh8tZclOub9ZxxdDtZ22yoOErwtUd4\nlmCHMsqI+el+wTwsVG8xd+nYxYVKWtVStdFOXyZuy/xxxWSf91ZXEQ4UQxbU\nxxy73YckYUCQ/56lnplDVAfUv4hQbvh+YqGfSvZAnDmlekrIydZKsmdqW0yY\n1u7lHDjhof7oZLMrNWx9SWzlqbGFm5Gnh99Dq/NFBC0a6izq79DCNjN3q0yV\n2nlx\r\n=cIUW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"65e0753584072ed05bca1c94d357dd21ef4d3d4d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.9","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.14_1589957187656_0.48756992802440946","host":"s3://npm-registry-packages"}},"1.0.0-beta.6":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c0d3359e279cdebe06defec0d6e9fd8dcd56beb3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.6.tgz","fileCount":93,"integrity":"sha512-EqfdqSLN3QpXWX5Ts6bGav90B/b6lV5kTt6pXZEhCrZLrSnYBzLUFAt77LoSAixBVyk9D+2U6ExGO6peQYr/wQ==","signatures":[{"sig":"MEQCIGRCL/Wi8dVo+3kRo/qi/dc2ye/TabTXwRFWulrWGCfWAiBGluVDTkvzkKFGFJV/EjDUoSw3RIZe8uOd2fF5i0Hsmw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexPhFCRA9TVsSAnZWagAAgB0P/0Pt1QWzZIFYGUhv9mN1\nZss5eG0QwQisXzCNUaexTyhobDDV9elLTEAKEVXXwhwYLr9RrtO3yqo64Am9\n0wSOswQRrGPY/pl095iDzAKUSSCuZlBDV9StsL52IwcBD5P1SqMT1Xs9zLyA\nsyk9ZfPBmBxO9h2CJAFv7nC/xoEZ9e03DyzjmrS9oI1/LclF4P6Ym7kIw6tw\n+nqsmsLonn53JhftTZHOJtkd1bVWWQygr9eTUGfmidjHLy6lEUK7q0GLJRCz\nJiAqNBjAAOmCGS/h9Yk3aP8R3lQOGNfdd/Gkcwwq3v5CLrw1sYnSkxlFLhjN\ncqDlB/7uYeIXcobgThRfu3RV8hw+JFarXnayng7DA1k31VulOnxD3wX4yWSA\nBai1MaHfF4LbcAv1jHUkikQn0TXlcN8nr5VZACz6s1mcwGe9pfIlajxmsVI0\nLPkadeCyzbslOIHUvNuam7YyDnXn1/Y1s2XmbuPCsmxAm0gFu3ymQaGvZ5mP\nq75rIxNiyaSGO7fxMbQ87uGKTKwjMW+v7lZYoxO0zYRCc9wd3JoTjATaLumf\nJVCsqsd24uluvN3uac4uiAnijW+qRuMzv7hN03a/c6WRc2WKGri+FaBrKDP6\n4/dsRBkD7BuOaPXr1lXCLwaj6Qvi+4EYRPeHvuoEqo+hgr6OtIzXrrFSNth0\ncf+G\r\n=h6Hc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"4dbaf069dc54885a11e6b1a67b33123e9ee35afe","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.4","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.6_1589966916570_0.34361577084106254","host":"s3://npm-registry-packages"}},"1.0.0-alpha.15":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.15","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.15","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0559c09244ad15597a471e632721e9fe80595284","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.15.tgz","fileCount":93,"integrity":"sha512-kZQ7Cg7eKPxclpH4jPv54dSVB8kCzR+9GS8eeG/RXPTyzKltEDdVIGeHM6hldEpZmezQIcu6ygT9u2v/ntADHQ==","signatures":[{"sig":"MEYCIQDGnc33kgc/LG9E4eqCS541zXhB81CzSD0oWTz2/WONHwIhAImxFpbcMnJKIWnhQw3PHeQhBRRZFQ9CrLamGTosd9EB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexPkMCRA9TVsSAnZWagAAXFoP/jzdxdMQqR9r+HqSrYvj\nEXzNOzG9Hb7j6g6+HVUWbLrP9+4dMJAq6lGZpPPhB19pQM8TQS91nBZJ/eWr\n0p/5LygMx4+WsQQ+vI5STWvWUAXLS5Z7DvOApWo+iUjwutMG1WK5dDXetvqB\noQSgMFelITlmoRbNtyEUsI4nAtLWyPJnDkFKvswok+3V7rMQZYzXFjP9MZ/W\nP4QXtAeanEJgTjYqUL/s1a2gaWbYql5LC/3zZBb6SzrFCgZk5NniYvZLAyEE\nVmL7DAOtYlvQRJChzd0nwp53gWvrSpZvYR2T7y8cqgg/kwROjVDV+C/9Qxzr\nwZhx7JHCsGIFybkQlRSfg5QPFbhRRIL4/1etsuouKRtuXtE5Upk1+ib+4dI9\nwGFTCaM269Ju5mX50H1b5Sls2PabbyTsTJ4i5gCYlCZJZF7/lq3Gv3WSZJ8/\nMJU3JtI/jaxdIhwfbHkJl+Td3kOps6QlXf2VgnPI76YMPpFLRS31/HwBGw4n\nkO5xAzlfbd2DR+K7uCg1URqhdKp3akkXV1jvVvwtu0BiSFjrWq2Y4bcqccvh\n4rq+6+YgfGpGIrRPpKuAyrff8Uy669Uc8fLd/kK33eLVWE/kV0OGu2aShpiL\nikDmQAaHPFqefnEmbqF4BipjESpKQo9YiJFjCslx7XzNS7sLGYtPiCDNaGvo\nZNj/\r\n=ouWB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"c86b35cc75579b1bbdfa329cba14a0046baede2c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.4","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.15_1589967116099_0.29554499747949636","host":"s3://npm-registry-packages"}},"1.0.0-feature-d53efd-kaqtu7he":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-d53efd-kaqtu7he","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-d53efd-kaqtu7he","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"185ff943db2b68267b7744d26759150e8b7ff2b6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-d53efd-kaqtu7he.tgz","fileCount":93,"integrity":"sha512-+yH9B6UGEGQiYywLd/i+CMEM1o2OWS0WtL4dZ3O3pjxKSvxTsosSJW02BaDsCxnuTq93SvhcHA7uPOjnziqD3g==","signatures":[{"sig":"MEUCIQDyK4qxdeMnWyJb9NuT3zHNdKsMTyDne4CnPnWc/VGgaAIgKjLLwqcxAVu7z4hecEtaWf/riPdxEpQ+82iGRKN0PAo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJez7/SCRA9TVsSAnZWagAAWuQQAJr+I91xJIiu+HNIUYKq\nf9b70rCxBNj5UFtt3c6JmIc5gk0TBTmYScnSgJBzFUP24c7lhfebzhwGyLx6\n3hMHGsh5npzWE2aEfjqWfiA+JyHE5r9Lb8PQqlRFKAvOAqfQ3rL5v9jCIvJE\nl9n5Xy2y/thFAL1ewXYWRkwQNnv3Twr633xdhfGFtwOlsZ/vdGmDsr+nR5Bp\nE7YHrLx2bOquENag/QW9T3HzteRydfb335mLlyvkH7z+pgi8FvnVFpmhEfMw\nQEjHN6m+f0LS3+uYoTgBXo6pMKnpssTbzGs4QxJ6gjekzNbuZVnPfFexqoEV\nWM+PXhSzXAzpB00w5IBvRu34ujtx3iRhJ6i8LOxQ59yZrur07meEMpmRuXEa\noy6Q5FpBLljIyl87LOp+AksAZubmlsZuNzGS3qUrOz8Ic26kPRHVdm1uJWMJ\n8JhmWbcB3J2LKoxc7s90ez1Cj8XpeghpljkXwHsPvEPAM8VmVm9GyIcrf3/n\njYvH8Cy0gKIfSqV2XEHqzPEaPrMqyAI5HHd/qik4bCZ2dgaZwLgtrIxyaDpU\nMfVJtpD4x5eT/adJh6v+DKYL4uX5Efn68VlIpdXZ4Qd+vX2A3R9HoHfXcSQI\nnjP/r6Z9rjDFToe5YscfdMyW+6WM0se7HhIaSFCRiR67qcKRnaknvYhzGDDk\nXnn6\r\n=4wpg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"d53efd5097b9de4577a0775f2508aa915eb9dcff","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.4","@atlas-engine/process_model":"feature~merge_process_model_parser_into_process_model","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-d53efd-kaqtu7he_1590673362306_0.04832032968230582","host":"s3://npm-registry-packages"}},"1.0.0-feature-bc88a8-karztpgi":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-bc88a8-karztpgi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-bc88a8-karztpgi","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1f6876ba13282adf697800ea715846dbeeb6075d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-bc88a8-karztpgi.tgz","fileCount":93,"integrity":"sha512-J5YVkj+sNx2Q1OmlYbTpW7Z9z/P3hjbQupY0mZxvJcaFPgLImrd0pV+YWLmSE2QjFZhuu+5QO8HcoYProPlrgA==","signatures":[{"sig":"MEYCIQCPgzKyYxFU+mfxqA4PinjEf8mTDabwz4GPa1c7NA+X8QIhAKvXiTrYQ8IkysspsqNghhMBth94w+kCBtX0flmC5tVO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0NNKCRA9TVsSAnZWagAA0uYQAJ8NdgEbtZtL2nSEWrs8\n5EXdfdTfGDl3Qhlm8rKRpP31Jjq6a6MwhqfaihonbRL6nbYuQrlx23KbkThU\nM1z01IabKQkZIdUX0LycRC886NL4R/yqIBcxFKpbfwc77YQdhdwFYxyucUac\n1yw8C3jwgX1gZIRWHC+b7ucS2K8GVzAW0Z5HGw6TFOGCzKCzqf9nyKPQWx0D\ne3L4slLrdLL38PgblJ9OFatAcml/nhTqj9nSYkoKEhkhFbG1Cqn8yfN1vJuQ\nVZUdxY9I7SmAuEYtAcE+xGugx29J6LWGCjqopARZFX3Uy6Z7yT36E3g2TRKl\nrX1IIhvcIiKMvg7m7LtqZ4AOkC3wxOLdbEn3HlDkYhGpeOwgbcDefuNRHboC\nukhLeRJd2zJMyh3dbHQEDdM+FrSK8gn8FgrK7LT3e+7R3nVxiTSwsp28mH6M\n1pi7J6ljgM9C/Yl64HaqXStf2MiMMxPLhJiRxvCeBX/huJF1UMzCepnzq8nT\nxk9OWmprhDM+NbIfUxpjBPw/8cQ82+erayEzP08XbDkCrY05zPtddLqthdFs\nhCJXeI+EAXYfOEp0zTIJ5yM058P7ErNSAdIfdMUZDrmIyz915sHGz5cn8sNs\n/mcuVY8RNy0q8qoySeOfH7iTVI5t61E80bkwPX3MyP7A2ZTK1iF7xTRKFZsO\n9nC+\r\n=HLIl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"bc88a82ba43e7d06741b40a61394bca3a1ba3b0d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.4","@atlas-engine/process_model":"1.0.4-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-bc88a8-karztpgi_1590743882355_0.23208534692082883","host":"s3://npm-registry-packages"}},"1.0.0-alpha.16":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.16","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.16","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"24440d09c9c02633d9acbfd62402dccf19ed6928","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.16.tgz","fileCount":93,"integrity":"sha512-LoJxZUolqtbwJdSMZrHiEpMn/MOIxv11sm14TGKfFzk6hcJLTJ1zfiuXPwrdIfzmVnf+a7/nFBeLG4UHTOHoSA==","signatures":[{"sig":"MEQCIHcD3qrhIjVOxj8h3g5SVLOTMjMgW0MNstYPtWt7YWI1AiBUsGdK1lvS75qR5gZK5evZgRQjdn9PlDnqQyjR5Nphaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0NOcCRA9TVsSAnZWagAAwUQP/A+5LQaD1gCFzzDIXvF1\nS68l2YCSF5fE1I2T0QoicBvHQKErSvtaf2PIaR0+14o92/7FhYTsjDUGSQGY\nHFJow+cQSjD506CI2tdHUYGPEziwudJGVpATPoV8+hVQGN2l+hWzlWKoCy2y\nXwhWs3BSuduWQyDLv9E4oUb2Zts1AdWfb4EvnIlVh6n/j+Y4cIy1BbQ2zyUx\nUMOwS1no7/b1MNtkljPIIZzo/9F7UY+NNcZHV41xQSzcivPysjQvJ3tNrsKn\n6q8I9e5aD8FNbiVyZjQfAzTlPKe3klxiaZJchECvup0ro1QDeD5+9RzLUyNF\nbskx0ooHItCJ9WQy/24K6SFz14pcKbOS66jkECgQHDnwofsc9akfUUDjUOXH\nkjrzvmlllynkuizi8kr6N4gAovi9bDmvr/1zF/YKw5xsIZ7QeLAYeRrGAOx9\no8L3hVjDdqp/d7OHmkLmkoABthS4ovEza6M5v54/jjDF7Fhy+M3cBJgpexkv\noqpuvDk6f9hGp0d5CNK6bxpqQLPiCmfO7r2YFZpl4HyoP++0mNGOC37K2up3\nw4q4Zu1qECASTSz07XDL3VQSxZlecCTc7bIFKp9iGfJpDL7EvzP3yFJ6eMTF\n4dtR9kpEEjP/8WPXn3buU+Lc5/mEnfD5lEzOIG7w/TaJpcH079ig0NPcTsnq\noA6U\r\n=+D8C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"a600a7980b173632e4383fb1ff8f4b2ef6e2d9fb","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.24.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.4","@atlas-engine/process_model":"1.0.4-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.8.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.4","@types/socket.io-client":"1.4.32","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.16_1590743964516_0.006035329789835009","host":"s3://npm-registry-packages"}},"1.0.0-alpha.17":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.17","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.17","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8442877b8a6b75b29c1e312bc3bb37849a7cf24a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.17.tgz","fileCount":93,"integrity":"sha512-U3LobyTucP/3mVzn1jJRdx+0z/LkWxhe7PgEDroIFsrT4lmyitKfwS0Utetq+o1HfCLnbYVda31TdLupcmPWjg==","signatures":[{"sig":"MEUCIFaoCfHGkXkstw/jSt4kSlo0nbFyzNACueSYnbowDMq8AiEAjCyRxyS4jmxYN8ec6B4UusLO13gRouGtDGPfEUntCjo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1mOiCRA9TVsSAnZWagAAz/kP/2bsR3kBbDMncBNp2Q/z\nKqNlZxVDIrPZYXBJ5ioU1NMrNe8SzIUYr+gwZI5aCsrIYoRY6NlbjB8tRAxV\nF5GQmswJeMay1mr9J1X5QRkjsSMj9iBs6uXRNEfiMCuUFV7k4mvp+cYHSYOH\n2Fae7xMhCD4QxDFqkv4UZbuB8EqPJ5sN7sgimm1PaY7twMrOaKZQwya9FsXa\nDnMnkox5bSN58Z2nlH2aDRwwZ3Pv+gj9bzhcfQEg6jytJ4BnuvYSFkCAB1oQ\nsvn8xTYK5kHww7t2DfOtWcHD96cf70t4rQHwMNAV20wvo3MnyU3syxTD5glU\n6QwIxaFGTcEMk5dmJVs7B3asusoEvTT+9mDWHaizLiBRj1vEH1VyiJhhCRRK\n1GRvrC2M/h7bwKnfvfdUjbGiPXRfVENIHfQ/gOig7VspxuF5AvLZ6LD4c4+l\nLZtLxrwwxD2YfUN++aSz+WTUlpRslNu8M4QY8qHMFbqZl2FOUJzZsfhCw7f3\n9xuO5Saj+Bn6ntihSSdXabEF43Xewch8wWX5OYWtW3xGxuUtNz9+6iJOiDfL\nWRk0EsCO1IYZnNJENEPAbGmwEtCkHQl4pFn9HZPVhHVbSY2lJX4GhmmwCOXa\n+J72YVCS/r92g1nVO1SIFD2NVAKcPNw1fDyyTMvaY3lalFPyAmQmkJ2RG3hl\n2MLR\r\n=zu+G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"0c09fa642ce00d122f5e415b7c91ee3b5f9de971","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.10","@atlas-engine/process_model":"^1.0.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.17_1591108513880_0.7530697310869219","host":"s3://npm-registry-packages"}},"1.0.0-beta.7":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9a1d131c5d3d7a6ae9f1e643886d1163eb150be6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.7.tgz","fileCount":93,"integrity":"sha512-uossESAHDF3fUO1He/2XpxAnKdxk3cPlWkdOpY4yPMPeMmG90y6f4v7rIawH7oN+BOT0XnVl6HMlzmCJbcyvZA==","signatures":[{"sig":"MEUCIFHxCK5HwEUaFOHwc2KHSSw+EC3KqDaAn9tIYD6CEYDdAiEAzbGlhE9QQvOzDNWpgw/G3oJhc3tPgkgjDZ6JO0IIvbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe13X1CRA9TVsSAnZWagAAzpgP/2fnSz9kQ4l+Sk43mieq\njrrYklOIFcv9cJzWk0+jyDk5cWSa1pojvNvic344UzBXpjVSzCIhAnTwvVKQ\nRo89oQ4rqkKCghzyeCyXXnUrD0BqlpSyX+x8+zgSBglfgmDi7KYpfiGDK6wA\nN9ZhfgbYfK+LK1QGTzLu/QTg50ts9S/eCiLKrcBDfZMODm4rQ1x7aIdaPWr9\nUIIsg/IdUvREAhEKEfhy2pjyoZCDkLvR6AtO2DBNbg+kaDPKDS78mThGUs4z\nRmkQDiA0bY886ZMFDcAv4DBj3zq5KIFuR/5UWLhNTxiqrZ68PIZor+bloaZA\n2qX+uiNlmgMv75AfVXGfnerXJkmfASXiV0iW6+tC1CgnRIABDrZ93yTFvB9V\nTysojTotSlg16iZ7du0YbF7YaWoLO2YA9d6QojvjxwHS0lEEbEDBupuFy9tW\no5Kp/T5JmZ6Gqt68OW4tK9soXYnuAm23rfwjCDyWo3h2tABay4ygSNzw8NOI\nJF3/TrxKxWQHxpUGEblI/1yPRK0YJyi+hgiXDP8NdTjA6MlsLJZF7cruAxP4\nuMEGGIeGYDy5BWQt2tgNb68KkE8E3p1l+XevXMd9CwJITBMkfMtG3Rhm0dJN\n6HUXl4KQrkGHiL7nAJU6fWAAvopmwSpEMZg74i0djWifeh6Xw6Og/5uCjrn/\n87MW\r\n=/2Oa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"4e3a64d1b0473994321499aec6c19c4989430f35","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.7_1591178740841_0.5938870981090729","host":"s3://npm-registry-packages"}},"1.0.0-alpha.18":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.18","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.18","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"42e70ec27d08cca4372315981d669757dfb18a11","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.18.tgz","fileCount":93,"integrity":"sha512-tLx6AcMpQAOkRLKyVhrf6gRPteY+HudCpXFKaMyuXTJk8NtFArR2HDd/Fee2xHxRiEh2vKNZdBBm/8lg3wFLAA==","signatures":[{"sig":"MEUCIC+zmviH3mFDUP9CEFWw9yncV1HlAgK5CAG+MdigvengAiEAyCFhkd/lkmbp8gUs0p7/mVZCA8zu3LglJo2E1XI3Hos=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe13d3CRA9TVsSAnZWagAAofQP/A+D9uLakk4XdFwYpOOr\n9QHxRxgAbnSRaZXHIhighNuQSgY43+PgtnJtH9HdnsqR8UhL1ti3ZXa6hBB8\n5YRtuZrC9uN4ETSMZ1wZHc0w5exxv0g08jwcNxTeF2mCIw/ru2i72Mwa169C\n85QkjZ6Y12Oo+WQPkoPTmnR9FK5r19l+fd5B86/lgNVvqD343CPe5RjEa4Hh\nQanyikDCqGXGQyFl8wg71GUh89ICiqDeMzqM6XpRc4sQ2zFIqNdeDKuaX53T\n3n/Mf0MfvBCRUO66XtIMvgse+RnosUDqp9IWPxz+xxIuOvad98/dW6YgAnLZ\nxbkJYduMx5ygAOvanQJ3xurOrSumY8ZKWitMw1YXBLrq5Y7gVNatU7BgaBAi\nijqn3w7CxQp5e8BPXFzLBm5n7ihpopLkfVM2bFpXgc5tgxXAhyNql+F9aUCJ\nD6cEF0BiDb3EMfvqXAFWlPcn64Djx2q3H69X5ucugzi+hMdwmJFQcN7Md0Dy\nqvCcW/U7BDrJwCdsSm7L9lIyFO6pdbGOT5/iJpQUkeU9+STQnrWDwtBpdWX7\n9OMGyzxTy19S/veWFGGHR/ek3u+PiVZFAWYTb7ypzNq2OPh65GX4qTexJAgL\nqxBxV00+YKaUwKzCI+SeAEwIh92UA7Lor4Chk0PbdUqky0/ACge+AsiKjLT4\nOBgZ\r\n=tNHX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"b32093bac1ddad3eccf81d7ce45ca9ba8f28e85a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.18_1591179126898_0.5976589192844879","host":"s3://npm-registry-packages"}},"1.0.0-feature-bbffef-kb1wm9bz":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-bbffef-kb1wm9bz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-bbffef-kb1wm9bz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf081eae7ac5c6a1e709fa3d488dbdc3d07d45e6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-bbffef-kb1wm9bz.tgz","fileCount":93,"integrity":"sha512-WnWNbg/dNth0qcYwNVrC1BOs8YNbwLdyGSUvnC7q9WNczLoL6dx9xTxtUkLXiqXCKQTZdCbXL1QA0T+PArqr4g==","signatures":[{"sig":"MEQCIENUNyES7tzBNjE9cp0ksB4ZEo2mYGbKDsYKDr2xWJjCAiAgGUyUtA0P6qM6VdLExmVkKD+T0DX/PPCb3kIU6D3xFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2fg1CRA9TVsSAnZWagAAJp0P/i+ELC/guBoBv0OyIaNf\n1loFA9GROoYKr/kGR3DIeuwAEc3t+IypfRBsMq80BXmql8KH9HgnkKiT5NuE\n6tBjHgSKfdCM4VPfJyqBvyPfi4f1F5YwGXc3A/QIDTPpac3pV2N3uzGHeg7X\nLvbNBU8/r9JjAtfpQeZgTvugNocf0FvWsqFNSjmnGIKEhYtXyOzsNStYWkbO\nLPGHy4KPlT8IlIwIXYAhlYu/Btr9IIcXxXKHjwz+3tDFTS37+eeJKfSdyafZ\nN1jS6tYOEWTYqiqp5sI9/fz+0CW0qQGm2ctVDs8OxUEamW6qp9PUoF8D27QN\nb0lGEU9r05CkF19v0YQCVqb81tG3gT2PKIBpc/Lp80JOFszhxY7yh/eAmP5p\n8XZbO8SH86lSnlbyx+Nusq+Gq5pwPDZlbV8MgnO/qHVbEfPI0QFmzvY9e5FW\nAlsXvmLe2itDsXdzYIhK9NxdhWx2DtZBR+RVilneUz+4vRmWCJzlD9kcZHvv\nD7NG/6Y4iuRZ1euCa8DsO2ncLEprIZ1NgQm2ybngKq1lykEo8A0xRI4gRfD2\nFgdzlDQWKHIpHcZovQaBZSQFxmTItNk4ewGKkYPgS6rpzMA9FJJiB62ZzY8d\nzJ/xvFJLrKencql9/CIsallMSA/kABlJ+HfaXJeMgB4KvBf1SzyZp/7bx5dY\nNmho\r\n=suM/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"bbffeff0a51c19c47dd7c35ece79a350666e541a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~add_claim_list","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"feature~add_claim_list"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-bbffef-kb1wm9bz_1591343156726_0.9172711446382142","host":"s3://npm-registry-packages"}},"1.0.0-feature-f7759a-kb6l4tja":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-f7759a-kb6l4tja","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-f7759a-kb6l4tja","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f8f213aac0213cb9b47758b8f6a6ce9b81f03c40","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-f7759a-kb6l4tja.tgz","fileCount":93,"integrity":"sha512-FtIpIcACXvZp/zrq8hyWVrufg4m4wrxueYjTp4NM6nCetbVziKHLhoXSfLHbVDodMe2Ro0TLCu6E6431KJm0vw==","signatures":[{"sig":"MEQCIF0I7I/dDUX06o3fXVnSxf9hSefFaQT3m1GcEXobHCyXAiBZXvoNIZVF/H3nEPiZwbdRPUyU85UkT3lAxuHZcYfu4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3knaCRA9TVsSAnZWagAAhoIQAI8uvj+WPKa7v7Flbzqf\nM3z9KmP3YzoAtntHu+1rZOcMK+yS2NE1JmwzRulfbQBHpEq1LrkwokiLQxne\ner1+PkgjMetzV4Kb5Izgnsn242PKxwHLoIeewlNwZKF5lBnIqSUDvrgrvJ9p\n34ixEMQsXqqWv4Dn49eILshapv/99Pm/BLmhmUj+OysT455WsPvk2ekUY95W\ngPtHe4o7wUDiaJUiCWiKMVOef6SGuH4n9G0PPBvMrExuQ9UDOMWs4+ARoKDk\nrD3CPcmFyn8PyN7xzNNrL1DVSBFKTJBitZt1mjq+yQt+f97j8uvv9yPEy/2E\nWADHpSFSKU/26L/VSOHie6bZpbXaIKvzxsYvve3TAOqnYWpgI5GxJu/KzDGZ\nPmRFIklRSw4A09E7Ejphq3N+KjNZ2BlChtKgjMb4pgWTmBC9jtWY1HOSaHyP\nkt/UHVDnfjBgDm3Wa8nVJ1qMt3nctFD7d/dD8XTAtr+D+5fGMn6meKybvkSc\nktaD/inAB8/nwp29Inv6vwo22RnqO0VxQXZMEHYMX2ONtmO2mj4XuK5HDGfz\nXjs4tVoyoWTSZJXYedjECHmDutDDQ7Ztg4q+m8j7Yr4RkmTrDyPhyoqDThhH\n3XKDqhr/X+4E9ZJtKb4My3y90D+vldygi1oAxTVV0BTuUn4LLwdUUgyFCxK+\n55Za\r\n=2NNG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"f7759a034b739f091ad9b650c528a609776eaecf","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"1.0.5-alpha.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.2-alpha.2 "},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-f7759a-kb6l4tja_1591626202340_0.4837050144328221","host":"s3://npm-registry-packages"}},"1.0.0-alpha.19":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.19","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.19","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4cc5aa96cf8e9c14a17e0789be3f43907082fb3a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.19.tgz","fileCount":93,"integrity":"sha512-YW34W1/CJQ3iGyJw09MCpw2lYhF/Mk00X/s0g7wFBd57qbtZB+Zd9Qixpg935Td0KsrZIK1iER62lwt7z1YwdA==","signatures":[{"sig":"MEUCIQCRn4yz20KB29/ajlc3RV11TomZQ3uYrp/dBxDJUHATrgIgTR/BEG5ApCsRnZMNu/iQifhCBb7Y9j6NLBH8oKtpSaE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3kpKCRA9TVsSAnZWagAA3+IQAIJSWmsHZ0D9Uc3YTpgW\nCJfGM0VdBHb7VXgUsXgz+iMlLsFssfwlUAt5IbE/ZIJNHHgxTEnj1plUnDXU\nVlSRZWNB1Xa49DDn2QRjzQ4gL4cbcWXjPWHZOXacvvBDDgdNP7GXCP8B91ul\nRdrj4i2JPHaDCa8zUkhupZVHSWA/pG0PQ4MqQmTVCkp581CAe9Y0aMfgvq5L\nlT7s2YAOyicXlpG+l71w2L5OW/JuvAsafj60ABanUtxb3dMPUT0zdz3eLlcy\n57woHkCeDCnuBk2PHz6Vu5vO8WqI/OWV4GKnAhPX/1Nq3GSs9KS+aElOmgEY\n8XqZwZwb82pMw9m/4wv9KyjTx0GzVRP8s6M/JXmZWjWxvA1sIyf+kheUv2wS\n1Yj0EAcsJG8zdJ64BG8OOLW1ieGrgeJuNf75SMw/0DtcHpPpBsKKu908eSq4\nTlCf5wgKv4xO2qWfcXzsrNG8zacSNwCUNMoO00Czh8s8O+bM3uXTyS4RQ1EX\nTDnAHdkJnApGwCMQ248n+RtK6iqMh5ID7OTAW7WyX+dPvVU24KxoP3yR+ded\nAmblHaZC7l6zswObje9lxKByBH3ssiw8kwC7KpBiVw3QyUNo/TTlHx4/3kWs\nSDHr9aFlxKNNUUVlm3yRa+bgmVH1nWzDPCx7miPKTtFhDvgZuMN+lXyhJ3rF\n4RW7\r\n=+Wq1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"9c05953601bd6f8adb8dcaf6c98d0f7362512796","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"1.0.5-alpha.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.2-alpha.2 "},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.19_1591626314471_0.3267401272438648","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.20","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.20","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"288a15316c433cf9fcbda53d6e7295418cd6d7d9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.20.tgz","fileCount":93,"integrity":"sha512-xMGnHbolqAr5oCefZvNN3ltiJtEBZPTKNlnND3yItkQHvvYE0UEaIazNlhUFpKf/QFzigQbfjx4hOO0bVJDMwg==","signatures":[{"sig":"MEYCIQDiMULju8GV9cK0Sx2n/bmI3w9P2EhTNIhgVLxecwimEQIhAN1tw2xSRRjECZFNyu2rBQY+9LTZG/4ZYhr/iqrkoAXP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3lAACRA9TVsSAnZWagAAsPMQAILRy2iGlahA4hxXoeX9\naWAZoTobJgepnKIHyXI9vzUJJYlfYOyDpnHjfDRQPRY+jsumWnxctiBCfdjQ\nc0sV9tspw+3HSzARJnbzfIpGF3Isd7vGb+fNQOFzz+V+ADagDdHW8aBQowJ7\nn0g5TGw97R9ktC2tguw/BqVZZjU26qkzAdXTTEA/95p0eslY18yxU4X3efdo\nrU3n6FIpItgf8KgXAwRO+pI31B7kLoPIoJjDXVei/eaEEE8/DT1DajK03oB4\n+Y8myvjSiqiA9M4owB+y7hl7yYLQJTxoCWkwBp3gLxjRQMN/3iwrYbX18zbZ\nUbjZrhPr0GUsLvaRHaII0ipeeCAc6GukaAdDp2X7XhIizeJLrAc3UyiUT4f2\nPzq2uGzn1OQ6ZzIU1tcURgP4MD6p5kLaTPXLhQwPn6aTKvEw/OwTwOntxRH8\nmY+lP/6cyZsAOfa2j4sUIk/30imKTPCBnm10EWylhKzHhTzJFRY0VkDMgcmi\n5PvBwwQdb7rzYwlJYJlZkxe5g18ErmEFWopZmjl771HEg4xrFmK9vWTFaMov\nPEeD94OtWPd2p2k4EKbJ86SdSOboECTSC6eDH4crwDUteopADJlrbsdN9gzb\nBZBKyUqyk6ABxM1Sx0/AWmylDO6DfgAFceJVM3nvucmxynzoQntLGPHhPPfn\nqBLi\r\n=vqY5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"340c102a5faa1c504677428850e22f46adc20991","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.16.3","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"1.0.5-alpha.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"1.0.2-alpha.2 "},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.20_1591627776251_0.39118736630558293","host":"s3://npm-registry-packages"}},"1.0.0-beta.8":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.8","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9c2a367b8cfc109f73ae1dea8b04a9421c49683e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.8.tgz","fileCount":93,"integrity":"sha512-JI5Sfa1NRvXra/Cuz3sHH10Y/87MVrqE8U20/f7xPbRh0ochwjiYauxo5i8gNgy7LPUjoLTLbyJkLQtPovsxSw==","signatures":[{"sig":"MEYCIQC4tLKm6qwYYy81XrYYBEKlWvnVzk/lfCD6mjPxSrEcQwIhAPkk89RlZfTRqn2gb1+K5sNdLVD5AJG8CJaNKr2QkZUr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe31EGCRA9TVsSAnZWagAANgIP/1E+jwqHNekLoLlAjWmH\n8gFz4ikKwqFd/G+VjWb1ld8mtOlXipSrEvuyFHAksi+0/Wsp6taotcX3NxiU\nQaSaUMbhN/9e2hDge1eGtByNFLToev74levx9UO9Ea7bFf0g1Va7GaQmFF79\nPx+edJkvYA0z6KD6doTO6zl5VKbMo7wbHWdvrBDSZmEzfPsVPHriEyXSL53d\nfp2lx+MmxUVY0HtqNaUI4dB81scdevDcBNlTfLosckT9C49dWYkGiq1cs0Eq\n1IJbCSw0ZkVxg/O/Gp7g71hJmu7LiUNLhTyewBtnCOwZsWOxls5JcsxHUSCB\nNu04M2vxl7kMRqYL8WRtMcQjVFbiH1rAIoZTrzRzzCLILoKLHACmCeqDIJ1u\nDT/DPKUhDzRZbsRhQ+W/ocb5ZkoIFSqpmDCw+RkzScN0e24HWDKCsYCNtIqO\nQDG5yWv5rjqud+qximoaZwViAZHNNjJRBlNjHM4hxRm0OmET5UwD0ejEH9U0\n/x5dosZH7govhn0Jk8/zkTjBwncBH3fstk/o0pBg7NGDQTBTSAXTR7yDVBEW\nysv0kYK6mjnjBFVXi2yuHPHgVd97Za8IRvKtGcA3t0osDnA9Pm6+mO5okKTl\nmZSAVWR5DWqAa/8MdjhSohgZwXOWh+cNGEUOO10eydbtEori6OKDlsIJs5DO\n58KS\r\n=mNGa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nconst externalTaskHandler = <TPayload, TResult>(externalTask: ExternalTask<TPayload>): TResult => {\n  // Do something here\n  return {hello: 'world'};\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"70b7ac64fa98cc94bcb294b8f0aaaa3fb3f7dc5c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.8_1591693574182_0.00873247999704474","host":"s3://npm-registry-packages"}},"1.0.0-alpha.21":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.21","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.21","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8bb372358f592f14b4d2c7d489a67c1d60f57b3d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.21.tgz","fileCount":93,"integrity":"sha512-++ktWMjFLJoy2aiRBVDBjCv4sRYCdz0vdVqERUq5k0Qxd1OkJkcduWj1HejC81OVsHkzoYjgPkPugWYZL090Nw==","signatures":[{"sig":"MEYCIQCdBo6XIf6QOCH1RBLbGKfchML8tSEEcLl9apfkXT9GjwIhAJ2ob2sabDWqAh6K0XPMogorZ1bvHRsu4+BLkqi3sXM6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe31M5CRA9TVsSAnZWagAAI/UP/02ulEPigzwTLlvkalyn\n7DKHrFDRPcDxon0vb83zKHQRrMVADoGyWLjFCL4AEq4u8Ud6XRUsefqaIgxE\nrRMbi8pCO/JszLX2QOh9GMyDWZ+t9n/DP9LIrGNEnKU14hz9RkaVLEn54riS\niuKBEyDfFjKx7fatraWu+oxiKFbJcr0IU9FuLyb4uNFSCrOXLjkfJ3sESq4N\nes4Gkdy1QvIm5ZIZvUbdd8QorfOK7dH89rR9e+DdDBusS//6aid8NFiAMA37\nVw6my3mFdu3gjfN1o6NjWpvKhgf54uVvqKaJUwL4U/K/YEzuqxOTlWtjUomD\nnN8H0ix1C2lEcF/9riLr3wOrY27nCJ3hxi9GHeDruA4Lmdgsrk4u0q8ClPOA\nuDiYJUaxwTvvUgBNNoWsnhJes5NDejUAamVtWWrkGz4pjGvPJtCcn0i7zwD7\n/67l8mso/gSrb9TpJ+D/X6PzdpvaS46GzzmqZ612k0kAfeCK7v/KCZBJ05fg\n0DWOdvi0eKSr5ib9GBVRZCBKYKS3bfE7rJygyFQL0dTPG++wpXhYeIg0j4zC\nA2BYIUnxAxqVC6DZRrXR3jC/mZSQFkUGmhMMr19fXUOU8GtRvFnLU2LIOF17\nZGzS7xXprre5EZ61FN4TrjuaVxLTopqED9LBWSMZzZjyvC1G8EoxK3iEUjTY\ntNmf\r\n=OC9x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"68e2ace12719c4a1fba01cc3952962059b498fcd","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.21_1591694136930_0.9813749999918917","host":"s3://npm-registry-packages"}},"1.0.0-feature-68e2ac-kb7tgytk":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-68e2ac-kb7tgytk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-68e2ac-kb7tgytk","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0a0df68755e98be6908690fa899eaf5e43e22f7d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-68e2ac-kb7tgytk.tgz","fileCount":93,"integrity":"sha512-OeTKqih7jPDnS1yzvz4+TgShWQzlwVcao97dBDkIqZqjp95WYDO5WTXhKpuvFlit/bJAJYWYCuDDf7EwWhR+fw==","signatures":[{"sig":"MEUCIQDymV4m1kVtiQ92uumuVhX43IxJWWpCg4z3aontr7lYQgIgISF+qeXc91WHQZLLwx+klUi+wFjKMVj6SwlnWpM4vws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe32y9CRA9TVsSAnZWagAAWHUP/3H2vGc0Kn+a23Fl7BJS\n3uz2WjjDLs+qAM/k5490kUYibK+HHRsvyH37trRyNOwz4SIZT+4arHW7hufH\nYwxaOtTFId4ISPRSlHW0nZRDf3XBp4sAr4YL1JL6YhVNnqFJJI62VB1oeqVU\n21PnZANnLF1A83x8GsGxf0cyc3ks+mHjRfh8hKemW4MjpUv3TaR64UWAzX9w\nY5g6ZzE+U1hmYtITg3c5TXF7ZFbKkxzF65jj/Xr2x0UC68UK1KqbeCgLD2jX\nN5z/H0q8r0jizYEtS0wPZ6Lipk+xtlnsVJxXfFu3/bVorEe0+0frrdtarMh3\nAN+0Qt/cA/sWyRLvF/g4ja760IpfCLH7XlsgxD9R5S/nTrmDmQyAaIYcZTWA\nD9xMEestq+Vp1X7X03jlqTjJtmS164yV2Rqw0/ZQDrQ77EwcSRem5RnBcb6X\nob/K9fDaVd78uhmoJVFLo9EOG4Rj8+u5fcTqKeHQ+bILPuZcNZoDmYUy71TM\n0K1vjvPOKcDDy9utQKFNNbfTYKR9fsnsjd6JXbBPp1XU6fG//LMKnmOGQpJq\nOIB4UM8FPKYfenec6xmElwOold2dXO4nGo+ULS1nzP/GYp/uYleVh6zufbdV\nyfDCSBO9TskRokc2isvoyqza2nWUE6NwikIaREhEDXO82UvZFh8jiqrDP6hi\n6Gx+\r\n=A3KO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"68e2ace12719c4a1fba01cc3952962059b498fcd","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-68e2ac-kb7tgytk_1591700669466_0.8587035642958809","host":"s3://npm-registry-packages"}},"1.0.0-feature-3fddf3-kb7y02h6":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-3fddf3-kb7y02h6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-3fddf3-kb7y02h6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"76ec61d6f4b7bff93c0dc3627899d8c461ed4183","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-3fddf3-kb7y02h6.tgz","fileCount":93,"integrity":"sha512-P2H6p+uesPGRWAaxnn6qLELtimwfmNCBsO6JPEtLml03qusukmOYUf4F+2a0Ayb0QZ4MA9hpwuEdzrlMPJdN3Q==","signatures":[{"sig":"MEQCIGt1YR8wPVE+GF1Tk+hflXZ2DibfLEyZnLnhLMwk+IB2AiB7abJ34gNQ3r6It2oOZLWGRiYUZ6kwuLkFXoZV4lfptg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe34p3CRA9TVsSAnZWagAAlBwQAJWZu5KeCmF7WY2zQZ7n\nRStnLiz+BF/QLtWE4ExksiWkJYx7gxtprC7tKdY+maCGjV1a1Tkuh3nY/q4P\nWRDppMKDXs9mEv/vs5LTOcz4LsgWpBIJhRRcvrZqEEP8KQd28NOqsg+g/uWg\nGHmW99n6Q1vzlpWTIvvIjwthzMX9EwhWEUXhMoD4h4kgb7ZDUPdz7/N9Nrbe\nEj83Dcbt6vy/HsXN1Tw0lSBkfnkEb/0p/eWb76gj1gRX/ryIWmWRfBroekbL\nZ95dpDz4EpwmD2/ct2c/ClqNluFOrE9UiQ78NLUoUoDvZH4dX0T6lbhgyEz8\nfBz6YDYuAyKXwafFqECz2/cxw295TUfl58/wnxARSaDCL3+mwR6M+zXIOf9F\nj+hVaxrbj3GmAQwZZe774qOrtp5KCXKYBjxeSuAFQnK98s1lGTLIJVbXD5ft\nJiOgybPZj+FiETOC/iMeqghkTN59RX05YDsFIRLNDqwmplfg9NVF/LOr8k4K\nfb3qSJqi+C7YD/+31oS+JC0zedCoSMsj/fZ4KLxhnr1RoJWXreUSpvGZwTeO\nnoNc/o0qESRz6/IflqiBWbaAG/05IWIqS4+XWeXDK4o1zW82NegNA4QRfHrX\n21D5Rye5UXYchqnKdKZZdzg3kvy9ELmQtHpG7ENSivqleaegvtvQDDaFtBtm\nRVna\r\n=PB/R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"3fddf3957664dcd2730abec5f86b64c95f3340a8","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-3fddf3-kb7y02h6_1591708279074_0.15923295851394026","host":"s3://npm-registry-packages"}},"1.0.0-feature-c13826-kb80ejvd":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-c13826-kb80ejvd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-c13826-kb80ejvd","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"21e068dd279cd2948f50d629b65088df787f961b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-c13826-kb80ejvd.tgz","fileCount":96,"integrity":"sha512-o6uYb2TUBoJrT+eRvlbLOgq49GcJbLYa0rMbRs06qINLq6vzu0fwHBlc4N+5yOEtiZUOC/xVH2ALlnyO83X4kA==","signatures":[{"sig":"MEUCIFVyQyhD6CqApoY6YJK9qTsbe0l1rRirfOPCsyI+1KNFAiEA28BAvvdPpe9tNEqz/iCQ+WXJwhq9e/i5Pa+zTGhz9lc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":259099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe35o7CRA9TVsSAnZWagAAFQAP/RrkiJHXf7bE3K1NcIBY\nnjVmPk7X6ET7L1bP4MCXpHZhmAhPu4mym22iW/sQHXtOEGWZSr+6+XYon54U\nbAXsPLIr2Dpgth145upH/CzHXIFIEHjgixRuGnZ2OUVLoW8/mxFUrpgt9vT+\nm17q8aaF53LRp3dKFqxmNQISaQJHNzUvyqs7/m4i+9KeiHKrCik2On3dBdYj\nv+2WvNgdmN0X+/9R6NBhEi7arl3outVaCvp7J42cqTmGjt9JFtUBp4BLcwDT\nYaxwjZPXY87/LP6XWiHiXuBlALblB98Dx/2rdQqovz7qCjLjfCV8BH5Y5ojq\navi/m5XBuOxIdwKAZdZtvBClA8fMHqMjwCkGY/lq+dT47IKQ9aM18I0qg816\nV2ySTWjuVNV43URhjO0A9SEaLrs42eaPmbwJpS4JwsrKJm6UqDcdpljJRVWZ\nrc3qOztgot+R5M+2NYODesT2KatNQYnj4VJiSuz46GYXCvX1/WYStwihH+8t\n4MPGU5vO5xVEtg0hI3T8m6nGpot7aopPkQL48SqUrQQsxanvUceR5xslDkSR\nh0stJ5xA8nUyb5wBTAhAWl5wyBjmerl7yCnsP3SOgC3NXpLtvLMbcFN9dg4r\nI/C1CYLjFLyT7u33OUiwHLeVJp4YhtG+q8VJ2BN40lCVcRBHPPl5yfSyPLfk\nJ+Ih\r\n=BzBD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"c13826fd913518fe361ece21e808d9e280f9cbfc","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-c13826-kb80ejvd_1591712314605_0.9324181642021452","host":"s3://npm-registry-packages"}},"1.0.0-feature-5ca483-kb81ikfq":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-5ca483-kb81ikfq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-5ca483-kb81ikfq","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"934123699fab63c57870be3ad35ec17ca21cc17e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-5ca483-kb81ikfq.tgz","fileCount":93,"integrity":"sha512-/YEF0QLURmrFfHHhML1WrKGb1Dx4hpRZTI1xMs7KUEoMGj9v18JU0qClNDz/ma6t86TQRxfRiNLnB58IEe1taQ==","signatures":[{"sig":"MEQCIFiku7caWUm82Wt/AqQZja23RtviPVFFITcTMX0qV+0WAiBFhs3L393mSe7oxAO2V2dPPW4+Os6K8EgUokyGPkhHRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe36GHCRA9TVsSAnZWagAAamQP+we+PUMy/kFqld6QMF4u\nkfKL+iMkBlVg57LsbYjd0Ix23DCToPcX/Eiupb5KCNO5pZLdes+/jVQ/xMEO\ncsss01kkt+fu7oENzhepH2+TuB7EnzW7bz0tiJFFUEo7EZjn7tIQ8tCjjmd0\nsOqyig+UgEEcEg3ICwevn/sF2KPZqbTvrQ8rh/JozVV333Dpmm1uNYOfKFMQ\nesP6PR+/037aal/4hpeJ0mvkRX77w/5z20yGevs5kx9dz1PK1VDbRCom+B/e\nSct0DqBAZviPYhApkP8sZ9oCM6hOyZJlu/oz1wf4gL0oHrHnOrdFNpfSPf70\nY7ZDZmc66u7Z/9w+Rrjdo8A5rmOymxzRvVWqbAbeLZEMWAMh5tpBbdpDC7pb\n76Ym9TectXYMhH83ri6eMjsk8M5vAK9jTQipgg81Ct/0cdf5wLyimZNeaJmY\n6xQL1G58Xu9/sQPqk+vp6mFamVZagXs8vs39iJYX/ITaDwgTeMyEayt/OfX9\ns38np8t5Hy/mjL32a+ncpQi3cwTmuNlxzhAb2bCgKl+n6HTdulPZxD4cBwdz\ncHzBNiDaQCvPSsaZdYMRB+UIYaqYFU6mS6sBhW9PDiEZxwHHRBqZjjHqvqBm\nCRZgWJFVOLvVIUFGpu//ls5DQ/qF5MXIpYwrNA9R6WjBuhSUh+IwFzG56CBY\nVAn6\r\n=fJhf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"5ca48331c9ea51756410ddaa9542fb73af11395d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-5ca483-kb81ikfq_1591714183037_0.4520831667914611","host":"s3://npm-registry-packages"}},"1.0.0-feature-1d0741-kb93699u":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1d0741-kb93699u","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1d0741-kb93699u","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"533fae936b0464fc2e41b9ed86b8f9a97c9a82e6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1d0741-kb93699u.tgz","fileCount":93,"integrity":"sha512-zY/fuIVGEJdMB3lcYNef9Dua/xUtW3DbwPwI6JFEh0vTWXOSjgzYv9pQ3swa2qg6+Rbb31XYtu9BTlFhi8QjmQ==","signatures":[{"sig":"MEQCIGe66bjzInn6bl9qcBo9/pjZsJkoini7Vrk1FY2uuPBvAiAxo6yezF/YYUlu/CVlMF3nzi9h5dO8SOvw5XFCJFkZ/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4JiXCRA9TVsSAnZWagAAky8P/RObPnCluyBS5RIDo3Q8\nuq/2zpavuVpAPIepMzLs4naaVs/H53Ct0UZk/Er+bzsU0lWR8DvKbNv7363X\nKLXtJ3jcxNGQm83TkhvS8qyigMUsvS8s3ezovZ23HZDuvOJc7mLynmom7NqS\nSqmSMlGShny7Bn9RNU92k1L1TI1wmLHT5mTCDpNh223HKIqUhCZ6ZQvJPqCC\nWznTUueaL1jiBE+ErN3Gg+jV0WEeFekrW4oDX0DhW1wEdpGrfFEz4NLIsH5d\nAaZPT7Vp9FpZyWq5p5WM7a8R1weXkqNXHH4xPVyGwTMdEp+r33v9NqwLZ9NA\ntWVkK54H5Taq2MFtRpV2ivfzXLi1RezQ38wz2FKJpnHhnbQiSOGfSEqDxK8A\ntU+SXX0RXu0yKrA9TfwW2asEql2g2BSYKYj5nhdBX5j8aWBi4Zs8tK6GxbEu\nmzE0Lnx9Hga/n2dk60t5IlDRWs08HZsot53BjhRk3lPCW/HYpiVQhH2KmYPL\nzT5D5nPbyNJUkM7s9vC2o2nPQ8UraUvYLMmdJgMv7cxlBMrl4aI3M+pFXVyc\naL+r6InPesTbUOcL1hFJnrCte+rtC0+LdemOsLgqsYvv16sM0mKKTqe+A+3z\nnRg/CHmr2rIJnG+amtDq8HBXDHnrs5c9eX0wyigjoROIoUYceL1POZsmU1fp\nieei\r\n=Yfl0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000; // duration in miliseconds\n  maxTasks: 25;\n  longpollingTimeout: 2000; // duration in miliseconds\n  identity: myIdentity;\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"1d07411e9fab7d75ff45425894ca19fa24cd7dd7","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1d0741-kb93699u_1591777431232_0.6152227721680479","host":"s3://npm-registry-packages"}},"1.0.0-feature-3ffcd9-kb97sjx7":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-3ffcd9-kb97sjx7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-3ffcd9-kb97sjx7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5505e5e87542cc9e62923cd26a4b08cdf8fe17d2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-3ffcd9-kb97sjx7.tgz","fileCount":93,"integrity":"sha512-S3jiQpWEQjaU9BN7GDT5TWQo9cKMgCMv/X0W2k3KcQCLylBSVvY4MmRYAiMdiobbnAmARKcWw2LGJxQDiBvnuQ==","signatures":[{"sig":"MEUCIQCBb2VfeEo3WnDgPWZRW51+BrH8FkE2Pj+VImxV7X9FxwIgQTICZOIpzHvWR/zI4s3h7O55Ppk9fgo0r6vieqQ1ZMA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LbmCRA9TVsSAnZWagAANjYP/1WzqcXvWtO7zx5o1iel\nAEeIOQFc2V1wOYDeLttvsbCI3zWjvVMuuo59odmw0mDVlPqZVRRuWz+6bCVF\nKdmgtsoV0wMpF8AfbiJkkyEj/Vf6/deZz3VkEmUNjvtk04KZpK1okG1ZpJrZ\nQspikYRijsvNQRlT7AiSj6DsZ38sfz651+goPIuunLTkkqHVR7ocmj6aFdWg\nHfeIpP8Y8UlEnCUFxdV2ikhJHjvIm7V2rQ4TRufN/Fc8yceDeqV3pztGuo57\n5VmoyexaeCpz1bta6T2lOr+SRJm5FVlTbOjxHbgZDGubJf3z0I0HrqCSOF7f\nf+DmYswSFk36RSPewnA3q/+ic87HVNOyOmAUpbSE6o077iA+C4/KhzHuj0RN\nZsbgHVDq77CyY0AD8SI8DB007MwEQaY2F3SoC+eQli5Crb+WWAIi/qsBFc3y\nQ22Za7mmhEUg9w1bbZ36C84IItFVyQhWZ9DXupeO4qVKZWAkQ2x6CfrE7iH8\nrMvmLTbqaGnld7V7RujxMdBlmeCUcu2KAI6AebcKEW3hDYDgPjAr9unMufZo\nNVDwn8NJ3LDHQdl5RWYByG9HhNdXWwZkLSl/AGxAlHnSVp2IJbcecePwrq+t\nGmK5fnbRtY2IUe6ljLCOHCvJQJZgZ1oipi/A7AmfA0yKCTzjpgjWyd//BQc3\nZ6y6\r\n=PtHv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n> TODO: Link to API docs once they are finished\n\n## How to use the client\n\n### Basic\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### With a client identity\n\nAll requests require an identity.\nBy default, the client uses an internal identity that is auto-generated upon instantiation.\nHowever, this identity is only a dummy and will probably not have sufficient permissions to do what you need it to do.\n\nTherefore, the client takes an identity as an optional second parameter:\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl, myIdentity);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\nThe value for `myIdentity.token` should be a valid JWT that your authority provided you with.\n\nNow the client will always use `myIdentity` when performing its requests against the `AtlasEngine`.\n\n\n### With an identity as request parameter\n\nIt is also possible to pass an identity on a request-by-request basis.\nIn those cases the identity will always be the last parameter that the client function in question takes.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n}\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query({}, myIdentity);\n```\n\nHere, the client will use its internal identity as a default, but will use `myIdentity`, for that specific call to `processDefinitions.getAll`.\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n> TODO: Link to API docs for an explanation about external Tasks and topics, once they are finished\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### With extended configuration\n\nYou can provide a number of optional configuration parameters to a worker.\n\nThese include:\n- `lockDuration`: The amount of time by which an External Task should be locked for the worker. Defaults to 30 seconds\n- `maxTasks`: The max number of tasks that the worker should process simultaneously. Defaults to 10\n- `longpollingTimeout`: The amount of time that the worker should wait for External Tasks to become available with each request. Defaults to 10 seconds\n- `identity`: The identity to use for the worker\n\nAs with the user domain client, it is highly recommended - but not mandatory - to provide an identity here, since the dummy identity\nis not likely to suffice for this.\n\n```ts\nimport {IIdentity} from '@atlas-engine/iam.contracts';\nimport {ExternalTaskWorker, IExternalTaskWorkerConfig} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// A custom identity\nconst myIdentity: IIdentity = {\n  userId: 'myUserId',\n  token: 'my-fancy-jwt-auth-token',\n};\n\n// Create a custom config\nconst myWorkerConfig: IExternalTaskWorkerConfig = {\n  lockDuration: 60000, // duration in miliseconds\n  maxTasks: 25,\n  longpollingTimeout: 2000, // duration in miliseconds\n  identity: myIdentity,\n};\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n  myWorkerConfig,\n);\n```\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n","gitHead":"3ffcd92897d8ab1e2f75b39c5d1c5847484e087d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-3ffcd9-kb97sjx7_1591785189989_0.293948787327712","host":"s3://npm-registry-packages"}},"1.0.0-feature-d9774f-kb97xwkz":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-d9774f-kb97xwkz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-d9774f-kb97xwkz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9c8a8dd721fe018dca94a6e83222428428196f61","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-d9774f-kb97xwkz.tgz","fileCount":93,"integrity":"sha512-Aus76mkg/srBlpUzd+qQvlA2FgcFOZmW/+cu0nv9oBdkTNbAzSAx/F/v/VgyAfgtF+OYeYArJocxN0lYEi31/Q==","signatures":[{"sig":"MEYCIQDJOt2wNfGd6f2ZvusuwMsihbBYT89Sj3cv9XLfjtZCtwIhAOu/TKReGUQr+sXrDzP6UCU1E72T/bbFnvV1rdCRAMs0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LfgCRA9TVsSAnZWagAAbqcQAI0DxlM/gSczi1b+VW4w\ne1+uxMKTAkS79/Hf5CuqmqcNkqpyFgFOiNKV8Lw+W2kpcZoUKr178CM7NTvq\nHTzm1szh9xzS3nf3e3RHoJCiaV0NF4zV9En8Ek9NS4RdJa6h2yM5oRYCS4u+\nfuMuAl/FzI7PJLSCSkutD3jsQAM7AVzWlrjY2gxetVhHhRQvlfgQFt/wqCsZ\nxWrH595P/wEoqWUshmsXEGPi7Ns6LDE5p9ZSNMo/XU43stHfg3kPOMPjRSoP\nut1q2+D3PG3Qhb3ncwk5hD7kaXa52QWXCwsVAAei7sdIBTmHY47ByPdmgqCy\nDB5CQ1kROunRSFrJEzo4TuI5/FUCEx0MVadZopA2FrWLcGuO4tyqQH67vmNJ\n59JpcQ7KRYf5+IcX6zd9giccWbzUQ3muji9rDEZJOZpGdrlt9XLWhqfbmn7S\nRwc0ZhZDsdcAbiFpcT739oDMTOf6zUOhkC+POqDy4orN3TmT5xj9GsZkws94\nGOazxVx8DtwTcyox8zmbBw+shohuiZrxfPxDAD0SdHtSCQB7IxRrrINRBTYE\nbCB/hs4Lz+HxwpBsLqNKXXQinyYxe4uZ07TLsW0XabXA13dGG2unQcZ9LZPT\nVJa9kJGkSa/Le8B/Kk08usskW+2Wol9KABoojKvMzfXG5E8xA2IyqIaAd5ew\nWi43\r\n=MrGO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"d9774f2bc6f0842acfc7dab6c7e626931a73943d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-d9774f-kb97xwkz_1591785439863_0.49594694587968147","host":"s3://npm-registry-packages"}},"1.0.0-feature-1004c8-kb98ov4l":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1004c8-kb98ov4l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1004c8-kb98ov4l","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"555b6133da6cedec0e901d23b5801346057896e6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1004c8-kb98ov4l.tgz","fileCount":93,"integrity":"sha512-WFlUNwV7hGM+De0e3xeiK0yDYzAdkVJycRiPKuWhrBdMYy4yFqZoiDame1sKQY7johaYq7T64i9blHcgHpmOHg==","signatures":[{"sig":"MEUCIQCEUcZG0hVbZNibD+thKIfN3J946eTavWj2dDd8UJEi7gIgcUU0AisMVPaa2NTTZzHoWTOr+Gebc42TgiJ0+Ekge6A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LzKCRA9TVsSAnZWagAA9iYP/jusMVHC3PvogVdLSf23\nyYVQKwMfWUi1QvRJak9BCTpT4Dn43jfttc5STEEXEfFnIUlyb5x7xPRnbDj/\n+Hl2CwOlFwNFiSm4Z6Nb93OzwNN1X+obdFgluH18kPyBXaMfx8+VDhNjaaQE\n4T2LAAPDvO0Jbzl9HHvQlnb/mdYpj+vDQgz/zWtbJhxizS/2d3dL1WmlWSLD\nn8i7GUWfmiw9n/KE7E99dVSCqHq8Z7HVDPP42gMK5ROh4K53ZIdp5Htx0HtX\nL6QYpg8cUbq4f0QdEsjZUPwRgzXb+eKv2psRf65ZBvlWfJpB5ks8EqdVJHxE\nT3c1fOC+vu1nFP+dq38HEQiEamo6Ij8yZ4orF+eMa9b8hjr8Qxc1w3DzkGcj\n/sKy1a8Rup8KsvYNi6MZhjfIjdFRPJVYF1P2027aWun2aqn9g051DQmQWVsO\nWbO80klvBKAfzwTB0c18pzgVQrxrWr3IuD3S2oJpkz14JlBMdywf3pFKUJ2M\nS7gmHzUNgznFq0JyYUE9zj2Lab3MAcaqJFHc4AP/YC485TwZTqzuQ5OAfM3T\nJ7F2yN4BkCb0qC+5rDfCrWghc5Gf+ZVfMRcSyhXPKeedBUmpJGKVHe69aaG1\nkRSq9/2LlFkr27llLd0TQ46H+s+alGP/6Lj3mZKJZAAaEqN+WbWG4SrCeohS\n12Y2\r\n=BM/d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1004c8e34c577e1d8ea4bfeb47891ef5c867aa93","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1004c8-kb98ov4l_1591786697908_0.398724445811389","host":"s3://npm-registry-packages"}},"1.0.0-feature-3c0316-kb98ovf9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-3c0316-kb98ovf9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-3c0316-kb98ovf9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f4d2ba2049414ead9ef3224b7cdf3c2f9c9a69d9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-3c0316-kb98ovf9.tgz","fileCount":93,"integrity":"sha512-OIeDiq6jrKDdPI55QKM8MrYuTsFca7F3qlQVn6G0Pehbh8HzBDmeKwt0gAd8Vb/WISSMXHWy6Y+iMLivq6BxfA==","signatures":[{"sig":"MEUCIQCFBYcDBmbOoVuzjJqEMHVJCWiL1x5ZA8D87n2j9Ei7HgIgXzoLXaUvyEqxV9sxL1pI9c1QxP+UCR87G4UKxg79V+M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LzZCRA9TVsSAnZWagAA910P/2M0jpCt65Y5AqXj85Gu\nbKgyRYiZohAHeyK6lWzZdMQa/TY3RgZRm4bJYs4DEUgPKLzfwSY/YuQJ/TLJ\nCHjhLDypsvWWf3A/UCJSjSSYfmcoF8txWwjAuMMfVMm9iddcZMvLz6AQc5B2\nG9Ed9Wa5bagJeEJAIpI+T9wBxHB33WF5TGn2QzJx+iRVhYhn+U6oNRuYJPno\n67YhV5fSh91KyOHCymZnRIwyaNpSjZjVQn9sC9oGc6+EdCYmNh0DJK6JKE20\nyYOTQe9AnL8tZTigLPF52yX70RpjGSjaAkbMwGYfb3WoYfWC/J3PaxlNw4i4\nEk+AospdS9JE3eYGFD0MvVoq31LcHm1JirpyUHnzaPibCmGJ41zUT8JyMQBi\n5T7XN0fd+ALVFVIS3luBA/n6K+OkpF8yeVZ0RkYi7+H8yPqEUYyyXm+lmeqS\nWaV87du9HkkLaiD9o/x2+17oOm7YeF1cXsMgHJYgFJnJO73ANYaiZWCPgE/P\nR4UZMBgGkzMK5W3RpStMvLynt1jaSjwav/qhDlAzgWMTjpd8izhRd/GJ20cx\n5lPNLYbkG/XN8/iMVF2K4e22X3/VRCTi5Kg+P/Bj/ALjWxl4tAct8sy7ae59\nRYGal/OPcGVWjfg964YRo/RFF+MBTyb/sxUasoRxIjq399Ul8LnbjBPjCMct\nKupu\r\n=iWdv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"3c0316d749392012ff571d4547eada6bf483f8b6","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"feature~move_ioc_packages_to_peer_dependencies","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-3c0316-kb98ovf9_1591786713114_0.11419368881749747","host":"s3://npm-registry-packages"}},"1.0.0-feature-0f2dc4-kb9fork9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-0f2dc4-kb9fork9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-0f2dc4-kb9fork9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d758019dacfd28ed08a318ba1d98a7d47779a265","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-0f2dc4-kb9fork9.tgz","fileCount":93,"integrity":"sha512-VbXw+3BNirbVfPrE2bpCYUdAYbzmCPietWL5nH89Je7TZHOlLrBf1SLtZ5BvG2vMd/a7QCoXg1ZkvYQZDDrAGA==","signatures":[{"sig":"MEYCIQD2KoPYvtfEscr4IzyVtY5K5C77y63niSJCMw61R4XMWQIhAIAw2Z2RYNjL4scfWeLPicIWSWgF4Vp+tx2w6TekzEuO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4Oq1CRA9TVsSAnZWagAAgycQAKBa8t2IhD2XKUJdwuuR\nuTUoYq+F3BMCFQ0ZYPycY1KuF/unGDx5FNCenvjWfsIgzCGE4tJTmzBMVBDY\n+Wv2T9C/WGR4lGVqbjRPYEccmx/Q3E0ve8y27mhDxHFMTY9U4QNGZegKqgzl\nhly1oKia1Xa51f5mjY48tVzgHcn1sRe2M3s6WmrgtW5Ll1YMvN6jk50LjC7g\njhtSH+2mBw7yw1BzEDA/Z/lENpbWqgbDhOiXzcZJ/Ge5Vfd+zPrChDUs/FVQ\nPh2l1Of0RZfUT7dty1DsxJ/lOa7AaStyKXDoFQdup7L1kLWEc3CwDS+me+43\n9e5jxD4PMpg/OMCpzgKMNWzFQNGPPfSzaFL/J/mkG5RbJdqzAV5W4KFgLczK\nOZLFMVO983j0PEoD+YCJWjAZa88BZUwM/g2beRGBzAiOv+D6z0EusnaVg8L3\neDygitw6aNYdM9K8bJAToxgfFJj+nc+HUpv18y/CspDJMpkSNXT+yWbY56Ig\nt5FmeN1OMmogtWmzA4f2Kone6wFc3AX8seV6dIhwHVAVCfMn8P7HfoTX4hR7\niN6JlXRx5Da0qkpyBKAocyq9ur2pV90aXgE5hETYh2m4COAH4qvq/0b7u7Mh\ncZSaulVi9rD37KcaLN3+yW8VW51HXa29RTA+pDiQWWj8LBo3bqNvyrN4l6uH\nQArV\r\n=td7n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"0f2dc441658674ee13d5919e56c7adf9459cacd4","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-0f2dc4-kb9fork9_1591798453326_0.008971313388502544","host":"s3://npm-registry-packages"}},"1.0.0-alpha.22":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.22","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.22","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8bafe12c2da5c7d1e1fb78902330b98462d86342","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.22.tgz","fileCount":93,"integrity":"sha512-BR9XIw1MxLAEBQraJ0dKPKllb4w3PbdIcOkxb5K4lfTOJdJWNJXewvc9NqfM5HF6hjrHYS01xUez1WCZ/f3J2Q==","signatures":[{"sig":"MEUCIQDRu99aRsTN+1D6exZR+SPyCsdB3lLKjlxrQl14BmvPDgIgRm+3l9uwEg0gULuYqEMVB+39x9MIyXEcojKfm4S1gXg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4OvaCRA9TVsSAnZWagAAqSkP/AyMecMLKTNzGEC1kdNA\nOOyJw931WB+0H5BIscSuGLsqCgioIG051XcX+FEnWFwK0Zirqc0e7u2vVnIO\nO0kVKBCHXk6diQXogKWegVsuJ7G9xM3wU/UYAtj4Sn9Gm8m5vXMNwsUWF0qE\njxPJJI0asueUAAuAy8hE1/HAz9PQVRNg0UeiuKOzSeXRJGWidh8S8cl5u3n4\n9V8ukfzIcIINKwfmPXwAP59ufgDny2+6qBriHjT0ere2MsllIPjAprfpam2m\n/yynEQaHZM2+BGoDQYIjDFr2KEGGMzevhq+zQgDdRfFo+zxvMQQYymPL7dL5\ni7L2wt0dXWjCvn7uiGvdTgz4PUFAyrVQfbEdNdvHpVgUpCk2o8eQoBbGHjid\nZYwnFBL+FTpS2t0u60yAgBUoP3M4LWbMjUGMGyfwkDyhKlUqt2faeGcmAeNM\nI3NkRiwtkIUmyLja/3Tlgg3oS5naBwADnBcWVF9xn2wk8PxE8+HTZ5M5EFIS\nCmbJm5UDbYScyt6NETBPljZ4MjPs6h2bnzjLDw66RQr9+1fwpmkOJVhR1rq1\nRlZty/tQ4ay5GAMPZtoQa3PcNJKpnl/dGoEesZm3hA1hvB+jIsxXucWAEGbw\n3lux4NjH5BvfbSqr/2u/fsYCpGF53+9K5ugy//iWmVc0+6YDqaxHJ8Cxlmin\nXnWg\r\n=EaGd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"8d446750ca77e3fa064b9574b2078558e7e73db5","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.22_1591798745738_0.5420481497529985","host":"s3://npm-registry-packages"}},"1.0.0-beta.9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d26ad9092868d679fab2d226eb0acbbd7fddc7fe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.9.tgz","fileCount":93,"integrity":"sha512-gh5czjcocFpr2YvSMXIGA8kvCmcdQuHUfbR6L0mL8rkVl4bd1B0o//tjP30EZiMrVEgtQPBUqp7wBacvyu28Fg==","signatures":[{"sig":"MEUCIGzBQnbfoYILpGYMeFNWcYFODxI3ubc7xpfZw21ykAeLAiEAxxsvzwZY6g7JnJUwqXGDU1oHdNA0hZ8XwAV8TjS8ARA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6G31CRA9TVsSAnZWagAAXdoP/R+8pdfLbN75qNtGijCX\nTn3cy/OpEBXZi+lbG1EGlkm11m7aA9H/WhNvhvPpAZ+bzcf3c8nr9PJb3D7z\n81tDw3z+QE2SgpXdl1WkKcPbJ4tQnHBOJnaxy93h+QndofICnOq8IAZbBcCh\nMXeQBObQvp1uOIEMeS6/bPBUBg7cUDaCw+GVC6flyR2ap/hQnqJin52ohPS1\nSsnGdUBh4BYO4nf7yOOzcvx1gdLzUU/stS2E5i8b/GQGnQApiOKX/++W6DVM\nxoDtTa701pyx43E+sYiOVn5m5ThRCxQi8lKBaSm0ylo4ZNpd2nEGoxJLaj/u\n0hiVTEwpF8DbdK3bFwszLcXxOFks1idgI2md4b2B7UqlXn7WUEzLlHKCWmgb\nJfL6SofK4Xng1c4IL2+RGtP+AejKT+2WTI9w8jKzPv1nFx9wtJ2I5yv+Bdc1\n4InHf0vuL35EWrrT5Iq5VEE9+sINNhL1tBnwKedffxyRd3OhKgH769Pvqg+6\nEW65Gjo1O5UAej6SHc9erSMKMZS6bL/C1tVpFnC800T9x721VBV3Qa8yu6HO\nfq63IvfYfA6HFfY0io9q2dOOq/zuPB1PdfF26ACdz2b7y2lnXMue1IYwwNs7\ncDhg+pb1SJVm+EKrLNaGosAkE7Bku6r+P3zfu54lsnOVj12IoJBvW7USe37Y\n+YhP\r\n=+ZkH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"f3e14e92831d961e09bd4cc05c7446e7edf482f6","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.9_1592290805108_0.13910605385185804","host":"s3://npm-registry-packages"}},"1.0.0-alpha.23":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.23","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.23","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"22da5061cecca6a69a457e6ab34e0a0d6d7afd3b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.23.tgz","fileCount":93,"integrity":"sha512-8UL8n63zjpUNFAHPdfawD9eCfzibZEVTu+/u8hRDAXaRLEqL1UdftNTcvP8bUfbpG5x2Bo+gPcuwhJ5ziYMZOA==","signatures":[{"sig":"MEUCIQD83C5MoV8BHDy3AS6JHpGe9j3HFaPH217bIQSASGX39wIgej6kz9gzpcUdCZOjiE9B63tsvIu3inRs3o/UwIjc2MI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6G7QCRA9TVsSAnZWagAAqE4P/1ip2rG9QKs6Do8Q0XJg\nqQVsdaxn70IXQ25JAey+I59Rr782Cd3BpR2zL5DHa99FVNKgzwVKMFnO4T7S\nujdrrtAnoJoy1SBEIzCFejHAme1S1G3M9eL00B1ChWWkrkWe974juoN0ZZjN\nDOwaQZKq+7PAZAdtYpKOESGahdI0Y2qFXZlaHr5S1EN+tMrKpWFEn0uUvMEF\n6lt3T2yy/WjO52ZrMxlc7vG0olHcc268N6PhkfGzhxAuac5LbDLxWLCaH1lE\nL7otPREh1xzMFLL5h93anDkoUzRHlLGLwqHvCTRkN6DgqgQld53gTSJtIsyY\n+16b9gr1m5vSE8UMsdl49RBDdLDfwHw7WpdbCs/U0tclYEy9Oh8sTy7KiaCi\nc1WU7spuhO9yZGO5Lp3W8xKc7zigqpNgAw/uwChaNx9Zy+QDn/pdMjwvN+wr\nP0qeqX7fDNHtoU8vYLN5se0bxHk8Oc8jnI5Ofcd7MBnGiJGg37v8855XphSe\nkdrCtJnGhNdI/t+hd+E6aKwNXLYQ3PQ5+IEpxUg7JEeyrP3dOpmuXc0Kd1Qv\n6JsmoQ6Io0SJ6W86Nti75aSY2aWqYjaRHvhmYazWH8D7F6T5k/kzXNesrH1R\npQzdPwOR6ypAddfrVlqsqtgFgl/1N1zYhyd3VYMNVYeQPNKKJTETwMlXjjtv\ncgXl\r\n=iynS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"d31e0c1a2fca51cd3bab57fb625f4278ec9b9d4b","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.23_1592291024180_0.5021132716592012","host":"s3://npm-registry-packages"}},"1.0.0-feature-d31e0c-kbi1vhxj":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-d31e0c-kbi1vhxj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-d31e0c-kbi1vhxj","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"98de9e8e3f97a35988ef1d1f0cbdde08c49a9ea3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-d31e0c-kbi1vhxj.tgz","fileCount":93,"integrity":"sha512-SF0lwX/SGylXNnevMewJZsB23XxRiqQJLPb3YjSq5z9xGITEOQeVnuCx3b3bWOVk1EDPdJRShzjs5DtIWKndNg==","signatures":[{"sig":"MEUCIBm9OA+UKiVoU4khGSwfuJdXjbxaftJvHvxhKgVoLqRHAiEAsFpBCUfY0zp9OtgaJ9LLl4nnACCyiZTFntacibydLn8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6N3VCRA9TVsSAnZWagAAIr8P/2TcK1t42UHgzKRtZIzx\nveKQlPHpfPQ8SRHDDr4HFWt0W1qX0RzOZCeAg6s/yvV/s6cMWfPhDnxkz2RY\nG5DAHgEbXuiZidZOjChUdGgyMkm/lNnAennIweRCiTC3sk8LvGokfXS+raCf\nkICGMVRdv+V6fAIxFvr9Tv9xh4q/kAV+grryzSm356z7z3lruPrXy/ESfBr/\n+W7IiduFotShAfluY59+6d2mGMaaASZ9RwE/MWYgt/Z3SGVMlwfd/Ot/KDVt\nsXLDrNTS9qpBijRP/FQX9Zzwf/L5LxxBUq4SY4VYJOVFx2Ns4rd5YNZ5XNCY\n46d1kuEYaO7wlrFSX8XdC60MGvGcItTJrDzLU7y5dePT1/CYLL8GJs2JRU4N\nwx6FiCdMivDtCiAubmaC2rwrKmGczGkPHQDVqwq7T9GVAleFhtH0qt59fQe8\n666W1fIU5dcxdjWI6aU02U5k3JxDU1+0iaIkiSrUiVeh6Eot1NwXCF+JSof9\nddwFABxhl2ZjgmcK4gK9g0WLOZ0Af1xeNK5QVaIrxjUY4kugaSAmYC+O15aL\nLBkbfjt26FCypg8DrGs8HVvN17jWi6jdZyNvl94Il0t4LsTkHu2ucW9USl8k\n5SvZwExaJ/pImv5TdtCo5z6wER1JH1wDg4oGRZNs7Ee0zS9d/jdAADYFpRbI\nuUZs\r\n=iLGC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"d31e0c1a2fca51cd3bab57fb625f4278ec9b9d4b","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-d31e0c-kbi1vhxj_1592319444670_0.8435904891110244","host":"s3://npm-registry-packages"}},"1.0.0-feature-4997f6-kbi26rmj":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-4997f6-kbi26rmj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-4997f6-kbi26rmj","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2bcbb87ccf7f3eb5526b0ecd5bca38d338d8fc7f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-4997f6-kbi26rmj.tgz","fileCount":93,"integrity":"sha512-hW8NI6e04oPUT7nHyHw41S2+RDhn91McNyDmkC43VH2CYjnXZ6gwZ4QTnfvPVWDR5/vC6s+OO6gi7Ns4j59x5g==","signatures":[{"sig":"MEQCIH9jn19KokQjJN/5qIjNpZX9JpPkkysTPbeHedkdMycnAiA/RBxTIUNnjkJzOq4M1ndC5FsEmVqeQvt6FuFgcXJoOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6N/kCRA9TVsSAnZWagAAoZQP/3LeuJPfhUZrsgw+Ia4T\nYM9RFlcu6EcoqLr6jLAxUgsjLRYz34U67ZAPrudZwtuvwy2rW1SMtjelVdAx\nLrhKWiAgmrDOTU01BeTfkqsGkJJo6aHP142uzkXurO7ypXvx3zWZyRzqKA/p\n9dvM/zA0PplkSi0rnFAYmTtuHEvqIBjgiPDzOEciUlL5ARVJ9m7LDaGDcb4d\neXNrhkuxUpJnzn39RK8N/LcRgt51v+VE0oBij+DaP40UjQWWFDBhHO7ea8sb\nmd2z/Uye/MMswN9gic5yGB5es9tLAyA6Hfmee4qksVRBMzq1B/Hs6J6i1/Lm\nJXuxdvEaNPXgga4Pep5B48BZgc4T3sOh672dtvJYKTTkoxRWJSKsPg5NMLcd\nbI0Mh11ZLhkP6lzMFF+kuGt1aUOF5ZaIfJRV1CtTG+c3PKShUQhfqq/ctZdD\n3FqsANKUn5bsSk0L4EXQqyWdHLTyyqfQ3DsUCJYP1IGWCdMB+e9bfkixyWmK\nvDztKLe17u5rBPZrYZEImKntYZabEbqp4CzWPjqdoMp9sAmD4eG3PtpSgXB6\nyyvKyaITLX62KTaYvCaIlw+tlrMQMwQYicHxO6kAasBoRyvVjP4IBfWZHHeZ\n3+knFAIwXG/GcE+jmlRcYsIiTrWoCkx9eEBtBuneY22oB56yAlGSCDuKVbp4\nnLBV\r\n=/m1G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"4997f624d7b8f04b1d95146da1018cc04aba0016","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-4997f6-kbi26rmj_1592319972145_0.149900261194839","host":"s3://npm-registry-packages"}},"1.0.0-alpha.24":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.24","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.24","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"89975d2711097e93688ce25c0047e32644d52bd8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.24.tgz","fileCount":93,"integrity":"sha512-qlNmgDSdEx+lPB8zvzDPfvuLOpaxhea+B9CPTPDbXCV4mZuJxUAntTAdvIvRSmtlmuTlel16AlrIdv5KGtum/w==","signatures":[{"sig":"MEYCIQCTDgKZLad6AOGnvz6jCfMRr4uIgUH/mmzQ2zAOubluTQIhANHe4G9ZkFoQeJ1QFdZkoIck1pos8uZJbt8bZJMBgA50","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6P1iCRA9TVsSAnZWagAAnfsP/2n2DnVx8U2BLQUwemY1\nLAfC6kR4WG1ePUVSiN0JqFE9XDizcBsveKDjRkLqm4t4aJkaPUDBfw6AvrC2\nyNPZpepbQWuR7t7rO5CeKfihvnY/Q3G8TPBjk/WjaQgwKPKIHRZc2EVZqxX+\n04UnqmswTTLODmm7sj5EJFcPqcwjdQ04JtmVONN8lvLatQDJWqlIXvAbQusP\ngay+M2huRZnp3ru/hDDUIDJSkKt0S2O+9XTeehQnyNY3LQ32NgfYNepA3Jgn\nHYyg7i7MrO547h/BBsbR6oTnEarenHzOklQSPvQiSs52lk2YTd9LYhHKTcF8\nHyfQv9AidCLXBBRAu0W4hiQv8s1DyaLVHsWcNsmO63l9lXWr9OvNEKuHPREk\ng9ire6KILuKRdIPxYFlR8A71Be8WqPdzVPtocr4WrFqRFDMGFYq/eT9YHrgZ\nTSn1yxjeJZPdN8KoQkhcHRpN3s18ug++FfxjS+ONzNEfUjc7MCVQo/4TJ377\nfLkvHVdY0zuHknvFAEZSQzWcjT0oLy2gWVEEK4Bd+V9UtmPT/c4yUQmzI58b\ntFxIcUpDJH5OLJjHfGPFLJWcxA+4L6KQoedymW4xEHyKQLlupY9QReEWvDpl\ngKTAK40DZLI1JZXw6vDiF7b94NKHdRbbma7HxxMSOV6fUnKsKQuO+Q8TSH2J\nu2Th\r\n=e47n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"46b9982fe06892fed8eabda35dcb17d608377e47","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.24_1592327522149_0.5147669975969562","host":"s3://npm-registry-packages"}},"1.0.0-feature-18906a-kbko7f9g":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-18906a-kbko7f9g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-18906a-kbko7f9g","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ad58d0ab56c20269d263e97e2f7b0348162bb227","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-18906a-kbko7f9g.tgz","fileCount":93,"integrity":"sha512-gsTP9eLQNtCj4qHxKjfXhAP8ICcKxR1B6fG/6k0YsYaWzDLfdUMMRUhxTtHJtC6O3XIRHI2L/ujvEso5dS+Pyw==","signatures":[{"sig":"MEYCIQC8GBEZNFAg9zpRXyRDt+TGLJ5U63q/oFhpnXZYKKjZdQIhAKAQmEiq2YE1SA8lpO/AZNMQAIMeChCfe6VfUoYPVvVj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe60i+CRA9TVsSAnZWagAAGagP/2/FoqQlCWcnD5qYlS/A\n5eQdLHrqW5Rn2i/HXToDlfchEiJaeCg0tW0hQa77ZdPKubaHCHhpJM1eotd6\nwPtY5L/bCBeSEwKcY8R5XkPG3YKtQtPTQX8fOrozhAy7yAeNS+LNkIk9ULis\nhuTESVR+iisQMMZmrFBK3jS4OV8ECTFOEY95+hR6hlVnzA3sqgv4euES3B9D\n/oBcYDrG2B/3BYihab553ziIx0UvlPY7QVOIAEjpWWCP3WvZuBa8HvGtHCO6\nv77Z5wr8//UIoPN7AWI74ATAp77szDE+9wU/eQJeAZD3SkN45FGrIDJR0FTA\n3yhmMNcaYV1LLIpBD4b8z4Wm3mrzN4ovzIueRiITCTc3hXRqv/YEfeLpzCG/\nQ9cbwh79LHVUOEAOOHQOnA2qrhWTP33p89NFAPBWdkXZKXUwKPwD/ohLGZvp\ntZnsFhDXMpPqvL14iB0pZaTAJB1WCvuV45car2HlNN2D7WKIKJV0HiSFKT0b\ntw8PmxZzVDVEdYd6aa4hnzzgI6WtBv7EDRae7Gc/qgjoEbpYBt/J0fQfkWw3\n3XwUpc5EyXIrCur8yaMFMAQad+nAOwyI68QIQALaMPQ8H5EdKAK9KzbFAheJ\nqRCJ0LICVmdbcHBe4VTwaiG99DbA3V1GyFaGpbBpi8qwXPHV3XmGiAGSfeCE\n9zaq\r\n=OOea\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"18906a5fba8ae8f1f28087a5d6909e61a6499484","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~remove_payload_from_signal-events","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-18906a-kbko7f9g_1592477885876_0.7384887004832879","host":"s3://npm-registry-packages"}},"1.0.0-feature-46b998-kbqhp5gu":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-46b998-kbqhp5gu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-46b998-kbqhp5gu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"12626963c519f663f2d1dd628b7088377b44d4b5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-46b998-kbqhp5gu.tgz","fileCount":93,"integrity":"sha512-xCRhiLlPUGp093sZJPAw+O2vm4//Z2ed8zQm+/Es+LEevtoQBowBDlzwwrtQkqa7C9fYhmajCkjY/+wqoMTUmA==","signatures":[{"sig":"MEUCIFNgPanGUOSvwXa9S1zhMzsNTYzHLwDy14JIrIJaE6wnAiEAynpJVBubxyxKclwYp7vuCKvKTO50jc8ZPTziqCZ9ps4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8Kc6CRA9TVsSAnZWagAAvcAP/ir50SWSVKAI7xOI9BmG\nWKETTHyEYB+mB/tvYMTRndehuPPxle2xKeU4ew2k8YS/0gV4AVXBH5k4Xz8N\nyd+9fb8up7ajmk9DTG2SX7xagpAVUuMenYbZFw5gqDAM8qCSW5kbIDgcg6Fl\ninb1C7wvIS/KbWcZohO/LBpEEW+WzX2X27mofyAyvlybd9YYzlDU1YxoysBf\noCOBKZ9OsdrJ1jOB24ug/wcwWWbmgLtFeeebZT6B/IgBR4XI+rFB3ag2war1\nPC3yi13tqPimKz7bbagVco90QtHSncFawiLIzWOBdQGbRwNZ1n/06SdQ1A7R\no/vpNkV08fq8nI4/a8T+s1AsLYsdO83dfU8Fs24RHBcjJ01OSL4B3QCXMr5y\ngq8sqgYk1u0vfkcwmtQV1XEdY2MVdRzkGj6Trd9bAXOY1GNi10kE7h8WF5YF\n/peDYhJD1KBk/iYmqyNlBFdJ8hO7Kf3r/zY5+v6dvViUieJBs1CNdaOVTXVf\nJlt2GC5dctFqCojClNwLbtuixj0SGGJ3Pq2MRtvb2QIr9tJywJ6BhP3+JLbk\nzESULrC/yv5qAcPXRyz0b3wD2wpyKYqwbEs1Mq26yP7P4GuEc2/cH8oZC/F/\nbRiHUcBprMDIsMfBvENfkiWi2PASVom9Yj+KfuVMEVtoBZ5vdKF/IyCZopHo\nT57a\r\n=OyLt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"46b9982fe06892fed8eabda35dcb17d608377e47","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-46b998-kbqhp5gu_1592829753363_0.22104427723591713","host":"s3://npm-registry-packages"}},"1.0.0-feature-e62beb-kbqhq0vu":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-e62beb-kbqhq0vu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-e62beb-kbqhq0vu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27640fb9677b2e7c6f29e894b431bd4fd77b1df8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-e62beb-kbqhq0vu.tgz","fileCount":93,"integrity":"sha512-Pr4X1Rr0+MF9x/zk45nVQqomYHQ2GddNjLCM6F2gPwFjbheIuqA+Nf6mgpMRL7qZ8rxpeVik1pbppqm+Ld18Ew==","signatures":[{"sig":"MEYCIQCw9gDu1l7zszPi2VPz6+q/nAdYTmxwfk03TQsEybw9QQIhALSY6aLyS83sumz4JeI17l5gQ4HMnO+V2waA5UFXsKKg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8KdjCRA9TVsSAnZWagAAXJkP/RiqZScJXYqJpW+L3SV+\n3/29FYKk7lz9q7RK67M09zTrwoepm2PN4lVQGMi7/HdwN8r2mMtZm0YwicS6\nfEQ87Y+qE4aQKlxfHnPTX4GxxqmKkfabh4UyJjkVEdg2B+/2Ahnbaike3A35\nfpS/W1pGX8hH09mrBwAWB+Vk1PmbJ1pAp2qXE6R0CC9RpEwRHLt0NJ1TwAaI\n94xcGyYq5tEnA9/jBz5DHCtva2TS/Vmzau5WW9N6fVJMVGmq0sC4x/KEcfNF\nzJ2Ku/Sb2lmV0qN2PReMpEISbrbtFiyTFUnIU5dBY3v/Mgpn/u2Diacsp9+S\nIa19SE3pD629r+gAGrMqtx8wHEpsOzYrW/nAEvHxMPnKEwIGwb+B0iU6YU9Y\nQMvDNwWdn+gerRHUIbrSIaZqo/kFlQlMCkLz8MLqruU6sq5P7cQey72MWuft\nXS9wrGsFgixrwsMEeh6Pk6wY5sdXGTWJ1mcq6hoY+PdQQgdzz9C168/b8BzN\nV/5J0dS2afA+nRrMoOJNSh2BN5AUWatFH6FpVXB3HfIR34W8SD3IcY9PEZpO\nrCJS+AwAZxHEe+0N5jXvWaTtKOji3leR687gwkxfupbuW0duKpXMc4yP31MZ\nG35YIrbKBtInCRIPkFBAR2jVhrZ+ra1DP4tScusYd3J6hbYOhd0Htjmq8Dvo\nhOkr\r\n=r9Ub\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"e62beb016de55e26457fd1e222e27ded7392613c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~add_processmodelname_to_processinstance","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-e62beb-kbqhq0vu_1592829795006_0.1129100284977782","host":"s3://npm-registry-packages"}},"1.0.0-beta.10":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.10","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5c4057a94de09e92c11ea18d8368d629300a783a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.10.tgz","fileCount":93,"integrity":"sha512-wDVHfO/JZgMBBqiiUNEAKtnkL3e0DhcVuIHMrplCFpywZyPuplDrO/Sxk9w6n2WCl+1DxPJWLfiP4O0wlAocMw==","signatures":[{"sig":"MEYCIQDMKiZNKQ16neixC97BuSl8p0nX0/kmq4oYeqxZnulsJAIhAJBFTCzjThvh7fSlfP341qgMWpuXIveuiaBxazpgeDy2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8a8lCRA9TVsSAnZWagAAEwgP/R8tqLVD5lb5wuuIMd9X\nvadTvcVUX5XTvl42lmgGpvsUVAsa26NqqGWiwt2zSgVCZL8vDZ4aXIlJvy4z\nEuzJQlb31X2oFAj8eK16f/roLrH+2omBihSQb4Sh2DYLa8sVz75E7wkTTHgm\nJRPjnPcZKwVrQFYcVNVtFZr3uR70YjMCKDFu1obPcrHMuUUvlbSUajZBCkYG\n3/yL9lFjQP/b4RC74bnUOvl+Awq51o80pBZ8S3LlR4g82QcYqCC12BTvJglP\n1wDJaWQyhh2boIjrmCyijgYm9Hc70jSsdaXxUK6MzM0zX3MfL9K9OdW4+HZn\nfFRbjkil0bVycSVNiBoWbnPVfE1TMWxT1dgXfpCJ2nK+e0aV2GyY0O9WFi+M\nuROs43HN8/QbMHiLqoMinuA6T0jtDU315g4ioWgLAES03O/CyLEnDyDy9fbn\nrY3d4wm+yFQYJ5gColtMLJ2I+3D/gPWx8/L0UgZjCNVlo1K5OqGqSkLCvsc3\ndXWWIWxiNyrhcOS8eYWAjF4szFX5bfNPSCTfJJTXA30C28KdWxrkJQGVbZ46\naPMcYhr/uoE/sj1sTfsZkSiWgcEiaFNdwb0OExlf7Qz8bDWj9nEuoau0NsZi\n05xK8yFjFCZgSXCCJQI/sKQcomZA6RTqoQcym3KFEwzb2lSs+V1Lb+Kc32ha\nRVUU\r\n=Cmeo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"b2d529aaae6a1cf2d76d0bfb326ee2f83375dbb4","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.4","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.10_1592897317202_0.0736474486236045","host":"s3://npm-registry-packages"}},"1.0.0-feature-1ed13c-kbtcp5eu":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1ed13c-kbtcp5eu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1ed13c-kbtcp5eu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4e5e3a2bb42c16021d5062681c13b39245cad06c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1ed13c-kbtcp5eu.tgz","fileCount":93,"integrity":"sha512-2WlQdrTcvj0SAJicqVdKrfoT95d/T9t60wY3Eq4AOpCR++VbEgWBPKi89daRV9B7ga/F1Tnacj0V/yipcAnAWQ==","signatures":[{"sig":"MEUCICzF0DszJAjxxGseVjW/ZgPMtDYGV2JTyUrKObGzC1LNAiEApQSOlj4CmbHaijrDt2fJhSSpaoMDQIUP4DH1MMm3FK4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe80sFCRA9TVsSAnZWagAAOWwP/1choetqhnhRveVLuoGB\nGEHUmH1JShRZZWn7UWFuHdGaqpO/dd3qZQzVyqhTbi9/W6yzlAJF+xM8Gp6R\nH8NegkMSYjjo1tk1o6WS1u7qFg4cUPkE3Jb6LYg94i04FcQN0rbNtnBtcQ8T\nYKnpTullVII8+lfJDl7+LjvI7Xw/CMbAjjoeQt5ZDTdPpLKzr34oT/Ei5ayd\nvJnArLkbTPZyDFOwqSHWarcjWMno9Yb/mJS0L7rO2tS36DSUQntWtrCmFCDi\nLRconULPh3dN2e2sa1CKAkLXjSf4lWQzLv32b3Dcc/ot5gyKmKK6TNpJFq3Y\nwrzvkKZHmhiwPhK/361/E89CGfZZKJYB4smtYksr+s/YCsyJFppGuFilbfar\nwuKnKL5Ej4ZKqRpbQE7/ST2ufsLjzZT7rdvV09nXV7VwlaekyP9BzqpdPA0N\n5/zDwIUXbnAEvyJ7PumqaXHT7qnYXuRwlVG6oFGhsORZcRZan1u7b2uXzbUO\nUocKuI3qUj60i5MYSxTzpxxtAB4CQMyNm1IeMSazUCRdrs7vDg2qHdyUe1Iu\n/kZm+ha7/jQex2P31mqDJXW47EUY60D61u9vuLQTRUTmRgzRAwbzhpAgPJN5\n+iy70Wubs1PJ/RvKGbY2VkAj5c0jkNm2bTpy5KWVyW0jTptASeeJbUJRZCyg\nqL/5\r\n=0vdw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1ed13c52aacbb071d06da2e2c61fc722ba28b9ac","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~add_processmodelname_to_processinstance","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1ed13c-kbtcp5eu_1593002756586_0.9260025167938963","host":"s3://npm-registry-packages"}},"1.0.0-feature-b2d529-kc2160iz":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-b2d529-kc2160iz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-b2d529-kc2160iz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"75e2c8809a3c05221886d36fc2dd62b8a430b018","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-b2d529-kc2160iz.tgz","fileCount":93,"integrity":"sha512-PiBL/Gbc34F3MKU5WWEH84D71AcV8ZqgSNNuyK3DSmGQYCUw3PAadAtanenhrxV1q740DopsK4xXZFBiwXA+QQ==","signatures":[{"sig":"MEUCIEezC6erz6eFrNHgXqdpik2hb+pinFcUQB2QfDKbt1QTAiEAmHaE6+QFMdg3v4rBpJWrqVXUOeH1VgDtuOM8l+ccFgA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+00hCRA9TVsSAnZWagAA/aYQAITvmanhFl7hQRR6rbOB\n96h+jCt2OqLq/4YqlGL6MMTfmYvwv/WeFrhhipK4SqYPrhn4F1uFxGF5DAok\nOfPi9X/BC04dZ3yf+xJfUtiiYuncIzdVDBrIXHrJjDEZPDyGsyZqH3bXvzD4\n8OSwSvKH9nvSMTCt8sn8iqYvHsY1vIpktm082wsenVfkmElNoTXjRjF1Cbh7\naNJJoiXYs4IHBZTWs+5XbA9VmLU6cD2LY8IbvJvsfQKF5SuPxq2CLR7CXIcN\n/xrNvjRtIhkzCO1HW4nYcxrRWEB11oA0dH0pxRx/sbSSGI3MSlxfj9eA3EOH\nP8h55QLnNWItY9hl468HOxNTEiJi7OdgGfZGxsW97d7uh8jiQAwr928mE87d\nNxiyzAcRYA08CRvAMrUi8NS93BDv/97A8zMQhLE/b+GcVs4wEGLOSC3rsYNq\nM24ptI2VaaVwHwBn0JDgpymQy0VrMDT0ipPVHN7ikuFrHQ6Z59bMtaHLET3R\nDXZgyGvlojw9k6FISPl6/RF5sMyI9+sTfJMdSL5pHw7hAXBkXvh+UcE4ePFm\nELHc4f3+idyIu+neOHMBKxNPxkQF4v2XQFSJWoGXzVEig49mj+MGqHTOx/o4\nkepwXrhSZFHRGgNQHZjg5yVz5EEk3h4V7BWtmiOPb5sbvIR8qO2r8lFfN0+a\nXfi8\r\n=cln0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"b2d529aaae6a1cf2d76d0bfb326ee2f83375dbb4","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.5","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-b2d529-kc2160iz_1593527585059_0.19193305339607236","host":"s3://npm-registry-packages"}},"1.0.0-feature-233c2b-kc21ln10":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-233c2b-kc21ln10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-233c2b-kc21ln10","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2e8dcc5d2ba8d3b4c0b7748a6b1e70587dba9caa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-233c2b-kc21ln10.tgz","fileCount":93,"integrity":"sha512-OZqD39oaowALALgsiHOiryOujVHsBV+oLY5Fm/9SDtxN7dx2NtvlNZ56TCgxlJcH50rXdVDDstn9YUq11DxGjA==","signatures":[{"sig":"MEUCIBcgntx8tumHRutgNkF3d+A9E34x4fEXFoy+2MnRPMMmAiEAptgMmpCutp9v9ITny/P2SQPnH/DKZSF5q86fLcjKLG4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+0/0CRA9TVsSAnZWagAAESYP/jnXrl5Hj+Al6KY6wcZD\njtYgW2sJJwdiwbkW2EfCBRh95ODzHBlRrV/9ghQBT77Y8XGciyM/ljpH9QlC\nILxfVUPRvH3CsYwcx5mdT0+i2sQfdD20UVKiC3BwG93bWD8SlgEz/Ukgvmqh\n/0IOMuKhHbvb16wfkfuW2R5dvZMG3HDM7owNu12lpB7+d8YyEFdSDq4tQhAP\n8rJpgUKZK/Hf7dmUzMBnWaicj1VlOI9YX+gl2+pGUfZ5q2AjMmXwgvd75iV3\njuiCAk6HsTpxMfZJyNcTeALuyl/QfM3sV9OFXxCJCFUNGxswScVAEJuAYDqY\nq8zGJek78ctMfcztm+Ijz2DAnOY2VCLwk/eoXA3TUiNiz71J5+TUbfOmV1W9\ndaNi13iGKn2g6ujdnbJxzM16DeoSN9IjZMpW5n9IMu/wEmzFnNe9+5qcRX9m\nEH9YwxSK4T5GxEJOPadm+UtbPzwJHnCJnuqRpQ4ZFlnqalV3WEkpodBkT1lN\nfKHF2uU0wDoMoCu2zL6uoZm7Qi8up1tnfXTI13bFYebH2Gb7upFmoPD9xjrW\nuD2RPWL80aq3htx+BMHoH+bLcqRGaUCVm0kvZro2TQSXIns2t7J9qxLSnq73\n76RyGr30CY1ZHJSaH7uzCTOTNwAiW1UoGo9K4PPBQ+Qm6xiCdi9x2F5Ew2gE\nt802\r\n=yjsn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"233c2b9ee4b54b84ad4c51af6cac760dd05769f4","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~process_instance_context","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-233c2b-kc21ln10_1593528308421_0.7145145092383649","host":"s3://npm-registry-packages"}},"1.0.0-feature-00d40b-kc4rqd5j":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-00d40b-kc4rqd5j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-00d40b-kc4rqd5j","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bebecea5456103c13ff410bfa0bb70df5dbe9886","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-00d40b-kc4rqd5j.tgz","fileCount":93,"integrity":"sha512-SZpstMz2Gx1vtHx2RPX/p75/e08kavqd3GC6kvZHN6TPbEwLQhpfRlfHMyJhHT1FVHBh97krF1hdIPz8hx4Gvw==","signatures":[{"sig":"MEUCIAzJ0CjbQa20lqpY9xBc3zX414MR2SySeazQzQaULzQAAiEA70IdREurQcAnw5HE+QzitiwnJz1ffjGKiMObUrkrpoc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/dPPCRA9TVsSAnZWagAAlXoP/ifzr/EkDbtKeNJIUqZH\ndvsdLddQ4oE6owjbejTBdWtmJ53tHU1PQKj7BpkDThBXK3k7MGDrrUkLLwQh\nI6BrSUfkSguqi2emi/JB9kAnxPm0R3Oy0liJSgYVVLdMoXs0rqiHao0liAGK\ngmupiyqmm0nU2L/0tNaf7VSHnkt4TlfTMf/peQuuX0ksaiIc0PEgCYEFhXfU\n+6X2XeuMe60ZZXxokdhNfxkuB1BIhEdlLY/E/b7xAjIk7wnnpeCPTcEenKdW\nG7oxf64+iUX5SlxdZBYP9WcOZ56QTkFtMn254dlksvYfLT+KvzijZRIQ5PxG\nVjUiwkQCECRGG0N5XQ1W8jlK6WPbXgDyxfiDZeYkNEuOorByRt3iIC23EvTe\nMJLOR1p1YRxh2SC0dZCVyjD+H78zjKIff1fmSjkOwFIJ+GdOHcZv5jm+Q2Lr\nUEvDigv65e9ONg46+Jyv/Qei6wf1W5ORndVW+E/vki+IQxx0mLmF4jbPfklZ\nQJfyvSasVEdN2NsmjrmyxLjpuzQ3GZRcSUWsvi24t320or+U+rqzdCI4vcs+\nClYP46NTjgp+0afdDvBG+UVm5vZBleGOy1xdzc8W1+HZFV25oRyhRSnhIes3\nT9+28Q/0SyfHElO3vFFNnamv0kT1HvR1B9WWvLwrmP+piFyKZo0s36+OH8P2\nIegi\r\n=OXlK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"00d40bad0bbc0a38c02325f226e694a48a5d2291","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.12","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-00d40b-kc4rqd5j_1593693135411_0.5817543329210983","host":"s3://npm-registry-packages"}},"1.0.0-alpha.25":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.25","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.25","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf4977c0e253774840781f5cfd3af58f857e853f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.25.tgz","fileCount":93,"integrity":"sha512-PFA60QUTje6pBknuy3QN+n93znMcCSMWbDda3O844JgSUSDyvZaDrF882X9uuY/rXymrCQL7mCQ7eg3kjuP9Ig==","signatures":[{"sig":"MEYCIQDI11KvK6Gcal8D9Aksm+AG32xMU2GqF/Hl25kjfHBXigIhAOGT/zur0+RJsLKNIR7gZU0Xd1TriMrpiX5mWirIUDHU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/dU4CRA9TVsSAnZWagAA5ToQAI7fQcQkpSsi4NyidvNa\n/Ygqq8xe92/e1ngwntWVZMqnPqsfWTFih/1NhrmyoWGdrRJlYCuvphjxi1ji\nfH+8z2GBLmVHGAKJ/nr8h6rsm4VW0kteD13SrN3SPdc2gWS/MSdFGg2vIRRb\nYGwOIHyHXnTjMjjRlTatVeZMbYLCNefsCvklCGAWwWQMyyu89Q/w4QeIBOhg\nTelwY8B59/i+zKXCBAOfuGzGpSsauMnxxBxJJ9ic1g7SCac+7sHuWhfzCHzh\n7FJV9Ig3DbbDGpyl6MaJhqv1ri+bcgiRhM2SLx8Ub6f/cSf/87MHvYDOkPXo\nNRFe6DCti9c2FQEZFGkaldFZAWbqXOek/duogbHM+R8FqSKsahzBqJj2E7Au\nQB4Y2/kxiRfpr6j7ofbLMWZnCUY27CxFwRcbGQMm9ZiXFfXx4MHWhzL+OiPy\n5RL6ej+Zr+zskoPt8VmmSmHefI7rvKPAVDRFiN0fdaIn0RGMIjlGNAVPtgPx\nbGtXKbkoArDXEj0Jk6wSSrBJIVk5os9I0cPGAm6dvtNsyagxCLFNqexUgV68\nhOlRaqYDAFh5/amXjNirbJ3ymXvOvpyMJ7UkN+lRP5mLfFWjWtEZpbcC9PrG\nS1nuY2PfUqLbspBHjqVgPbCT9hds83yXnySIqXCmPI437h/bhprTGhLLjs83\nksry\r\n=pOD+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"bea2402ecfbb2b001c403346fc475b8e003cf82f","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.12","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.25_1593693495676_0.5706415513776888","host":"s3://npm-registry-packages"}},"1.0.0-feature-10d0d8-kc4sdbq9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-10d0d8-kc4sdbq9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-10d0d8-kc4sdbq9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"11c314d56aff701c0f00d0c20c24098cc07b4003","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-10d0d8-kc4sdbq9.tgz","fileCount":93,"integrity":"sha512-DUwxWZRXT/gZ8fmsZJBB6VbDXXde56lVxVzf89D1Fh3B1XJH5xhF8GL3SoqkH9T6ffW/sFMtlWMi1JSmc3oBVg==","signatures":[{"sig":"MEUCIQCJwxFcX81c2t0YH1o/wXPkBmhh6j+zJq+7X5vU0hblqQIgMypP6mn/DcSdHHIcz1/PeoWpZbhMLpicZHX78wEKxww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/df7CRA9TVsSAnZWagAAB00P/3gBJGEhv8+V16jSjr46\nNIxDfRtL8GNiWPgLSAsqQioi+BLmhYQUcufltcEnMPvXEAfFzaJ+m+DtW+go\nDYQD9poSW9qzl5eRcA4ZZ/e0RJNfdKzW0E9JNg8a2xTzrD6PJ1ZastoH35N4\nTXqUsXIu3Bq1+zcyBA8jwTvwRdONht5SZaZTNltVr+6hI43qygkSppoCQnRQ\nOJ4HFt9CLjHv6+m6+L+gZ3anapFoGboswf/npodw7llGCt1gwcxbqS1vCVml\nWQhtE6psIHP+j5DPk3il7ZKHdd/jveYuSiPJdOrznk1uQnCev0mRJUpR8VO5\nRuc8ys/GENCIUh+bWRbgKPGEYAAA0qIfcf2wkQ2bwgzQxWewhs4JEkqLrCam\nE7VJ0MPzrmV8MKH3a9K4VxCHlvwKochuvuhOwGcKBf3cSDSeHlDY+j+fm/6r\n6dlYmVFCC1xCTjFYSD43RrjyXZa+oN57B/5QA/6c3NmqAORHh14T37nf+YAe\nhUWvfbVm/y2C0IdDKbqT+qcq69QTNRlPl3a0wKwSO/WOpTkYEPWdgxr3hT6F\nNz5I8ccddclDDD/EaGThjnEPhY/gR9q4bmELFM9M3eUHvwKEKZ0hvg0rPhkd\nAwT5/sT1ItmUxD70HahtWMvZ8VXVmeBYfN/BJbs388ebB7tZMNpEhmFhR6sL\nVhVX\r\n=w+Kq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"10d0d87a6860da4255b699519fb2a0f53df9f3ac","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~process_instance_context","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-10d0d8-kc4sdbq9_1593694202961_0.8161884968246715","host":"s3://npm-registry-packages"}},"1.0.0-feature-447604-kc5wvmho":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-447604-kc5wvmho","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-447604-kc5wvmho","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e2d32f2302a5fdede9933c65db9e6e40cd3fec34","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-447604-kc5wvmho.tgz","fileCount":93,"integrity":"sha512-5cOQREusQwhupcptcqSnhiDix8KDVXSjkTPw24Q6ATEQzGxe4DciX6mMKN7QgNZwJhsspcsRtV1qsvuvnSlMzg==","signatures":[{"sig":"MEQCIDHIKbuvEkd5lvekYwZIUBxEAtNz3xb/chXSC6+3ph3GAiAz06k/7LQw7HTIutD8JSzBVDswC6kZVkBrkWibxIqusw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/uHBCRA9TVsSAnZWagAAYZwP/0EfqzuKXBK1GZG28iiZ\nPWUQX3O85xpVuP2q8Ndh/I7NOhwvApAA/7BfUI26mT2Vp3sYv7y3a9WFkSmc\n7jItvLW1brSr5EWieLVgQEzsDaCINDwU+Ja/HMgJbgogrm+IhT1rLzXMcAoT\nclrxzJBujiX/Q1wvdT/oXLMIRd6yRpFsIXi6hYkI0BsGr21L6WFozKqa8R+t\nzz9+rnmTbKWy9L4OnHXVCMv2H1z5rnNUIs4GHJuTii6Z7x0ENMdSEYd+hJU5\nec+drw1oo3efy0sg4anUlXr0qjwJxDPMtkcInGUdNEeldCCNHZ3EcklsMYqx\neACyFKpL2pbKHigXCY5bEM2U+kEeZ2gpUKKaCasc47/xaNBaTP4SllxsXEwK\ndSt/vbzKaunbROTo1YkAiFxR73Amj4Y0xxI5Vhtol53lyzvxSGsQeGiS7Fv5\nwWzolKJQsR6IrAyp1WQOe1sDSHXmwYzm4Q+dPL0y6iSCpJvSMxwe+uIItmpL\nYIVb7EA2Sm4sniK5pdwLZcYm7qd/svn8PKYaVeQCTt+++j/bvojncL+QhvzD\nIR9Sq4cVTfreFj+cndwJ48C0Ov1gER3dwe7RxbwZEcVr/PrUyA4tAUoCXl3x\n6SBOy1MoAlvnZJnW5ughpgUU8CpYdWSUhw2yQPC9Zy8VVJk6OpWmANg81zFc\nO9eH\r\n=Vx9z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"447604072a4e229e077b69469580209a1d17f21a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-447604-kc5wvmho_1593762240883_0.40100979846156815","host":"s3://npm-registry-packages"}},"1.0.0-alpha.26":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.26","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.26","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a931e8b715dac28555e0cdd4dcc2ed03cdbe3457","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.26.tgz","fileCount":93,"integrity":"sha512-cSHLtTjyi/pceSy+6Huwop8SRMdNq2UYXH7a4EYWb994dxU/LRMvQQVvEJfk7u2Yvdp1aqSsrV/kalvHT4mQsQ==","signatures":[{"sig":"MEUCIBad57Hp5k9A80EpRw1Q1jnQjSdFZftqX2wpDTa/L6NoAiEAy0q9I04b4CEM50vopqf2oGcVxBCMyXo+DA6T+C0j3uM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/uIoCRA9TVsSAnZWagAAeq8P/iIMZs2zDFP8B5s/SKtU\nWFBg2l306TRZy+7wkQtCqtYi9jXvuNF6LY4yIv8FS7GMGWpwndibaQ1OroXY\n4qkWE4ps8W/q/4hmfp751B95FzkKvonZJ88MKkee7uX0gV3OVAOXO2yDHFNw\nD5mvhVSZyDFYvzMQ6TEirgQs5VrUkoBJCC5HJOAozSrBoHHF7E5GAqeVw/zT\n66eoBWJzKk6Qxj+aEUm1bOa/UcELeQq09PaOjq696Iy7FHJT63SN87CTajqu\n0fnr+Arl/hQiPSP4kKUu7l05V3tUMEe8HibyfHj5nNUO8CQxtQ52/6SKZfxY\n5JS+l8kMup19L2hBRFOF48WOkoJcOp6OkKmOFZgBZATeyKp1u6hxFd7VuyGn\nNVo5xJgthA9FOtDSUvdgwaj29jRWwyuq2ahhn4gdRykHj2Lh1y6R0BsWcLNG\naG0Z9jeMc21ToDU2HsGA5hHUzLA2f8thJLZdJFXo8EmQ9kUrq64C1zXSAnkz\nMiUTbwKlMp46tVrwX2ozFBZOL/1/02EvLcyPFb3frdGzUpaEs1QrM08lmBsi\n8FEqBdM/j9ppxTL8sg2qyrgBMh/vJyt/9E4TVXqoHraporvDJDdwmUdMp5Bb\nni+fLB96IJQ/+e0MKw11whw2ICPqLHcQ9qj/1fyHghm/YfMcPZcgYymOBpFP\nP9Ca\r\n=rtBF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"6e9966399489c1bfcc9031cf9e9f01cd90db62ed","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"clone":"2.1.2","moment":"2.26.0","express":"4.17.1","node-uuid":"1.4.8","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.26_1593762344110_0.5710945310616751","host":"s3://npm-registry-packages"}},"1.0.0-alpha.27":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.27","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.27","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7fd488fa797f4b0375d69dc29f17707ea0103d8f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.27.tgz","fileCount":93,"integrity":"sha512-hz3vW1ovla90yzX2+1V+KNGrZLDhc+YHJKr5GL94K2oO/ha23xByvyjxV5piZZ0R+fh+iRPL1iXvDOpe6P5Fag==","signatures":[{"sig":"MEUCIQCjLZLQLuZf6QNnI9eSY3/XcjP6uocKPH5QylfYYF6S4gIgZoxdcYJC17LWLRQemCvCrgWVaybWGlREbbdGiFdbf1A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAxNZCRA9TVsSAnZWagAApOcP/1M7yoDHJVRc+TsloBCo\nJBl8cx9xRWh6uzlzs66x5X1VZ1QyERrudrxN+K9uXdYjvZxuszfYCCvwGbfY\nHsscGpn3DHCA+24svoLmUf+OI97hqSvIK5S+RCxQ1oH6X64qXp5QGvWbYLs/\nAwKpAc+/fBCmiul+ImYES/05iy0PCLkukQGpuYsItK1dFDax0qYMDc5o6hpC\nt2AlJyTrETwQzxElX88i7/O+WFXDmZ0mbgCT4AUhw9M4bzQKUsvREuu5Sijh\n6F9sNloM80WxjqyDkOmGSmFei8pB+B4LsiiFZyteZluyu8VpFgeZkJX23Ieu\nxEfaoGMZgwgBFylsS+ls8T91ipGdWEiPNICmJJ8d0BigzxMz9OmKZJ7PDoLs\noFOviXsuS82aX7onQca75KWQYGSp1M03Uls0jZm1qpiq4TDMjNp0TiT5v5q5\nzgWRlx/0uJbx78HSCbMy35UQB4J/SeSIDeNoiSXN+sLU001aYED6zxmvzcRZ\n9dphF7cDsvkYGwiiJyb1RmN6E7JgxKVG8em9Msc8Yd+HC110mb8CRvfn3Srd\nbeuSGLwDVG47b0CqoPbE4txhZEUabsnVDwqjTylJsZ2t8PaWMafdyFpkIFuz\nBPNn60aEqm18z57QW7ha9LNW/5RDAC4Pk3ywOF9/T768QVSbTqyZjZ6ff+Dm\n71BL\r\n=hryG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"15d2431f5b3d1a160e9978ee102fc0d1b2f72237","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.27_1594037081146_0.9452440030410223","host":"s3://npm-registry-packages"}},"1.0.0-feature-15d243-kcamqa8a":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-15d243-kcamqa8a","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-15d243-kcamqa8a","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2749587aaac0f61724d6cf5de0703575a7f00ac2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-15d243-kcamqa8a.tgz","fileCount":93,"integrity":"sha512-FJoZUvx7xPvbut06tG0nINVZna26LLKibd2kLdMAGnj4/lH+MdPdqM9lr8PUarLp8CyjoCtLAF9KZiqO7iVcwQ==","signatures":[{"sig":"MEUCIA2FVkI+wc+l6WuBFFk32y7UIqgA/rq0nn47DshZ+5ROAiEAhYmdOZpBTecPPpKOvLXpXAimkeCoqfljt7AcjjxmTSs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAzwmCRA9TVsSAnZWagAAlUcP+wdLWk43yL3vqAf2BHry\naIs9c+OsYYj6xF9yOqmKi4yK2HKttA7dExZ1mKPNiO1uS0/dJr7rVcwj8x2r\nMWnRn/et0CrH+OHubc3inWMdwmYjeOV+89PNFty4hfUAx92yLENSwNhEvOqM\nl3nlA3MiUFxyEgAkdYEaq9fyFriqQPSdwIBRrqECvYgCusCqoxuhPe45/cN0\npEu2BD9awR4GeZSbygGwCv8XnXbv7v9tluxcda3HfWz0LoGKH17y/F4GUiD+\n7rEX2752bFrkBDXjMES28MyjbGWbU+lhOFotAwTyxRcRCfwFPpEu1ph8gjng\nO+py2pNuluGgXih/HoNKiIxVzTVhocNSWVRc9rUS4O9Xgeiac72CqwvvlBoa\ninYTpsYqe+RrG6XYVShmcH/WyzPrmjqdb8qxDXE7kX3F9utOnWfZthAQ0eaP\nP7oR1Ml03IcS7p9JWK7p7d0TXmo5w9Pmcy0QheZwutlQ+0snopdgsZt/g7zW\nprA143WVxI0ug07yvHJJVD8iaUkcgbN3oFtuKRuZEsndaoQR8EtCT80SbQWT\ntVOm9PF9XxeX8OzThRoGdLT8jtNiw8RIJfexHCyc5cU2sqRGIfgnw7lgW/qW\nTuop8JwWDT2WxrKVLWJcuP8c5InOAyj/0iOYH8XwYVoOv4S/2dU1/I7ZuIUe\nGLRo\r\n=phti\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"15d2431f5b3d1a160e9978ee102fc0d1b2f72237","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-15d243-kcamqa8a_1594047525767_0.2065987264029563","host":"s3://npm-registry-packages"}},"1.0.0-feature-be2cc2-kcan6aa5":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-be2cc2-kcan6aa5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-be2cc2-kcan6aa5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"45fbdef8221ac5041a26c9e2596a1b9b80863555","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-be2cc2-kcan6aa5.tgz","fileCount":93,"integrity":"sha512-2wg8yim84m6hCNJj/ofriZzfC+Z0rRhlmdqF2tOB4+C54WC02kVz7VKklIynzbcbW288pTnkIQM2EmYcdRdX5g==","signatures":[{"sig":"MEUCIH7O0THx8UH1CgIGsWlhs9Z0mO1KUVJPCMl479cQK3VmAiEAkFZzMl+QRqcenodk79DKKise0oRCnrfQ7Vhr+r/4BOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAz8SCRA9TVsSAnZWagAAI1gP/iZRoYX49rMYvcjpWQcm\nQH6xwkYQOjzQMRYV6gFRSR/UUT5ZlKOmKGG212x0vQ+F6Usc9Kj4wTZRHlkj\nhUDaWJJl8Kc2/nOtJ5ar0P5dGKLAAq2NlIQzriJy8OBo9uc1ZQBa5S3Foovc\nBD1N/eCR47d2G9fdMgTtfw9PdhVf3O5YZxSjbEZyzhe0g29VtOoXfr6Z9H3U\nvPNbMCqmbbJ36YeAZSvmzAGmJtDRkcYQQswmgGysgsrA9kD3CbFzOpXNh4Y0\nx9fxSU962yo16PXmINxH3ICXtXOEoDwD1+2z8InuQYiXyVxoOMibmy7j40LC\nA0MGC50Zt7SlSwgB1hOTPpopvIg0RHq1RfnFtTDeG1/TelRG+A5FDBZ9rNbL\nWg5HsWgXXE4A6gGGmsNLA7MEPQk0M9seQgRFfO/QKaDrTBMcmul75/se+r5o\n4VN1Lw0/hxI+MfQum1nPGcXDHvThynBtgvzViwebMwnjaPXiRXQjDWr2+pFA\nCjHqWpvSFhYobz5mJoJntibF8+sqlXMfOkI2+4eBEpRsS8OXH4We+SCCYIbX\nsxGVjFDAdPyg3jDyUb2fUKENHzXHB27yH5hDLDsVyz+SVChXlYjvL2l2JY3q\nJKq2RlktH4EBm9kGwuVGOmEmxaZtx/OSlAfKCAggTcskOS2VY6Vw7e+/3SWQ\nWSKR\r\n=wkRu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"be2cc2478462c9b5ba2884c315911307e8b3bf6a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-be2cc2-kcan6aa5_1594048274321_0.8675160051779252","host":"s3://npm-registry-packages"}},"1.0.0-feature-51038c-kcaqbypj":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-51038c-kcaqbypj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-51038c-kcaqbypj","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b4424932a82e52fd4963cd47adf0d3efd9fb84fa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-51038c-kcaqbypj.tgz","fileCount":93,"integrity":"sha512-W+JpAue6M99LFAgQSD7jR1rAPcgg0gRsUs8VhHme3DGv/bH2Rvx29gs1tuuardEmgnTQcXUaTIgxAqKCapGxJQ==","signatures":[{"sig":"MEUCIAebvdgJ7LdXwCInn1UoYuqWCipA4jheXl08sdswHbldAiEAhVUCHz2dir4rtYZk4WKeAL8DAOJn4t/Y2peBvfxvfJk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA1PMCRA9TVsSAnZWagAAL7UP/ihE7ygoKzB1GOJC4uOb\n0ld/n1RqPnAHhypIn6D3bXKSfiRv1G9Qh6mzDegVhH1LXpOV/AQVlAhoMLev\npnYhYqJuZUmxQrSACV1WeMJ6dLwFc7J/6/ecPtc15z8jNPCP7fypY3K3atMH\nX/rPA7AS1TlHZYsurV/5Z2w4KhxQJt6og20XeDrP5xsA60o0fVx6XHGJyeHL\nW0mE4XKGTYHuin/3RIcYS5JT12rG7Iu+dVgHk1IUQG1ZRLYh52mL3MRVartY\n++BP/buHQfgwJBXi3Tsdhvcch2FzYzvKloAg53LEnqxaNXaUMMEAa4rNwno0\nhGDVdtxlCH2V+E6rkUfmPwW+7i/W35lM9RQWj6Py1M6+lOTpa9gktZ9cSg0C\nFcb1jXplkhFdOUAPZr5CTgv0tAYqFo5TCvwMiN07kuq9FJKpfp63KgYWdgLz\nQ+0O25fAebUymbq9ywoqorCDsxj0QlQhRHbaIgLgrKt+GdxsYpBX1nz4imUs\nJxlHrAVMuohAxPX7IWPTvFQL9Rwa3PTTlEQoohT/SPmhXuTOOkDtJwWtwvDU\nXD4em42msdCKasZZe5i2nXSiQWp7sx80JXp1LqsmviMO+0MiYVsiRbpS+jDq\nTa1WEoFV+BGBft1DhLJrWIlOY01V58UEF5jDUV6lELscQ5Z6Dxe6sVoI98DI\nFW4c\r\n=MYjf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"51038c6dd1b743ecee7a9107f953cd17c4b1b1fa","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-51038c-kcaqbypj_1594053579587_0.6045640209815581","host":"s3://npm-registry-packages"}},"1.0.0-feature-15d243-kcbqk7im":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-15d243-kcbqk7im","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-15d243-kcbqk7im","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a63c7c3b9028739553f3d82238c0dc07d0b754a8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-15d243-kcbqk7im.tgz","fileCount":93,"integrity":"sha512-NrHjAzgGHSxs9ssK7Ue8kGS4lNIFCUWMqsaCy8EgCqCx6nULTwe0F2hn3vZHwAELf+UeWwmv4VBBTqn+m9O4QQ==","signatures":[{"sig":"MEUCIETvGKK2V5K14r8Jc89X/Z5gz6IFKomb9wNB4KZRBtHyAiEAh9I8M+fFkWzvMv5poyvjBg6p3Gl4IXjLN+M4Ar29Zps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBEF9CRA9TVsSAnZWagAA+TYP/3LtvJdXDBk2XEuDweel\nIluRqmJqYjVC1/PYH72CAPK1Fiz4i+1TKoAkTavaeU+j34MwiiwBDv6vm8eu\nwH8SPYgYelPgAUKfGiH9x5T78ccIjxituKQHi2/kUZAyl68CaTtMLYqAMa04\nDNM3fJpFYAun+KjZa3RFw3YBf1HE48BCWYWnnZ263QZu2ox6f8FJUMHZDXXH\n1ja64H+g1aHP+owO8Hx6V5ZO2OFEHuBgedH4VLZGdkOicIuO4JNReDxNMMAm\nCWYsj7ZmxVSvBNjF6KiFYoUPrRPIit5pUTH8LaTrlkkXGINj/9ZJaSkzwgL8\n5CkCPsk4iZMKDHfx8a7B0X/yIfS9WjueP0WzAZTg5Y4WDmcnM3im2jxpiszG\nwy+9ggh+e27MIS16DLVXX7jMibeGIL0XWNU3ChNQY3ASB3YOBb5OqyaWcOsn\nEx+TknG+D0/8GKpX0TOHS0lsQtMLetilrUT9mVzPWgXCsznYQ88iPS5kxvea\n4u/8vgXeLFkeyYW0228/s61x9VQxAUcAACJbqPeQOVe8Qbk1ZFAgGQdzHFMB\nK5WwPKgCm3v1HSRmJp0T2o9NKXO9Cnffp/4s2ltcdkWNn7tGFML67s70LAoh\nJ+iWbrQ7PsT/+Hr5OprfN66uzWvxQlkg8t47Pps+V3PB2jhULnqZVVtbEz0O\ntoSJ\r\n=jbBO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"15d2431f5b3d1a160e9978ee102fc0d1b2f72237","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-15d243-kcbqk7im_1594114429450_0.8313953104657388","host":"s3://npm-registry-packages"}},"1.0.0-feature-040e3d-kcbqulu9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-040e3d-kcbqulu9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-040e3d-kcbqulu9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ef192b04ae368d69eaa6c7cff72cb5c2ba258f06","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-040e3d-kcbqulu9.tgz","fileCount":98,"integrity":"sha512-NzZBY0c3G9HW0IpzT2VF0coLWXZFzeAKXDU+gr8pca8t4Alqojq7AGe/zaFrp8zghob73OESJg4NyiDB2Nq4ZA==","signatures":[{"sig":"MEUCIBnN4SnvCckL4FA8Eq5tJQDL4eQqyGe72UGAeCYcTURPAiEA9nQ5szZ6NmHp9q+CsXq1Bke2/tflHhoFD2y1jNsNEwA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":251284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBENjCRA9TVsSAnZWagAA/coP+gMpFyC1aMZLozB58bcn\ncydmBkrztMPLBihCtpDaOy1pZc48xOEq38sKCy7ykAYuOCSxsWjbbDQMpY24\nKCx2HKzhH5ggIXKVReD88Mf2N1f8Px/+l+4zg4JJG/sGs8w9gJ/m0d1c7ybc\nhlXZWAHF7ukZRzldFRfdq93CTXArt7xzztV/SGV/2/6IoJCwJ/D4zyzrR6ou\nZgXINtFF4WqNdlzElZABjkafd9mufb2LSSHNUM/jdyUs3f2iLQnUtTlwQWnP\nphgkfw0YyqOC86tSXMQKsWV+JbkFW/mgFrlfrozNBUZwH4CkaQ9hkvGFjFZU\nFY4PD1qgNPCDtdMLPZinMjTrE/6hfmp1N3tlv4yqOxW8jfpTeiECUUQ9Gl0/\nZr52m737Ho+8YKq2qI6Egb7o2Amlc7rqvCz0i+mg9y4qEiYpTarUu1zIRxMj\noP5xZqPDlBCmREU6vpwmo8UN8/5RZnI5bBsecbUhkcx3Y9Y99v1ZltZcYP+f\nbTaTJK2RzawluZbsTlJFHwv9x9xneg2G5Ke9sGy+gZSgrtMV1v7KN4NTAR3k\nmdYJAoQUIgwCTCpNOqclFhuYkMrxiRb3usEWMuLb2oK8P8KUliGlFyNA3Uza\nONOyEkqi3ngTEwTk+v/ki2ISuYoHSFPud5aOI6+6622uQuexajk3NWVINO3G\nnoUM\r\n=NxoQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"040e3dc350777dbe8f25301fbfad79e0635c910c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-040e3d-kcbqulu9_1594114915073_0.8601196698635942","host":"s3://npm-registry-packages"}},"1.0.0-feature-b46475-kcbrcjl1":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-b46475-kcbrcjl1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-b46475-kcbrcjl1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"13bac699786f8590dac989c239ffdda716e0ba8b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-b46475-kcbrcjl1.tgz","fileCount":98,"integrity":"sha512-8lK+k0xhVpBkwxf1KSDyxBlCy1YNmiw1iYonOqwX4EPSPnoR5dw4EzfRINpEFGchMy87pkOOCeSQ14cAkeSypA==","signatures":[{"sig":"MEUCIEgAwZKDH5CHas9YYx8VEcBX4z49hbnCXuvRRREFoMrEAiEA6w3PN+kaF70n/IebqBOQWgwP4b27nonQDcYfhcX1DUw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":251099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBEanCRA9TVsSAnZWagAA9O8P/3jgOHaNnOTdDzF6x6/1\nY2r16nlLx55IfQY/qEJ0i18LAc+Q7USGVRAvTpxqZjDn6mZLYqrnEWJczCWD\nxDntqvGalmOfAh1LiZn2HmVbd29SiVTQCsjHuufI8CFwZpYrIstbZqF8CkW/\nVFdVo9GhrbLpdzLhp8/3E8DmZZQlf/hc9SxfSlJopS0YTGavl9LTeZFXeOm8\nGYDxF4xdT+ZzVlWqDoYtMGfOgnAJN09TaboWz0LGGvd916W7zaNjCAiJoUzd\nU/iz2aY15hvub9EeCIRGeCs7L2RBTn/6RRBgmjNAB/AKRKuoO6sJezZ0sbaS\nFz7Br7FETvO2OOm8cXxuAGITDze4mQU0iofoE2hd3QKsFArrvgL/enMdEcp5\nH1OxAdcigOVoTV7mL3SLB2SorxAZbIgcb7yc2xwzyngS4H4PHeCj2UY5oGdE\nGpn8kWmQ3H4St/2NWF1PvvPvl6Cqf47rkzmqnavfwsHlF5WsuAqrZ+x0i/vM\nVdzTGk2FSNMhBeCQxgw+++gID65XWupLOKWCIBx4HRguQSqI0nErmKPNyki9\n1UDx1fDh1F+cLFXf5C0u3TqDeAzsVF4TP8bIYN3usyq4PvBZu7ehjlc0U5kn\nPG6J1b5a5NiAckjXdxgx7CHZ/BuRRmf9hMQrCdlcksw9aWAW9F3StsoaPRI1\n7AiS\r\n=q4B7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"b464759d8d0706f5e9910ff0a89aa0a6f0960226","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-b46475-kcbrcjl1_1594115751394_0.3929684957976798","host":"s3://npm-registry-packages"}},"1.0.0-feature-42f230-kcbtd5ge":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-42f230-kcbtd5ge","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-42f230-kcbtd5ge","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d5e67d787cabb172da9cecdd9b837acd55edec5d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-42f230-kcbtd5ge.tgz","fileCount":98,"integrity":"sha512-zGHpUAmcydcCDNV1x34TH/A+6+ff35oqALAejp1uFQcLTY1IDclAvthwuERA/OHvgBCWh4ZbMdrPlN0fxyt5ug==","signatures":[{"sig":"MEYCIQCwg8so6Uku00qixr6shBkgaNVeGkfXv8WSim4avu5zygIhAI782PW/BgqiINj75Fg85/2Ug1l7WsxD1EIE6+PR8D3A","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":251108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBFPiCRA9TVsSAnZWagAAkt8P/AidfmJ1p3ir0Ga4p6ya\nJwugtaEJLOGKdGCTMYvsUd4il+Jiaz1ttcF+btoKUb355wo7vqu1shFiBbo1\npxN9CkuJJ/YUf/hZl22QNBirLDeLUSEpyG83rkfvtrztedi62VmKx01JUSWR\nI802VlsDKbRb0Oww5ajYVKwECi5Aly4QuYP1Ex6WJH4gVkbYhRxkyXTiGnGC\n80WrUzuP2z8jUjEfVcP9ooCBoPLd/GLUPLA7v6lgaoym1dxPnYjv0JIkPMFT\nE06Dq2cewAELCSEVu79J6BKWHGLQpTX3ljUVxw3N59q4xndOTwel4uyOK2Ce\ncKww0rMvCXXGm7Q7iHkcSRLL1pBc1Ud1i/K6d/yaZtoc5y7LE9ux07d0v9hT\nrkLGjsh2cC81CT2RwiMBS/zqus3iei6OwL/f8KKcPD+tSe//Iy/WGY63LiJ4\nHCF8zYGkodbumuZ2Zez/jKs/WnIWlQ/eQOo69mGQiukWHkg10loecYvsmtCC\nxjrbEhugvOw6KUm7aLG1GtvQ81CAePHmRiu6W5hOyrTAHobSfkGcu7CAXq6p\nKQ9HaHUpV4sf6kyYvK9lAIgCA1hFpnNRTNp84HIdBQB77lFlgO54UuYtQ5DE\nHhVUMgEFOXrNnw7Zm1uSqbR7Y+tTIunpEZyLHevwErtLl41L/SDJJib/83xI\n7rWh\r\n=/9ju\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"42f23016f15c80bff56b0daddb5058191d2c09f7","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-42f230-kcbtd5ge_1594119137546_0.10229865289042839","host":"s3://npm-registry-packages"}},"1.0.0-feature-a7ce03-kcc0n9oj":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-a7ce03-kcc0n9oj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-a7ce03-kcc0n9oj","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a91e716495f550c907ed7005817aad850fed56ab","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-a7ce03-kcc0n9oj.tgz","fileCount":93,"integrity":"sha512-vZj4QNlj3c9l+D2vmDc89l0E3f/dWR8y+UzzapHKdc5VUYxYXoGRz+9G6Bwe4UnYDbxQLW9Mj8j5ODeiYs7Prg==","signatures":[{"sig":"MEUCIQCWQ78g+D7bNuoGjQKLiTe1FM4ffkfiEFMSeffbaBLXOAIgDdj7HWtoXA6Od1BlgDy9fH5dAI23auGq2L12c9Fuh5U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBIOlCRA9TVsSAnZWagAATl4P/0pZkdTf7ooxnWsS8Yvs\nDM5AoASCzv1ErlJunJoX6CYfNeoL/pS4qeNRWKxQuNfW92zSNIykgl2Zzvr3\n7xkO/+6kTa6APTNbNcnDQEInffEYXZCpj6/xvI/4pDVR/nKCZan0Cao9BXAe\nR0Rc2bBCUmqPZZw8VjPH1CtHssgG0vyLM7Pf1QFWxa6fB+Aqe4Zv32tNEhVK\ncXQ6lOlkNyz8uIGzvSMYDh/vJeU184Qd0t0gXru9psH7IrJ45tW6VqmjFRzG\nAIe0vukUK5RExRDMf1rfbsMr5vUk2EBvFH57IOwF1co5EA/1S2qwanwQx5TI\n2B9zy2VahM6DZ76t2lUi9vjRVCaCLkdCXwJjXlghI1wlj0H375T/ERiOLXGK\nyR4p6QLEADkemkEAo1M5Mufu1mJ77lI4rL06RoLnBsTj9Tq9I1BAZr7iKbco\nqrjTrtVP1COCCjddsxtaD8MrVglC4zLKYUoruKEIa1jFYoUNnaI+dMrR8oY8\nr8fmVGAzfaLz2qkwvKNoqQssvqow99bEWButNKeRmqHOdsvPcBTgtvsOK/mh\nccEQmlIh3Ewruyz4t1NDoM4sbHXk0ubFOwzlFIP3IMGOkwDH5iY4DfgcJC3+\nQMIaPxq+1VOIk8ZYos5MyqhH/mHAQ5kRuhz3vE4AKpEzalOl576uBdhZOSRW\nY6il\r\n=EnI/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"a7ce03e2001d410ab27fd424d063873004dc2050","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-a7ce03-kcc0n9oj_1594131364877_0.5913465415996721","host":"s3://npm-registry-packages"}},"1.0.0-alpha.28":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.28","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.28","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"17796cbb2867bdd7547454746bd16f8886d6d902","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.28.tgz","fileCount":93,"integrity":"sha512-5N+BwT33Z63CHIP1M27i/hiWbpF+x9qhhL47gv/FYUObsAMZiw6PBHqtSUiW/7P+IBvpKiZhF5jgPZpYUNXoKQ==","signatures":[{"sig":"MEYCIQCX1WBcew8pyvuj51DiCZURkepQmWOe2pJgQ86UYfPo6wIhANNpmxV8vnP/H83UDp08tqmCC69zMvMg/MjHgJw41ZqO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBMeUCRA9TVsSAnZWagAAxaAP/1mQx8arUTv+5QrEPH3C\nceG6zQi2+JIDPkRmnanPiCeZS70vy2slSwfjPzWKmDHhJxcf1qeQQy0OMsRy\n0kgPNOGYWtyWpxoAyin19wu2SbPjH5BVdLVCT7lQVXX7KvcCOk6TbOCcnzwe\neg1kC28M+epiQ2Vfi5/RIJFMs9K4eVT2n6nbQmrBalQC8MQ397yXsSApBHWn\nkO/O4GYHl8H6lgUSHA96yxlTw/cTdr5jytqb1qDmwKf6zE5LxKVThob71OqG\nEGDM+wZPV7pi5Uxty5NtMPgYUa6dO+wQBCABl2zNzgRyaJhOXJMGDuFohekC\n1P2oEImEceykAVMdJyiQZ7XGdcZ368ySADJr0B1l+JDUYXKapDCCvUKGeEOO\nVZHUXPV/dCgObq7ZZBcPFqv0Q1becHPD+GjTCOsxt1geXDcpIQAQ+rjDSdiO\nISr5QOGFH0zfkpkGy4EzggLfd6k1dQLIn557K75Kjt9+H3gGZK/QlVtiGJ5G\nAUMzv8XtfIDAbNA+roTxAD++MmzxN3dm1jNPAmg3JlrRQvBceHrfTr1UYp86\npK4QBgFbNlCYdywxjFqD3ZkqsriAkgwIdhExVgNiKppaf18nItwLbpBLRvxZ\nLgJRAZdiK1UXBGSROk9WzMgT3HDih63pwc3m3O2b+eMEB024A5w5uIbra54y\nEjDe\r\n=ag5B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"a34fef3bac653570a22d5e486e24faa67ce1e77b","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.13","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.28_1594148755619_0.41171962664019857","host":"s3://npm-registry-packages"}},"1.0.0-beta.11":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.11","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4c848a1879651c3433f3f368c53969a3ee980c4f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.11.tgz","fileCount":93,"integrity":"sha512-B6V/JOmSmaIIR26lhWOLCoBo1QvCBVw0F0descGuJTU50b+8JXjV0WxXrHzMXpf9y9opZ3CmbKM+G5uyfnrT0g==","signatures":[{"sig":"MEUCIQC4l1IW1MVrd0o4B/Hc6m4X3dp7QW96Eb9rx3J4p3I2/QIgJAJLKzDWtoXcMgQ9sSOJHLntyiOeny7VHd6nootSm68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBYbECRA9TVsSAnZWagAA/wIP/jpQW2y+K1vnqeBR7gv+\nq9gUExgLHM0Qzz0Qadmq2niKdh7UKQCkH8TNh7HKHv9DcqZKddrZR8GdD4Bh\nU5WoESfNuqeDrBtfx5U4v4vALP/OmZAY9Y4i6NGHumcRaca15Fv7UcB5590j\nq+o8SNG7ynyXO8rh11llxItyLDkVf2Gg6pxhEc2/5h5CosxFsgER1ahoYdUx\nkJ2UpylM+g/8WNCmlzATIUfh8L8E5o4zAfWSNQ+kmohQKZX4pL5lu3aDIcQ2\nHbheDMqbzu8CK5dyCDzQC3VqlFp9VDDDcbTAFyvE4ORwpaalQQSfHm4UjvYI\nXrGFz1naJjYrEhe1jWgAjoSRufmsM/f5mxq1ohUgJkzd0uGI6udwVGoa97Lc\nDHn6QMOvbgcBZnD74nV29r72hyCypNifgCg0ZaJfT/zYUcOiQG2T2X+vj5QU\nYxnrk0zL0Y5xAXpQpCX6dNAa4R+5c520fMrs6CUDCN2vxZzvSWADf0xoJx0R\n9oGf/em4aoCILp7J/s7UWTQt+NRESSX05L70znLsaBdBSyTbWPODLKQgiRGY\ndoZJDI+1aCkKQ77e/TIOyJHvVqfjqw3FllfYuKypbCmPVjkJ59GnpKpNkVim\nUY3U2O9R1gFMNpIh+IfCjVZkKgIRKK7ouq50+W8g5jGIH3+Is4k700DqFyTv\nCqmw\r\n=ubVr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"f8bb056e8f30f57861ac6696806ff86d1976ed4b","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.6","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.11_1594197699575_0.9309729376970655","host":"s3://npm-registry-packages"}},"1.0.0-alpha.29":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.29","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.29","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"049f7115fec07ace768c0d03f6f47e23a12a579d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.29.tgz","fileCount":93,"integrity":"sha512-HMGgJbl+PXRZIYo75eKrCtW0Iu6fsrAUG+/sMzvlwmc37vC0e9F+3X2mBxkDq1/IfRdozc31cicDh5I34G/UbQ==","signatures":[{"sig":"MEUCIAXU0X5TUraf3p0LPSCMDDBAHeOg2qqgus7Yn7lpYNeZAiEA/sfg34nYQ/WLeDLxMQssAKa1I2NkaA/sla64VFwq/jI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBYdoCRA9TVsSAnZWagAAh6gP/1ooa/katM5KkFFgMZko\nQwMdu/dgEGolgA50NAk6Ob0KmBJS89ayihrMK4SzMfiOPogn/nNwTrdodLez\nxZ1aZTXqKjbz3jg7xLRM/eI02QOMxsynFJInwC5gCa2PwK762gQw9uC4wsEx\nLxEzCmo19//TZFJ2exO3rN8Hmz4uOYjbBK3u80G7VZDh0A3akKiBfOh59Ofs\no23BOm+nRLdUdE4fITpooP+y+pVxn5E0JONm2F5sCsQ0s6ERZwOJeCR08dgu\no1Z7XcwJms219UK0MCAV2Uz6hJaF7MJj0FPiGIH+RHXaqWuKzh8K//ThfuXB\nb8a4rLHF2n7ct4ZOE6ZZnKTQ35YYiqbZa30mVtnUh4iw/rxoj8iqXEIe7xmw\ngVEHAUodgm1GWzgSEi+1kIieM80gn7onFjWC2q0PD1UhygfYxEL8XrZay7Jo\n+2ipR5Tv4ZUxLrWrjlrPUO5EeW1o8/VHuRiqHLPsYyWezwIqf/iFP4Hzfi65\nZCvOVwnjTIe9SrwClMt8Aec3jGYBXAYmtwsybkpWo9SO6RZAiODC4NmhC9BL\nqLq1N0D11ot2eimUl7CPtu4sMaMrXJMjJ+7riDpMxU8qFdJv/S7q5ttnznRv\n5Bz+LZ8/B8V5PHThHOcHNw6WzzUhPBKI8000qZwjiTbkxvcE9OoiujRYHW0I\nPNmv\r\n=zBIk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"cb7b99a4af537ba82702a4e1ee44e26a12e75aec","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.6","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.29_1594197864000_0.318822585313014","host":"s3://npm-registry-packages"}},"1.0.0-feature-1759db-kcd8aj10":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1759db-kcd8aj10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1759db-kcd8aj10","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d98ff3e31153ace420d1f36f457fc05cb6ad4d3e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1759db-kcd8aj10.tgz","fileCount":98,"integrity":"sha512-ELXPXCDqCtJUJyK2Y8+cfpwJM1wFtgpFb00vkcIgDI52o0Xcq6CBYvlCXnp3n75Xkbc66uXAAGWSgrzfW+sRUQ==","signatures":[{"sig":"MEUCIFOpTBxRxoshJJZQUR+NNcRyohopMWc/ozgD/ehOhXsdAiEAkhTyR+OnxhuuGuuce+ywjOBvu9peKOOOJtG0e1OMhCE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBaIDCRA9TVsSAnZWagAAJmUQAKRnWphysNo6VcBR7eGz\nssDuE4+/DBEw5IY/mmvL3yZxC6lbXI3Wzlba6VAeNntOzL/Fu5qT68krBWn/\nIP7B11dhl9zM4kl9ZK/l8kZ6VdvaZpJRPYysLKTteRKWlaBSaTETQQvR1pVE\nkw8Q3UfHmmUeFmbhL1/OoXf/RvwrkxfYdDnmltylTl3N4UWuegm7Q7FAeJt0\nZetIy8ek4G39jNG61q11Lv8lkBMIBorhk46gpucACTy8HDJo8ESca3v3CKmn\n3V9k/G5DnfLukTIuszNCitl/7WpNfRN8uhC5zlzEJ5jrIcZHCrciTHkin7HC\nxCJ3Jaj6sKDY3LKYsJkmHRUZkgjeLHZAB+stb0kZpYf4PwLVXLY1l+tj8K3o\nQOSPIHSf0ZfEjdPBiX+OiapWNZLSKJO3KI08/oQshyTZP1DZEV+I0PKI3e7i\n50ReCndZztr/e7+6+ZKEW7OMAmywZcaIvy1NUisB5w3MRiIdtpHqdGmUdg+M\n05rGIpU1JmLlMKXeKIrcq0OCzXgZtF7Bnoihr6pq9ZhmfSTXduPBjpInxqGJ\neLG0K5yzw4My1ETmh27stmQtQ0qhTSvaujFGhJks3TugL7k/CkDCBXxpOt8b\n3PlKN7tlKs/sRdN8QddBOeEPfN1CLl2b39vaMyr4J9EJofW7SXBDm6o242lk\nOMC3\r\n=cIDS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1759db238c5428f0402512e8c768254af4187404","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1759db-kcd8aj10_1594204675360_0.45610846440586483","host":"s3://npm-registry-packages"}},"1.0.0-alpha.30":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.30","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.30","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"be09cfb3e331077afe2a074ee492bc3633e979cc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.30.tgz","fileCount":93,"integrity":"sha512-VkQ6L9L72QTwVJnJcvDpbXhNh8fSlYgwATULwkPQTILn5F1ncXVVvp4Je+QM0baTytXCwNFm73TMZaw6A/dItQ==","signatures":[{"sig":"MEUCIQDan0kkkddLg82X9HASlrhgnrpeSV4vubThWS8WSzlEKAIgb3iwX/pr+Z9h1xCHpEyhKm2T0YHlZXy/aneEWJfSqRs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBdsBCRA9TVsSAnZWagAAmDMP/RE8Y5nkjXZF1euA3p1A\nZzYzDC5FDT+l1yr7itK0nWsIa400cvTXn4LxjY0OjJcAnliS8CY9fXF+D7o0\nq5MAxfAyCBj47LEAf2JhF+o6eF9omDnkaecphcGWzOAz3fcMOuSU4cFDzuaE\neBAbuWbGu3fKujEhimOEqvDkX+s89mGCmzF6zfs9blu89hhnzU4rP0bypiqr\nE7c34WYNTREcW3t6H742N3yGN7QmRdyhiE/iojzs8NJEbSkYTqtqlOb6tVAZ\n4onq5jyGF2nxniZTiiaVN2aIw5w6gs0kbTT8Ks5WHQYwMp8G4Ly7Mcp31aWt\n8M59rGLlvAz6wcEJswP+tcWbc+oG3++vcViaCSAAvXZwmXaLVNbkHhGFf8ga\n+MVtz5vQ9H30o4EWdRhBokndFcDtFGFGiMYCGlc8y5Hmqgm/Wh+qaNmZKWbG\nDzCZHZ56H/jaJHgaYXiCTC2zPKjJnP69IBUV0P9mC3VfzJEx4L6YSOVyohEG\n22w3D2sGQMMpym4g63ANnoVOxVKRSRuYBq/bI/4I7cER8zBkfvYoKRsaVE7l\nyGESvD1fEw+2TG6+sTz7bgKIX6veF1TLnLsK+3iH5Sd1VMBPN3vOx0+sXPPY\nB4ouJAUHcxPanPn9Y6o9CIE8lssba93VjSUFZeeRdDWmhcFzwkPwDNpnha69\n5bmW\r\n=zy54\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"8a99064bb86036c0b36214950d0627410b856708","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.6","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.30_1594219265268_0.6839728270417251","host":"s3://npm-registry-packages"}},"1.0.0-feature-8a9906-kcegeh72":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-8a9906-kcegeh72","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-8a9906-kcegeh72","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"436326904fd62be659431db478e5b7687527c609","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-8a9906-kcegeh72.tgz","fileCount":93,"integrity":"sha512-q5x973YXErpxfxEwn16tDKsQmVHyBVmga/1ZglkmVpNbqUvumKndP3f3hI4SgH4zA3SX/2JMbMYflCwxRY5uYA==","signatures":[{"sig":"MEYCIQC5cvdyrolXoOJSqsm6x9Fao3TcEisxtSKNCRIW7WoPmwIhAPH/FpKKlId0aK6UN2M5RthZ8arQZPTIzGZjZDq22k7Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBsNtCRA9TVsSAnZWagAAFW0P/2bqisSkW165bmGVyw0L\nvhEE/oHkTz9OWZ+h9ePdWi/7HEYLQeU3AQUq9Ll4HlQn6EEibmhD8u3LCbP3\n9md19fyrXGW3ARgdc7ukXiBR58X3CgrseYJJ0nLO4CQcYuUkKj4rSOVawHBX\nVaSUiuNYX1WZ6DUQF2WLhTwzI2Y6s8Xwy7BbTRmZS0sPm+gzxUwZvENcIGge\nmKwZC8KvzYM9sV32BvUAG6ruEpsCpA8jfMM2WEQ42Uk2VsIY0LjLNlCxa7DP\nxINV8MFTDcUEqVIbZivB0tlXW9co7QTkXWaLiKDEMeu9EwS3sdPlGR/UFa7+\nm6Wj0fA7Kw8j2go2sAIN1Uicgp+RG+MnFFlgVMiIXFRfnDWq46P6Q7sfTaXv\nVtn0ZnczWvzyz/xltnlUv4I0Y2ni80++DTPfdNn9a61T4+mQrfM1b1HvL6uE\n+Ymkft9HcATFunAUFB8k81Guu78kg7SAma7rIvRss/nfk8NKLIurz9Ijf+qu\nRJp5OMPvTesKfarcMne9LiNC82Ui5qjX7/yr4g0kpVBvbVkQlWEOZs4ZWomp\nNcblCg3pY989UDwBEvOx4lda+9sYbW2DvsYJCdWZ/bAdRwORQGJq2BU87TL3\nob1yEwVUJjs8QCZ+3ZTrC6dPRS6sZpmS5ZvQ/Nqolrzixeof/OTMthuSp1TA\nPg6Q\r\n=5L4Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"8a99064bb86036c0b36214950d0627410b856708","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.6","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-8a9906-kcegeh72_1594278764680_0.7330146891842715","host":"s3://npm-registry-packages"}},"1.0.0-feature-6f6b69-kcehl700":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-6f6b69-kcehl700","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-6f6b69-kcehl700","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4dd86b71ed2fbd4a0d55a60b49f5f7ed019af79b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-6f6b69-kcehl700.tgz","fileCount":93,"integrity":"sha512-TTCmPM+n4qVoaxy28MW3vbI/OnKrSJZEU22LmsW5cmh9/BBLutcIwfYYkiImkz4EbTg9qiRBtpuxHygQkHO2iA==","signatures":[{"sig":"MEUCID2M4fT+Q7Mm/ZyLAlK/BlV3ebHKU5OnMp4/M2MmLvPgAiEAvrnUH+PLoeXV2M6wM3eEFNoxRCV9e/z+1e+MVl+Pk/k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBss0CRA9TVsSAnZWagAACy8P/25PeIMDe3w/4QAYh+N8\nJlSN+DjYTP4eq5uYTXXxLWZa6FpTFfpsrNLrtnxhKTpUca/+vZ67uSWRCL7y\nHySYRrRrNoCEQpfZYnUB/obm8UCyOuC2pdNvH0xdzAhRt9sG9ZVDEgiZ0nF5\nnxe2v3Ielw8Seiqy9J18az3dyKCfRNU688Wjv9yWVWglzR5CA5OaGR8EvkZD\nJFmVj1tRRMrMdBm8flvh/kugSErJ+P6LI7YB3H/IXaNrB4y57J0iwfOljez6\nwu46ZMIr0WJMMi4X3dwLqJtOVNvIujoysI0oHTQxYQ5j2edOL50SKhxapctr\nC4SC3agzzlZOMYT2YQHFUwGFHF8WICMRQietmC7W4q+Lm6fTXkjFi1tY5Oq3\nZO8WXAvUe/OXRvjNxNz/kJN+QKih+IvSTtHUlwPbEGcxnR3xUlq5rHfhoGHQ\nU47KHlDH5mh/sExWz48v4zvsiVBOBrAUhHSYPBuKnNsWH8O8tIP587I9wxL+\noVZ3RNIT2rTRxGChDeAMr+4/TUdoG6GC/sCQNshHNCER5GZxthZW4rsrw6Lo\nq7OBAePV7s5thQ3ZIIWqx2iEwb/yfKQlYWPK7qKl9xkf+r+Jwatagnd9MlMy\nSi1B1feD9ve+7l4EnWgbyuJOE3pS/IYV1zMoFsWjwKcctmP6CFM4Dpj8/Ptn\nzoUs\r\n=00ZW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"6f6b69d6743ac355dfb2136c875817aafe591ce0","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~remove_form_field_wrapper_property_from_user_tasks","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-6f6b69-kcehl700_1594280755547_0.3168024663037394","host":"s3://npm-registry-packages"}},"1.0.0-feature-20b3ba-kceim4ih":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-20b3ba-kceim4ih","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-20b3ba-kceim4ih","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1116c887cf55f41dff813eab62ca70b1ed888e59","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-20b3ba-kceim4ih.tgz","fileCount":98,"integrity":"sha512-DYI4cCo6e8Gp77Gr1SQuCanzrOjChtFhp1yzyylmRZSbfGR9vMwu2fHqQfmx2ZDirrpNL2sNeYEziFRFRG5SeQ==","signatures":[{"sig":"MEQCIDYIv5GWhAaqOGH+S0ES1uZ+cFyqydBg7d7NC285hjcDAiBiS63zgfRCZCgNn67vijuj8h8wu5AiZn3tn6JqGug6AA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":256488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBtHuCRA9TVsSAnZWagAA1DsP/3qSSZcpwfm4+YMqkH4L\nfM/+wh9M7vOlQA6eo7S2fiSOPVCFlFo5juKplwiURbtU1ZoiMutrUtRQgffp\nI4Jgr2zeFNXVTiLMh3I6CP6L7Ku302g1NS3Z6QUwORnxkxBZd3RiXMjCp82Z\nNJNi8JpqeNspBhbU+E8QVerS6YYlg6IwSL/IDorii0RA9mAdnOkqU6uFujef\nAYw2ZjH7wqzAXpwAdVMnuiLLLCc7wVNTtiBQwiyAQN+zaUJX0XBqS63lmOEi\nkZPHmYsB0A5remAiZwfFbw9t4HG02Ieo/IytVJ5ZmSc+lqzU0enHB2XujOv7\nhIEpY3sIBDRrJapX9GSuM3LLI597bliM5cSo9iPmQAcNOzA0skkVguTTCMZg\npaaH/BuX62dZ7vQTTXCQ9ItUFZeiLS8QLujs9RUdX7iMt1Den8Pk1c2SZKFU\nNAp6m0pauF2ZSEZZ1q2tTNqu39wkVEvTavNo9brkwI/nE8jK7fSO+PMIsRtY\nJmEWkF50RYJdHz60s8dFUuL7OVX+oSrHNhXcWhNqvGBAl3vUKvxAGl0slqhf\n/IRfEp1/pQSTksI0A9rCPWMELt7i4K6FWtNGOzXDvF3iy2BlE3/4FHPPot3K\nNCUpH2uBVZgf94xCYloq3UEtGy+chyrt3ToHBsEUgi+87L4iTvOUD8fI4MjP\nPWSW\r\n=jmAE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"20b3baa5a03329023ff56f2d3d35df5f3b680fa0","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-20b3ba-kceim4ih_1594282478449_0.00346519637998588","host":"s3://npm-registry-packages"}},"1.0.0-feature-3d917d-kceix0qg":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-3d917d-kceix0qg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-3d917d-kceix0qg","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"46496cd32dd615405261890df3e53f22a71d7f81","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-3d917d-kceix0qg.tgz","fileCount":98,"integrity":"sha512-qdvtuxcYy3GZ2HIE7lhHmdKVpRX2E7cz17AjIcjsSm3E/oiAfYALy2IHrNWEl3/R8ZWZScIybIvYrLPzoOs5XA==","signatures":[{"sig":"MEUCIQCr6VaH7Ojb+aHuQthOdXNrjICr1Q0pojkocmXImBw/sQIgSbdtBfCtxARWiJ47bNSjIpn4VnJqHXFafZNdx7+VnC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":256683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBtPrCRA9TVsSAnZWagAAWuUQAJ5MCeZXTVqRYi2wEz9G\nGbXFUD1qr7d552bpJQbzEnIHlVH0mJtXc7fi749af/vqPpLX7EDYrmlbCKJc\nGx/WkHLrHg1ZN08Yvz+8r2LPDZTHWQDdH3ZTIsuTNAaY2mtqAFGn2ktLKkD/\nFqmJ5XArhFrzUrFT5cjiqtt+O3zIZ+fIFfX6e4mf32pU2xqau53ozecqvbeh\nBKiwl6egVsm/tCl9Qm8jmj0CuysfhUJyXXjnID0BXikZWvLkeN3DI58EFRO+\nViRXdQcRMOPcCPBFuNGnh65PNdxhCWmk+GA982sHtJ8Y0QCYV888MhdFtu56\nVwLEl7gUbgxp8+ZJNVH2GVXM0hZjvgUcPqAjclDuo7MaUbKSjwOkTwz4+8Cf\nwlnfR9mUhBhiHcf8WlmvoIaxHbw/DNAcCvzMlXLsB6dVGcEhvBmt2Nq88EYg\n4WvsPFvzl9UUWst7SAdtDM4NNgg5wtH5jS3XGZ8ewsNm+FpO1erpv29giogS\ngWLj9XuEod3E5kW+hZ017A9lB9x2EuMf+c/w1xZIj4faKw03Sf8hHXo6yIAb\n0Jdh6aRsrYiv6KqjPGJZMUAUWjNN4LrnzqhLIzwZV6bjQjEeI4mY8PtW6ZFq\nDxNN0j38Mj6og2HX4YwVRStpY/MTXOPlZh51DVrMQenOwYCKKugeo8kUrXgO\nzxw2\r\n=xeT4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"3d917d30e58b6777564a08486dd5bca1b5fdfe6c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-3d917d-kceix0qg_1594282987186_0.8406418485046276","host":"s3://npm-registry-packages"}},"1.0.0-feature-1243fb-kcekc6h0":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1243fb-kcekc6h0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1243fb-kcekc6h0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5164ffd823a9fdcfbc0c195737d28b2e25ae2a86","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1243fb-kcekc6h0.tgz","fileCount":98,"integrity":"sha512-XOxV8wCQzuySb5MCtyuNnyVEdMgNc1tJLceWWlkLI7V4AIpU+rwvqRDq0KGArmLe1xuxkmFcvI9ZawtHCFPE+Q==","signatures":[{"sig":"MEUCIH6t6U2w/SIBNEuQpFPbZ2D2wfHNycjnoAbc4fg+rdN5AiEArfdpZuL9UkneW+e1UnBCtSkwtnNgBJ6G+gm+eS1Z1eU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":256505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBt1ACRA9TVsSAnZWagAApBcP/R3ELN5rVpn6y15Wz6oS\nQjwWMLI5I1TuiQCeBbArg0GnzvsUQBlF0q5o+E/jJ+o9XIuaxkYM4dP5oEaK\ngD7If1bUv+McUINWXItRreuSt93LwkLWh5niNd5wv+7VhrjoMYulFzPwvId7\nLAIaUJ/5S8uNyLlM3Wu6AA2UNh3aOXCYEZ9JHG6bbvzXXHYtnW6RijCX8xJ+\nZsK46u0YbibraKlc360mrlIjfqATQ0wQrMLG0UG5957A7E6rEPsoTrXFyMTI\nnr5EwTBtKrP+ZlWkiNgc7xUYUng31DdcowHU1WfLjfw4EWjfLqlzhYIgyfqm\n6cIZwToxG/5SEWZLxCnSfWinNfZpNchZ8k2KRoyGbnLTEHZWRMXu+uZJgRPj\nvRGsAIhbqapGDjtlXOFwQEAccW7LgIvv5F8LWRWnA+GvvS9LIZaQ4S6dhslz\n/koFMoe0CR0qWbj0Rcm7uNgH1W5WQlDs5aQeOhc76uEA/pKI8AsM+RRa0XRV\nhnPWJq1R3nYRswfkwNvOCsoLFfL8xvMXV+MiksptV1/CV19vB+2eiPOu6AO3\nUd1VWaj1gUOqVgrBA7x1q1YT7p9kzpE/CCBWWSA2WLyh7aE5eGOLyPdej3Sj\nm7vNLAaj06zfSz3KHIwcGGcNoc4tmLSGHgQ+zR4b5xrJYwEsuoFnFb28wNKX\ncY/q\r\n=WsJu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1243fb348dc1af9d4e263bfef24422e0febfabbf","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1243fb-kcekc6h0_1594285376267_0.8008888706477686","host":"s3://npm-registry-packages"}},"1.0.0-feature-1323f2-kcelh9gj":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1323f2-kcelh9gj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1323f2-kcelh9gj","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0ac97e6f6b53e52755eab0f716c2f40b07987dba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1323f2-kcelh9gj.tgz","fileCount":98,"integrity":"sha512-18kQo3ukz/UuD/tGNH0ekdPcIr3p5naLZ20CsilMOlgl381VgMf99bej8bxdfi6jN6FZOuWAnnsBT5rZb6kuEQ==","signatures":[{"sig":"MEQCIBtSk9tqM3RTmR+MAqPQKctsOHTSDOZ93ZK5+vy+CGYqAiA2dqMOTvQBgc9gnmihSIMShhvYfqtVGqlikJplYZjF4Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":256431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBuS7CRA9TVsSAnZWagAAy2gQAJH7LnpJHy2ciFo88Ui2\nRhiHPV4bnxqi98tjc03KIZzW7MPt9mMTDgq/7yRcuD0hPS1P14BuqUvMyCeD\nFtJ5SjANmINpK+Oia3wxlzXrSoAEwLxYovirupJnrm854EDvsOePsi5HHmuk\nEpE1fZDipe7tDK6MIb7aP6DPXxmwvA/LidvETXQoD+4BSSY3PRb31p0E1u1V\nJmygHjfVPi22jBlDcx/6ifE+uRkyOtEimAGhgZANjd13lhL4VmRSGCbsT7ma\nmWSwdmmQXbxCESe9/0ItJpsvbx2ea4B5foK8L6W7wD1f07AjGmfrZmAOEmG1\n7Hj2j6x74koHuMVk6q2kj9a/wnHV1VePAIFsn6H84H1xYBvTyQl8CHtf6KWP\nb51xquRZO6j3M/QgaVl5g0PL7ObLUidsx5EeUNbnz5rlTKiqiWM3mKg54oV1\n2B8vTqf2efpIt98VoTfyIWQHJwgHcufookuKnTVDAW0/akb271CBGA7ZDnrP\ntjzqkURL4iY3SU7BL8iqva3qTv+FGTKG7jtXYXCLQjIJsfw5F9V6wazgtedU\nDwfuUX3bGXPgEC7QeK88f3W5m1H8Aj7+2MrFLcnOvhYzuHeLp3erGGtgURaR\nRX7//Z9Or59uCRW3c2rTUX/vgogl5aZoUXlNlxtanQTUL2CIdwDaPPdM7slz\naTKT\r\n=RIGP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1323f2c32a83047417d166cf571b4009b1e8cda2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1323f2-kcelh9gj_1594287290755_0.5085410829262054","host":"s3://npm-registry-packages"}},"1.0.0-feature-31fe70-kcem6i7z":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-31fe70-kcem6i7z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-31fe70-kcem6i7z","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1e5eb4123c6d4ef27043f7be7f8ce824ff97a7ad","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-31fe70-kcem6i7z.tgz","fileCount":93,"integrity":"sha512-5fgKfviTWt4bYI/sYfnk4rSDC6q50oLl96lyBsTYJUKqo811IIT3Wtd9ZMDI2dsjNXAxr8g+1Ov2LNxWOTxN5w==","signatures":[{"sig":"MEUCIAraD8xmZtiXnFjtKa1o0ZD+RtJVrJ8Y1i/tC+/+Ud2lAiEAxG4QMix3CrLLmYvaSK87xi8mvnGxj2A2OTWDvIUuP2U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":243886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBulXCRA9TVsSAnZWagAAX9gP/1ZKRPZJ1V+n2PMz45JK\nftC7X+qy4oagR6r6QR3gY3A+9vn9z1Ag8ig6po1snHUXRqrfiNQZ6FDYQEat\nJqdP7pzDS7bqz27DZTEj33evWB2Cx08md0siQGuiVo3GPTcLSOpQcN4jnVms\nKvCwV5JtRKe7LtcLZUw3t2zozFfM6xB3/XGkr12VHbU6omaY1mSBppbsdDFS\n6ZOimWlnCBc6k4wG5rL0CVbxb77p/QI+XiQ3bVfFuYEhLkwvh+L2rkFRGPt9\no3HZJZD/Zd4ExREzhfuLXMUh5WJ6zaUlMCqOf5KP4tidJ4Dgrigq9ducKmcT\naf3RtNeQVL6KGssu7t9YbruM2267hGBsMg5XQS7uLGidIJBg0QBPUSqCFvPo\nwpEjgeBpHa1CYllgJsjARBAH2ASnp035F889leCiMzwWHKegP40bF49Tx9ol\nSFGrTj8NRy/VnfYQzDpCOwqJ7i1yQugrAj5R612qAR78fny8XRDfwrd4eSIl\n2PqwPTq9PYtADVWtE0bD0zB64Q3q5IdGUObytNbJl09FgP5VXKnBDahqDORG\nTaP6wQWJWAGeFyixMSZihDkr7sQZ3fMIU0EruThQK0k6CyEru62BIqvHbaV4\nAftWH8LY0UvJr5KWRCDxAIJBdBZgXF/tkiJcO9DJdhGwHhIZPwuXSISA9ucl\nLJY4\r\n=/msy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"31fe70d32f7e70184e9cfdc4b859bda0cf7dba7b","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-31fe70-kcem6i7z_1594288471175_0.6943571868253422","host":"s3://npm-registry-packages"}},"1.0.0-feature-6538ee-kcfwbuk9":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-6538ee-kcfwbuk9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-6538ee-kcfwbuk9","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7de385d27edd2da26dbd87f84e3349e8fc268b2e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-6538ee-kcfwbuk9.tgz","fileCount":93,"integrity":"sha512-2v/dtMURh37+AVu3NUK/D5fZ3UoHZ00p7gg9ZDw+SZUpq5iGk9CHGWKnlP3HoEmUMt518u8YJYgSIeET4ZCOrA==","signatures":[{"sig":"MEYCIQDS8rinFfJtomfhdi6pE8sW/u7mKwdR7sU4uYIQKL1vLQIhAKxpmyWV+BJkszp5zu60tknbZB4BGhO8SkL2WUsQeLzu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCBgdCRA9TVsSAnZWagAADiIP/i/BFhvhEQ6ZTVolq4nd\nuui7BMWyJvmASYh28ql2Nfeu3f8g2SRlHs2KTclRjjZxtYzyqQNlJGbrtzwh\ncXh2hVow9pXbO6q1X/v/PrBhAEW2LiGolBwSa681jC1TAL78Va7G0Rgbb3Nz\n2+QoxKD57JyXPZM34alZSl6qqqaLw6WGWR1OGolDOr1VIW5qVBjf4HJ4rIz9\n7zAQcB2+l/ad1Mj4Kd0c01b+PHeCmRneosQlGTU7f7J7PVg/DLxAofYpz+rG\nq7nglDxXe6rktNenUzUrT5WzBM2tC40tPYT1rP5YH14mPXES0GqhHiv1y7XD\nUx7EGQjVE5BRY9ysRCFWZBckI3yEMu1OeUvMKseMNhxj++5kZ4fx36uOmsP6\n0WcTEG/wwfgfV+3GYuIfvtmlPrWBTgzfsJIEBLGdwCeBCcZjrke+K+EqEz2d\n0oQm/V8xvTlzXP/yxU69+skfiRy+3d4MA4esm1xRAowCCqU+trgzyC1Xy147\neuu+0gs5KkYrCB5P1T0wb0F86WStLA8XpVKUefkVBGbYHeE8Nu6CXmT9JfQ3\nIULvM6zKClwfD+wDDLvFOhreaXgk/YByV/aCxCp2f7+jItn5J+oCjybgaE4y\nuBcAkTWjXNJPTsnHFnpRCpuBjkQA2vfpO1oyaFFBakQmg8jm1iiLGNMamu9e\nLueg\r\n=5/T4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"6538ee6630a87d3fabf68fd976160e82cfb5ef09","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.14","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-6538ee-kcfwbuk9_1594365981085_0.5641897617440021","host":"s3://npm-registry-packages"}},"1.0.0-alpha.31":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.31","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.31","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"957144c96397f060b769b9d6bd404103b28f3137","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.31.tgz","fileCount":93,"integrity":"sha512-B+fUdK/r5EVBe0rJaJDilPpXXy4SWWKcPK6A6SfVLxdLHvs1Rl6McfoQXY2R5qbFfVLCfw9xDZhF0pT6QSziWA==","signatures":[{"sig":"MEYCIQCYncYMdVR7ZOGWoWyZve/RCyHfSA04xSdFwFAnvwVvNQIhAJcbS3M9thjM2+fXuZt+K0SUYW6BgkwJSp/tW3RjaFeJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCBjqCRA9TVsSAnZWagAA9X0QAJzJ9RRCwzHCh+VjJYzy\nCXro8tLgvM4MhT/qMCw5et7DUERuqnw/ZIUYk/dBG71kzKEWzNVh6lhFojxh\nTU72lEDNbSRXokcMDIAAs3SugD13tW1y2y4I6Wq85z88wrD0JpH7VrnPUuiq\n0QPzylRxguGTpvnwfEdszxluHXPrd179xokJim7DajGsSo7ZSN68xW0l3tKD\nmx49lHSXD1HwheVchDYHb6SAUDU6NDq1bg3/h9iNjkFPW8sDIgoFK7x6sfDI\nP+voQF+mDykMZs9QCN4Hk8nN7M7YuIO2aHRxtS8mRThUDESyQA7/OCjPW7dw\nvJXiitzcBTHEzz7sJ1owt40NsKASZSEmmzi6SZ7JpvluV1/RQYLH0/jm6zbT\nB7W0S/kbJtLEdDR0x65xVuMv/fkeTII/vHZ6KZQS2N4qkmbGJpIwtoEUWNdi\n3DaFFO/UsYykVzwhZmrcMdFq0yeS4xncpJcPmZRZ38f6tOwajmAUeZP2K51T\n7ndamn+80aunewAVHFzdZts2WLRJbPunMWBM+NUN+CSXM4pflCPCARse3Zti\n09+PZjYmZ7xpa4N4EoAyw81aXiG4EHjaEzFat4ucBSUCN+DiuYYJ2hFyqaFJ\nHHG8SN9EFGq7wE7Vhnp18iGNS25G0fwdLpkiU1IxbEELfPRjPSdAPV5ebvN+\n7EeP\r\n=MbDd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"b7594d80df6832378e31b39df49320248663fb20","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.14","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.31_1594366186408_0.29498863389147556","host":"s3://npm-registry-packages"}},"1.0.0-feature-75d1b0-kcg0djct":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-75d1b0-kcg0djct","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-75d1b0-kcg0djct","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df0f093580241b785cc39aa890dc5b8d44dddcb8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-75d1b0-kcg0djct.tgz","fileCount":93,"integrity":"sha512-kV943rphH75mOOqUWmfKrFZPpQ3+FbgaYBY6bYllSokzuQpzgTbi9NvNyYZCN+hitE7tSQ8BDy/7xa7b5af3Ug==","signatures":[{"sig":"MEUCIDIXz9kwb66cJMH2Vvrz+a3+YUcBQVdXTqYsbgtUqC0CAiEA/lIDLSj961NQQxMTWc0N7BN7d58V5QGjngXZQA+r6Tw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCDKtCRA9TVsSAnZWagAA2/cP/0zDVb1NQzUoqgOf8z1f\ndBiuxniy3gws2TX0gKUEuxtxo2tx93GROTvHhq7ZLl8/JaOrf8xw5F0TwRUK\nRCJopYEjYvOL7upOPgh7oLdK3KrVWzDnhwsEG/REsxwjQARN0pbQL8j8WE6x\nReBbmwtK7rfM5XgBOuYopDkQP2HeHVlIkfd/8wwzjizUPgSaN/uiw2BAz7p0\nArqiF3QoraXan6WWXSSoxlwTy51kA2UhpJkzTzZltzamjqfvNngG0ybBDkHW\n55WQvHxNAzIfmXZZ65Xq7LlIKuR7SxsT5iuRt9BUqgrJhSpq4No1kTxsFW1c\npKUZFrf36GecCGMVltKhVfMaLP/pOsCYwiPqr9PXg/K+to0it97GtTIa/3Zo\nfrcmZQS83UU8fDEcfTHyWQLt4wx6FdVk5ubpxJVhCcobLc1D9WMQlHQMTJI0\nWN0zb6tO2c4GUmNsWZSoRyDAmomivNVk/nPLj8p0N+QXvAQ5rwOtPwn7CrM9\nfQtMu883kShKfoGwbQEFitHPfrF11es6+b3OYojaN8P+tNR04zvxHInZ1nyA\nkKNe+5TL2v3j8kXalzU2V7repoCu+54v3w147iBSvNWHQktCMt1wA0c2sRU0\nlVemxck99y1nRdct29NAt0CT0cToZsCph0TPk1YZX5dQEMglyl0eEVRo7qHg\nA1Tm\r\n=rXVu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"75d1b0f9f4051ef8f38a2103b2e66936bbb3340d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~create_swagger_generator","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-75d1b0-kcg0djct_1594372781150_0.28361724846633685","host":"s3://npm-registry-packages"}},"1.0.0-feature-b7594d-kck8o23e":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-b7594d-kck8o23e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-b7594d-kck8o23e","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3a10261f08f5864ea2f6b695cab130c4e5617e71","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-b7594d-kck8o23e.tgz","fileCount":93,"integrity":"sha512-G/jBhWZWClu59nWI3081IUsB6dMxtiUwyuZn4iSsUupz+S2H7uCJN8hhFf16WdA4gAA1wThl5y9G3F/DTaIewQ==","signatures":[{"sig":"MEUCIB6kkjR7J9nqgQvVyWbfMRfe/1ltjPj+UJw0b1Hofl9VAiEA/eKsutK3Upac9c0X8gZskfk2JY46S7rwApZ9JGMnEc8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDBnbCRA9TVsSAnZWagAAwJgP/2Dsy+/OJQnMbojLE5ny\nEICKSHMqat07NCx2AwL28h9R3xuwc9sqEIrlv2ISgLWRgOg3ah5ptGCBDsNi\n4pIcXEz7QcFQ0/0m5rTAD+q8SJUDF+0vv8wkb8OO1aD/Nx9wf+Omxe5Wips4\nsZ6YadiEmI/6+ff0yS9stw7fZGqwrYlTTWW6iB/MzqnRgj+dXYNuh7/DkZZR\ng0i+2n3TCi4sagj8bmOjOak+Dn0FSas+mUlbh99O7Ui6yZqaXSb9Lx1s2JXS\nH0idjMcThCLpuxOxPi5NMNpasYemIM0NbIYH1d9fuSKlKGpLUX+3fDETbCY5\n0uh2hHFlQYyrMe3KGK3bGebzDu4wW6ATsEVUFDll3HtRGoHxKKFnPUeVZzZ6\nCB0bziPeYiA6x4aqP4yMsxjnAfv79Ll7ZhAKNJcroyfOEJ+LPvHwqln8BO9o\nD6a520oljR0JHeM0bzX0VJ3dMxcJxq2KiyFlSRa1CyJgzsH/wNFIqnGzkXr0\njP2Z/QqeIkhi4y2IZz4SM01ILB3OoaUZsZxlzJ3TZ8zEoFlXlakICAbAxIFf\nnwmZ9PCxLAblbWTe1mqN04fXVRbsWy0eV5MEkooY26aLrZo4q0wUccGDMQK9\nf5tPzJ2rlIhEnZfL4pnFve6F72dm1Q1S4e369bl/siLK+rJdQVYQKdtMpdq8\nimL8\r\n=Lzch\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"b7594d80df6832378e31b39df49320248663fb20","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.14","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-b7594d-kck8o23e_1594628571494_0.7246747421399167","host":"s3://npm-registry-packages"}},"1.0.0-feature-da86ca-kck9kvfi":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-da86ca-kck9kvfi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-da86ca-kck9kvfi","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0e11f586dcd305cc6fa278c8f8c5b115fcb12ae0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-da86ca-kck9kvfi.tgz","fileCount":93,"integrity":"sha512-BmBSY/oILaZCv5XFmOlfMOQcmj6u7R9Fz4XMZjqtnOLDL/U5TPa7dAVZ6wGLxNG5sVrMmsRT6INL/YHqLsb3uA==","signatures":[{"sig":"MEUCID2jkiSbcHCiezmL//eS8B7mwoJsle1Hw1oCgwvQxBRIAiEAyUUGDkFT7ujuckH5UAD8zvNBGwB7c7OyGX6NN9CKm/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDB/YCRA9TVsSAnZWagAAO8cP/j0PUXIBMWrsZhzdHVub\nMFARBJ8m+QTbrGBg0FE2wvLAjlCZ0qPpJJEkZSpnE72QOVg5llGh992rMeCz\nxNr03aDTPPCyeXWDE9OvauE2WYQwOw2PGIV7ogp23R/lwXQLT7730bTlEL00\ntsFsGdqWOCDmML9tLAEajXepxQ0wyGcww0NsA2PNbvtwomlllErx7kWbet2+\nkqwpA/kr217GkPoPCCT1TM6f1gY/glYqjGEb7KvBKGMgUw6VNZ5dzOKjTzK8\n8mVIkFCt2OafnxvXqqXraZ9qPJDVbWGn+6nvAgimx3Yp6QQe29YAdRz6M1X0\nj6MzDw1BVgDgRMrrMUQ3WEgMBvBav5ea3+3/leTFspKoffKjqYfyJxfPtxaf\nudC2mUW9zqWpzsf+G4frY1wSe8ABNVpSPRvsfxKP3xFm92EBP/F4aMjoKMYe\nYgydVcrkK/R3+s662XHRFQgus370tzwX9GZ4Czwidj6oJ3ftoT6/MJaMymdZ\nBB8a5GVNRjJtvodTTnAq2aj+MT4M459jY3ilNQMCWsPDtWF6mlbiBLIDIsf2\nZlzZCofJ/glFgROm/9zrYkkU1PKG1nQzjdGKgLsp9bGCrARq/vmX4s8deJ+b\ncL174pYsotkHwOBzT0bGO0EqyKhv7Nd2Pjd9wYDpVLzLVJIa+ogahxBgJuuX\nHOD0\r\n=Kz7u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"da86cafb0ce15a675fbb5f3f86e9a7ea3d66eea6","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.15","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-da86ca-kck9kvfi_1594630103821_0.05434033703676966","host":"s3://npm-registry-packages"}},"1.0.0-alpha.32":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.32","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.32","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4cc0e212b77c556f124193565bb87d18e1da7e30","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.32.tgz","fileCount":93,"integrity":"sha512-z4SH55nwelar+2JwlC5ASHKn7Igs1Qv6CLCYoIfDgrADaCeg/EXulTpN+mmXWl9S82F7ays/ToTASBkVLqzWJg==","signatures":[{"sig":"MEYCIQD6PzTAIh+E+wvsS8MyRytKXcUHwVE4tC5nuegs2EzU2QIhALJ3hdYM5hYEhFoiUk+NDh+vRMH7z3ZygYTel+2tlP/J","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":241817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDCDWCRA9TVsSAnZWagAADCIP/ijF2uZAKmIgSrtQxBRq\n0Vs6orrKog6hWMJP8nXsShvGRCMyL357uSQJdGvgJwbpByNVu2tUf4KmCNXK\nE8aO8eoY4LnCsSQDcPRGmzX/PY4fc3wCpj4cQ8dNnO6sdXMAUba5sIyMSfNA\n5KcieYNRL0TFIk8A1PRkMidGUV4LD8soPuphQsZnm5WROkoT01s+DqsCCwna\nVMI/7KklWKrajKqyKJqsqZbxsNyH5RK6eOBl1cwZNwJMPC6ubHJVXORxI/rQ\nG3u5jsuRsyFPl8O8XjDVIOIFniGbxM7KE4TZL0Tb23VZW3GxqY65BOQhWffJ\nWFdbSQdnROguqgHHJyEbtkSXsqDsxmotgOPn+kMDmohGtzRKq68Pbq7OlcmC\n7qDvgn3L3lOKEQjJBDm5P3DpZ/mVZgeKBtsZDgjSmKerFozQ83EKv05rirqn\nz7zyGiS+aP1P3juqmlFP0WyClkDKBQXC1rpx4efLuLMIbL4rxoZLnCK0po+v\nDQn4IqxYoQzyz2aeLBaluWfm4EsxOuE4oDxN/15buOxZqWu6af/yEIu4r5lc\nU2VaD04zcx9MPK7L+C+xsB6jkLsG3gSBsQ8QVbatagGHKZ3p4xHiTjTp2mWF\nJIhc2Mls2ogCiYujgxQ993KRlDsmgF/P1QNXJvEOL6mVp5WqEoTbCwKDrgJJ\nbzQv\r\n=fW2s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"21815ae71ca62dcca853ad8b2436c3771373c914","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.15","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.32_1594630357840_0.8224256686355114","host":"s3://npm-registry-packages"}},"1.0.0-feature-60ee24-kckc8usx":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-60ee24-kckc8usx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-60ee24-kckc8usx","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6df603a540c6ad276327be8bba6210c8e6f6aa3a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-60ee24-kckc8usx.tgz","fileCount":93,"integrity":"sha512-FCxSpOT7pDamtgESqzo4UkFoyGWZSLx5ntqhhzuQqUoRzPWv+YvuEmWyzZX8KN90BwTgyWvP2DSfBmHh00TaWA==","signatures":[{"sig":"MEUCIDClpFC1/6nrllxbgzmwhTmBPhCurL0GCNeLuao/TT6/AiEA2JicgmwFJCLaMiQ+mrPp0CsLyWR0I4yCanKhdW5iiUg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDDFVCRA9TVsSAnZWagAAOtwP/3lJO3NhboZk8pNbeovL\nUInO287IjH1yhIcIdvkiA7Esj9WNrYEsYZ8aaXG+nuZjh/SaJw/PGUwggSsB\nJ9jZK/ORCT0U+EQDOt30f9M8zga20na3SKTJ3ZJAjd2h8j66Z7K/iiNvbRou\nUWKG8yUgR/8PP364IYgVHZToUCZ53RZtJInLcj86Hc+99tctBVc6QLWXtMPY\ncBj6+dYK8YesKsD3Y9snKZ2rqC4tfGnlZl6G8lA6Byo9C/timYAqC3bg+/vI\nbfe/n+PwWutBGQZ6xak2czgNAVsXj1Mdr1Uiu0XWfxEALdB7257cQU0WLp8a\n70Sc+/AE+Y5HNxGdJ5nWHaRKXGve7sD6JzDmN6F/RZAD+J1Dy0EW2DH27xYv\n4jXYmiASH48KQgAQ+sgP05ttNkQDZQdL82Qy2WTyMMeYBLUaPrubOM5HZdag\nR+JPab5HTFjgBtCbE3xxuB71iYol8vn0vGsO9XaA9ISfKey/a8Oka7pM+v0n\nDs13TPDft++fya/4fKUQmhiGLpy280oim0zNADMxQL/IX5A6z9hBGqu7ZS2S\nAVeE9SSBnAjJa4bV/MjO8AW1QkKCVcfNCpsi+2Wa+7z2gB5qiwcPODnyTdCY\n89AM4DUyf1Nduoe+y5ryze+qMT2mp1J9TeIf4G1r0kSHL8jpwaJnkXPNqE8U\nqTJm\r\n=o5Y0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"60ee241b83ca05b07fb242d66581490dd6e4aaa0","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-60ee24-kckc8usx_1594634581341_0.19551643642430583","host":"s3://npm-registry-packages"}},"1.0.0-feature-552f63-kckeqypg":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-552f63-kckeqypg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-552f63-kckeqypg","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"141463defe097932b7fda147beb4a389a583d523","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-552f63-kckeqypg.tgz","fileCount":93,"integrity":"sha512-uztgvmaQRMLsj9Tg4y3FVM1lVLOVT1EDxpTo3EXXHXcfG5WMJtUP5k/zKxWv+Zu9GUydN8S5NwGO3rwq2Fghew==","signatures":[{"sig":"MEUCIE7ewU2G7NCUFpb/wkL82QkVdNbGmZeXJ8kCM6Zyz2S/AiEAtWZgSdj1WaHJi7HMoiSwuLlkgKsD3xUs61qv3B/ilTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDEG9CRA9TVsSAnZWagAA7kkP/2RInjGISEutb58M3VEG\nl89yc2S01qgwOYbfM17McmcrfvwNc+QpI5+O0QnKoPY2nREJ53wUO5X6j7s6\nF6dou4bKEphrW7djiMHZKX3yzN8wzh76JWdD97vkCK8SnqTksJR9w2gvXAvO\n2NQY7hx9Snh2rsm42AmGbLpl584R/LxPWMwPwGi7neR6eizKNjJ+gfLtDdZZ\n6BjXpFduAuG9yo2U4CTTDK54jdgsTwUrmplp1ZTk/zWWOKzqtEw/KqTMe28v\ncZQew9eumbY/36qC2qZC1y28B8X8vSo16+JHmXvxSJ7RaD6xDB8zJISvWpD/\nfSsyFjFg8dM6o3Cg1PH9uHK47n9Or8lQ/oIUjbDKC9Ve3Mon+SDgSYAfwQLa\n3kzJwP8krdMSuyFeiDtXroGDn36VZvsTJPaEIkcpyiMV/T1A62HBYaK2bxhw\n+KoPdajtasx3/osv1yLz7+7X1PR1AOQvHG4oXLviH6+gW0hsanwUdJX+t1Mu\nGR4l0eoPEP93t118PKerVgK0Dw7i7QVJWuYJafuoV5klJsbY8mYSLcTFBOdW\nfCXz5RfrgP0C3IUv1sOpb0qUMR5MsU3Ksa8vVJI6gcVR948ZC0SBfH4bUe4J\n4yyf482tNk78ppJyemfBRfWj4aqI2Bf41ZoHhUTWkHiGjwcVqbhBMiJoyC1t\n+HJC\r\n=zvi2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"552f631fb314074f3493249b99020e02f9307c0a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-552f63-kckeqypg_1594638781310_0.5426369236022288","host":"s3://npm-registry-packages"}},"1.0.0-feature-360250-kckernrv":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-360250-kckernrv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-360250-kckernrv","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"074c3ce475ea4bd70832cbc4f20a1b76b2122849","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-360250-kckernrv.tgz","fileCount":93,"integrity":"sha512-/qsQuJ/tOEDV5XfbICG6qjAOzhMQk0FKvBhMUj+8eaBQlXCHpZ/2dhnQ8EUA+SySlt0TCsV59GbIRYzgPHFwRg==","signatures":[{"sig":"MEYCIQDoTlyhTrf3bqvnB7haQLSBlmnuoQWxVy54tBkhCn4EWgIhAKk21LwE9pWE1gJKtSmddZEOuhxCI3M9ttpZpVX8ZCrH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":244585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDEHfCRA9TVsSAnZWagAAf9kP/RbwT0KNddJnGuOEqsLa\n7jPh5HvhQRJ3Wdf+vNWuUShSBUUPXA0egpmrk/7UNPAzGNs77NEpyo0QJ51d\nEUh5MZfSZWf6WRf6XJAXUHUzBbB/AoUdg7gAV0ofaBVj8XyQkcK58p9kfOgu\nJcQrCPw+nZmvuwlhy33yZu4K1sDYsFWKAdLSSWyBoLQuFnzNZ9Im7Ogmi3yH\nvGFke4prXzQg7wjH9zfFl70EZGEHb4ArdXMAbOmZDd3E2QAf55vG8Gf+DSzf\nQvqUmewNoQUVJeY8DAVP3bqn4dt9YHyZFxZ2NTs3smKlzvVGNNq1tYOuWUrK\nqjBqTOpIq7PBOZg8TbhaWGQnuThDvlc5Lp1pm4FDiFK3l1q9ywBVsh/Nce/d\nMGVlpqrawy8jes2No47kcsBEJHRUzKkiiu7f1vw9jvyCTP02qHDHjLb72ECp\nJJAAeAAHKAm1mGB6EQshy1mtxA18m+eifVt8BSIl3HpTqYaQOt+xw8unDuqL\ngUCPaiIlzXHb17dzcb0KzOiJlK6sYl4SqEQBrI9EYsljR5OBHoQA/+4f34Hk\nQkstPuN5tGOUhm8tmviU8xiXEd1tP3Lb4TXDhL32l0as5BvxtsgcjFelCxly\nrhBn2JxHGSMjq0nzh+wB061rW9RP6U2x0Y7HA3LPXmRYltlSdQEYyVlUV4c/\nVL7r\r\n=4AWa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"360250274d7ebc6563a5921164059476d3539d08","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-360250-kckernrv_1594638814987_0.07485357731406661","host":"s3://npm-registry-packages"}},"1.0.0-alpha.33":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.33","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.33","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"66aac877fdfcd67df7ebf8f8f7540aa32c19e56e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.33.tgz","fileCount":93,"integrity":"sha512-Rg66EpAcmcgOukZaEUmk3U4728sHmDMmMCOXKLSGpZ+Z+6T9QJfIgcmV7+2x7Qm9h8b1uy3NUjp1wcpm6bUQ9w==","signatures":[{"sig":"MEQCIHlG9d3yREuPhVRqlPPBISG7r9zytedHQtRqBVwQwJPaAiABHIBy9G0DpjFRdtfdHl3CEP2acOj+BXU4dzwIRBQaIQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDFWfCRA9TVsSAnZWagAAYQcQAIxjBtT7Ch3KEx4ZpvtR\n8FRlpkm3WOZzPlwoiNVZiedSbWqo3gLyf6bY9/jvUvmx/Z0oYP/MzFR07wwn\nlf2fTYhSP6PjPxtXctxdNERwvhYxhEQIol6u0FBy8V4WvO3862AcFWDTTMPC\n6M+u5Yh/udomz2y4ZJW8faKnTWMGDcyMnzvjGC2gvbAtdWj/ZZECyglwbxQ9\nsl8XtFKqgI9fpEwNH9x1QVzQvcpg3QqzXy4SIkGvXE+1Raa8vo0hFkpebDQS\nEQYpIOp54hviTP+JWJSu5QZ5XMLgok5DgOuow9IFW9gBYpfrd87v1gUHHr0s\nCPSFeQDw/TcJkmJlSANoF01LXGV5FOPhHsbeBggwl2ySz2aYZHPZ1x2boOZP\n8K2l+UNVCCkriIcR/EdFE17vqt6PgVRu7fwUDgSc3tIuugpb8NTSnScRiRmU\ncEQKYvBbnwGMsbPr5vzJ/+pj8vOE5j5ZZyU7U6FkiUE6pdTZzC9ERg7OxCMS\nLw2TybgOmDwDAy1Gk/eT5DxxAP3JW4vVZTRO4Wwko74liN0gWLel9HzXeJBi\nCGEr/0YaZrRbouEcMqlpkTrV4Lli7iTn+LzPjh5U8zBKN8McgghEMi6TfP4b\nhgzAdhL8EbWubR9qfidTDoLqRqCUrotpyAU5JGRiTxP0EIi4G2n+8F12XHNK\n+7Zx\r\n=NJEz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"53a12c97d585ee2b8a2261f2f531014d5b0a7239","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.17","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.33_1594643870931_0.5550559806591082","host":"s3://npm-registry-packages"}},"1.0.0-feature-53a12c-kckjecy1":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-53a12c-kckjecy1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-53a12c-kckjecy1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"48993fa563a8ed25e9b1592eb3c69e2e8047c26d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-53a12c-kckjecy1.tgz","fileCount":93,"integrity":"sha512-PERK0JTLhzgMdz4NPiFsG2UzxikDgTbUhIqDbgKvo24hx8qJIl6WmNlZvsy2/EnkLvI4J+oBB1gqi2hn56Ilrw==","signatures":[{"sig":"MEUCIB9ctK4CHYPsgksL8K4e2jfqHHqi97mqGGkI3dWYH/PwAiEA0bhg/JA1tTXK6dnEyE7vwPq9nwFpimi3VM+wfmkHfDs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDGBDCRA9TVsSAnZWagAAO8IP/16nATwIO9NBYdkFZRBT\n1fhyHKyUHxV+gtrpLHi2uC+HxMNhBTDbuTWzHDfPFWow0ZXSubkuAfDQg0N/\n0XwTm6+lNJtiFs9WL+fYcknxs1VsvZ20l4kFZjq+zOlzDPEwiAcrELQa+3Z/\nVYOfgisyudNFgG/VS9qBtL4GxcigTE/+os8HD7DBoAtznxjoUuEJObmI1pIx\nJndgCYynG8+lSkjkIhItc1f8l62K14wAeo5b9iXMkgBq8sQsp6COhn6zc7NW\nkQWn1512aUE7ImXy2Kiit+8E/FmaQ7B8/7yf1kdCEc/QsKeXA4dSwPn204SM\n1bgrR07uPnLxPOqAQPrj8EOGUsfewsWDkBCHJow7CqArfurYSWHIz+aftEcV\nS7o5NIQiUxMKr7tchvHIOcsUDn3pDmNPa5Pz6kq7RT8AC7lDEB7sL7OO9Kgp\nKTKbTsegLXjv7VF0lH31OMDjd6bV3tGrmgNcj9jM8OZlNn6ROcB30dKxZXEY\n9ogWLzjq29OedoRF+VmINZbtIHcF+Me9HmjzoXvqZ3NbV2khctu8f/8D5fbt\ncSTBacvVoHvESYx6y7QJMV/iaaoTzdAlQtxIDIywtqqmk2jGW8Q+b+arNGcp\n81zjqqbMrS+mZvYrzEP7bUYLhqg4ga7mdbtgnzikbISZmwQcnMb/xLoEBIYb\nb6JC\r\n=T/ux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"53a12c97d585ee2b8a2261f2f531014d5b0a7239","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.17","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-53a12c-kckjecy1_1594646595376_0.7664265074861665","host":"s3://npm-registry-packages"}},"1.0.0-feature-e377d5-kckneha7":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-e377d5-kckneha7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-e377d5-kckneha7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"41bd7e70b16b917a4576274f911cfce4c1f5560c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-e377d5-kckneha7.tgz","fileCount":93,"integrity":"sha512-az83XGp0kv9BtJeIF9lJF58ZWp4git0J+D2fwNQispBcxCBL/3STbOL7z6hg9ff7VtolGeBSxGL5q6FExlUeig==","signatures":[{"sig":"MEYCIQDRc9p9IvseguWy+DdvN6K4JfqenitzwlaRXUrdy4hkTwIhAKAgzMgJEgdk0sIzrT7i5fVDcvtB9v2Udip6A+guEV4W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHqGCRA9TVsSAnZWagAAK4sP/Aky1mlBneinPECPUx2a\nYbS/nY/Qh4lcQXKVp1PNgC+GM3E0OMa9dXxDkIkutfzW5XNX4mroGa9vJxXW\nTsthCPk1CWrzUSBHwmQL7dC3TyuImxFBfgYpTwvDd94YDvCaww/MqVul00x0\naf241EiguF4OjR2uULB4/KfDjSt8v6bTmsjpyIZqIhQiPJXQsHvWDPHCqUwp\nYzeg/x/yzhnYagx7qT1qMPAp1C66/yibDSQZAeqnE18MgRyYkyhJuw5L476Q\n2V9dcFTFUqWM2GBzAiJSIvLOp+s9ImlM6upa8SboR5AJCvZwkhFmwd2+W/Ts\nHzMgcX+yP+NqduFbGxmZRSjzp98IYuOGfTTaYNz8kgJ1D4051bqnJ/zVdyrh\nOY0D3fCyN+88b1mrCyboN0s53So/VlykKLTwYGRWADNO7N72Ebw31s+z1RgI\nb4mM2/HR1mjhtWH/72v36CSoBShhpV/RGOo4dqGcomiUQ3ON/7woIOm8UzPQ\nNRl5RaM8HsrdWSRdtaKCz71NWbHUS/9prD6Uilcpelav8aPNOLzJavwl/wEF\nrAKjxBBz6G0QUixdM5QoTu3txzayScNHnhKc+s9GebwMlRbanrDj9rjzUA+l\nF9zdGSx8xaeDg/pTklbLDd+m5LzjzutD0oXsukQVgNdL+cQm3KuBeyi7NyRy\nRcaI\r\n=4iD3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"e377d5df6865f05505fcf6cfa8ceebefce243aae","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-e377d5-kckneha7_1594653318334_0.8830795607912751","host":"s3://npm-registry-packages"}},"1.0.0-feature-497e04-kckoe5ir":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-497e04-kckoe5ir","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-497e04-kckoe5ir","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f698e407a16ce4f94f3d6ab0cf30269f0ba2bc83","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-497e04-kckoe5ir.tgz","fileCount":93,"integrity":"sha512-SkDp7Qz6Q6R/B6L9OocDhtfLnLeYeGXCCjWZHLq/BwuJ9iIm+v1x+WcCrD8Dcx7LEMDGD2+XGOgoWVkdULRDmw==","signatures":[{"sig":"MEYCIQD9Vk8PdP274wLBtVh76EpUqbR6GwMx1heE5rwAZjhhOgIhANgeB401YeFLODVL2iuAVZJifmxzrW0ZdTv5ZLKP8I79","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDIEFCRA9TVsSAnZWagAAjRkP/i9g5SvCUSuZepQYnwvN\nJ76Y8ciP440NrwceSqyyvgDEISHjlI4zjsdgirxUY0aqHRns97If2eW4pkPC\ngRR2FK6Cq90dXM26iuGW6oY43r85hHpO2IlHx3+aU5BcQIiTL6JQXmxoy5tf\ncAhispfhMZInQUtDdPZX2nToIRxSPRUWskgaPg7+B0u4e7Q2Dp8Y1D8rhcTu\niTos5lLbwEehEpWUR6Kpju9kVrW+1r+xn33y5b+bIYKrz/qfhPY3ketihWOP\nfuXQ1akXny3zTpO/XCiFReezEb7j+Ab4bVMPfZYXIWBqXBV0EilkDiw7RC67\nR94AgSbi7VGHSneBOSbbdwk9ir7f8VRvrHpFr/dtmil9iHrszHovh/2G3Uge\nJQsl4dIsMi1ynYj5/j5WLFJc/NlQz+kx2383KOJFkjlo38YBoO37aPdleVCV\noAK80VlRuuM7WpqYkzf8mNcqB953Ry6KaIcSI5V+m/ppoInBAP2baLgZB61u\nIDUCOh/QHhbJ0vsKetp5XJf39dSufQG7FfoiOYMhH0XP4D6FqEfR/vAx8hDk\ncr6kMyz2qkSAcDILG6TBQkkiklWveQ/8EEciUl9wHKtDfJq82IBHpiEUy97M\njQMosY3Ka14H6DOH3hQMR17QdMwwKiCBXxuwhjAV90zOZ/JqHjNzTQ/ox4Oi\nrApH\r\n=SRhn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"497e0415b0e9605c3173b8a4e4ee637a03c5d766","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-497e04-kckoe5ir_1594654981295_0.03921428419010131","host":"s3://npm-registry-packages"}},"1.0.0-feature-0852d9-kckqaugx":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-0852d9-kckqaugx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-0852d9-kckqaugx","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9f23109f76164c29d4558f25fb838215454f4e5f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-0852d9-kckqaugx.tgz","fileCount":93,"integrity":"sha512-SLi6cVz3cvXBIAbPlvbtIBE3xI7DJ9WgWMO0LSbrPGUe7+OFFAegCny/ZCdUQvCOYmbofkYpexrame0z6OF6uQ==","signatures":[{"sig":"MEUCIF4VaFOfGRCHqUOMRpOXQUNIoZA9ZC63g13tvqHSXNsmAiEAyZyRTO2iv2xKd0qX8UVoCYHPAlTKfDSp7s0RmzRHk/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDI2MCRA9TVsSAnZWagAA3rAQAJpUNXeAJF+Q/9gqTxcj\n+Dm2VCUEiQdrUPTZ5apK6Vs3HMV6ijlTePNVzr+Bw/DpbbfQo04OINXQQpdD\nORXDhODIicUDOtBel/DBPC++sBAiBlBdBs8ncccKLCV5EGhYcrjwiH0Gwg/e\n/VGBtnh1SpMH7C2oUVluMerlozxtXd2U2XiGNQhqWFb5p59h/ir0ownGfOiv\nkfdYD3zbvmIjcjutXSJfRprNBSwSdzL7Fe1w2i91ZsFF0YyVmr8knJZsLwJA\nXDQX5COcl4PaY+nJnl+grP/ntD4NCImnOtYU3KWlvzD7VaCyra7sldAY5O6+\nDIj1HoERh6EZXCHx+RgYwpK2FQbDYyp2coKciX2d41prND8gXH3YP/q6vVMn\no7twPwoxg2U1An+oJ6/mah0n39Sgt7j+zBaKldFkDw45fszmE3hCoMfUpIKs\n4LBOx2bFM69gowBSZ2k2d4sEIianZtGfE+/Xm2wdGB9g6Rfmj+btuYHtSqkM\n80awlgPRnJvTVvHZ3B9otESGs2OIZNRKycQ2jab4aRk5T58/ymnYlwHvOCVZ\nEeeO6y5t+Z7Ezy581qml4esNkUEWzgqyMarM2kwxJucmjuUhDmIJgRP/HHMf\nwma56jOyPOp5qfQ2sJLwhjCi81FXLlfL2deovEwYN6hBpz6YqGuOTCEvSS3B\nytgf\r\n=+B7/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"0852d9b2e7af6f1de0ef067ad47830daaca71e7d","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-0852d9-kckqaugx_1594658187707_0.7462931104963895","host":"s3://npm-registry-packages"}},"1.0.0-feature-844ba8-kclkuigz":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-844ba8-kclkuigz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-844ba8-kclkuigz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3654e2885f171c008e9f84f9a1f557e39f6bf0c0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-844ba8-kclkuigz.tgz","fileCount":93,"integrity":"sha512-VSpS/UdB36vIf4BJugg4hqf7cWSwCo1PLwvvjC/SaMjCNXqoskQN6kbUEQ04J5uZMzywIHmholPsdn8rEKWs9A==","signatures":[{"sig":"MEQCIEBxXpQlmWIH+rVxf2kbOj9BoOjpnnVIknCs/1yUNEkjAiAIJePBI8m4p7GwsaAG5foe2fa22q3fXJ13AZkHj3BSuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDVX2CRA9TVsSAnZWagAAQ3YP/i9ILMc+i2aPIYyndhQg\ngiGO8wtLdcdA967BuNjzwF0v7jG2q58w+6upZuEn7RinNVhan3Iq/L5Xmrmg\n0HGtiXBSc7hMHObPg2eSuzz+ZlFcX9BS4mU7H575QukUW+8dUZl+ZaeXYKUw\nk6CQF3lZwslDp+VcJI1wtoQYOyLrau+v1GTAU3QImGN0VDLidADZ/BPA8G2x\np7LBR3XU0fmMraB9r/r8/sIxVPgpnvy6EBbUh47w6ZeK3drDOfs646QFnF9U\npSXYSySd5BmWbcimmrh/ooVLhVk2ipaeUlm5IbiulrSbQEZwxMKSvvKkhh2X\nfY08Lka4TEvdpOOTAA9trMuMbgsY409FlaZz+Cv4D0dUZ0YAOdExwDvqf2VW\nYPY2CI/YUBUh5O42hkjnoBj07ubKLt0TyRjTuN6eZt3H1cVDHY4bvEkwiIa8\n99Dwgg+2b0XNBCbLNo7nExqrSrWeKV8mlo1plPz1ubgguqQ8ZGcKFfpV27Jw\nQfSyeM1NFn+APvXY1RdXkAga/F52qh2Ve7lvfpt2XzPtaA+02QUpUgEHQunv\nryh2qVfphojnNf8D1XKr8OuiYSdmIppu43XofoxQuisyUCIkUYW6D9/GJ5U+\nPxgDQM0l0XRIGbW+3l9F1/Vq55hV0sZ4RHDRWhaZeSDRbO7yPRrMLdVJigz3\nBKpd\r\n=Fu+q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"844ba8221d28549bc5e377262a8bfe9064cca96a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-844ba8-kclkuigz_1594709494073_0.12744810729496714","host":"s3://npm-registry-packages"}},"1.0.0-feature-2f37b5-kclkuugf":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-2f37b5-kclkuugf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-2f37b5-kclkuugf","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"98ecf5f0f6711fa24c8642b80abfc078f3650e56","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-2f37b5-kclkuugf.tgz","fileCount":93,"integrity":"sha512-L+tfW0xHSKEAjZTWmGk0O2+41dag1CV6655Ik8Es4z0ZKvxQ/1vktn8T2i3d2kA29YOsZI2CmBrdDN7+t1mY7g==","signatures":[{"sig":"MEUCIC0tym2V0Bo3PrUVHk2fChoEF6mGMM6M2ROwHU+aj7Z2AiEAlZ1DwTM6P0v6Xu2AB+wMcWG0Rc/ZyN3EFy4FN1Q4Aug=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDVYCCRA9TVsSAnZWagAASRQP/iBfRqMRWn5K3KYqZZpy\n3grFf26CYIVO2ZRo+7JidoRcQ6mV7fv4OHgk1Szl9x8lgKxVnKOchARlYmuW\nV0v5ScHmFEFrqVnBonFpohMUIbQNuOd0hsjrCZfdhX5WyM94m0fN0vDHaMUq\nTKUSx9ckOrpnnLfNO4Newb9aLC6mZ7gIPnTBaTnYa2kWQ1tAYiP8rwAtU+UW\nmzoeSP59sQ7x/RYOKTY8ODyiHfJdi/eD7m84LD4qAC+QsaZCOF8TAJKzJ+KU\nx0ni1DMP36BP3ihydH43pOCC5CCzLCzobpj/zMy8AqKeltJbc9W5oA0hjVDK\nrymnA9DtN10cHMVQedhAIz8DaOsRJzacJe2cUsz7WGmiNzQ5xBl7pNg9Ztuu\nTk9aMPRI6YPnzYT2wn6rkyX79PtsAqKXH+j3unGpAOdHC3pTJ6HduuBZ4aeo\nz2Ugcq8jMke/h5XX1q/3Hy9ARehRzgoO3ZD8hFvmudttFavlpBgQv+OyG4dn\n8vHNeI7qz/pd4nJ/RHMUU4HWNLoEw8u4q//lkQoJkIOpR+InvZ4LYo/AGrgL\nhyFwsq7mvkgzvQty+NUvC/SUcdUFwGO0hRJERKJapwo4Ql+nedWitY2djhy6\ncl9IjyTqsA7hfstPIV4WQJek6q6pk5948IoO26MSegwqHRCvb70KGpLgUeS7\n98in\r\n=sMi8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"2f37b5aa47eb34ac9fd0022e3f0ccdd74614d1bf","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.1","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-2f37b5-kclkuugf_1594709505611_0.02221067916665298","host":"s3://npm-registry-packages"}},"1.0.0-feature-529f62-kclnmtgp":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-529f62-kclnmtgp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-529f62-kclnmtgp","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"be2293738b703bdb33af917b14d2f91b312127e0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-529f62-kclnmtgp.tgz","fileCount":93,"integrity":"sha512-mC1oWJxj8EboqlAj5VPUPaFd/fQ9PSfhCbZxQG4my2Q72B9MDdbukHoUkTGiphPouH6IJEKNuwiFTPNDwmxJLg==","signatures":[{"sig":"MEYCIQD8x7B20rOwGaZaW5WMpx/P4625g1PCbpDYfQpMqSfZowIhANfmMkbv0PLb13NHLkPkl7Wz/7p1VotU8EU6pn9iIkfA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDWhACRA9TVsSAnZWagAAh0IP/RRY5jV9sJiQfguAS3mN\n2Q5tvrLTqjL9Tk9kc0Yd4jir2tuq3o/bO7tx3h5sQiCTBSWBODZqyWl/YP61\nSBWyG1CKIZhAfmHcx298Kf7HTrMB7MmJoOfK3SB8ADECZw8HLKwkyLV4EB71\n/eToZep72HUbAVzBWPr7Hx53xez022DbQDUmlcPHMNH9AxxI0GJZeZ3JZbYW\noBOwtTaJFUbbdaZfxzOgkcyC4E7Lz3o1v71wUY3Aiwti+aa+XOlMN53JtpWb\nlkbTWaMCoqjBoQOpfWHjobJr4JD62QcPBhD8YQNkMG82k8EEGQbQPOle7K47\nzm79gHvFljcb7SyYeY1qn1WuSwCfcoC0uq3sAm+p3Ci+loPH5Nh6ewhQx5J7\n969L+Sjj++Mrh4BektNZM4aBH3aNX1ooGYnd/3iZN2gk703UeKtkUhVjsDYR\nQi0erSuI7caVfqR9ADQSAaThL1mvssVVccVjNZTrFN5wnHa2VfOSJEi/WhAJ\nnrEy0AXX8O2SWC4vEbq9cg9DL34zf+26YpRlJ/E6oUGo+tp28cBxBKb4A3dh\nEzg9cfA2x25ed4VkgWu5uTSaF2r6TUrJUyhOJPPJ4CEt7b90wevuU/evRk4e\nOMTl6GGW4M1NQ+ZG659emLusKBYjN9b0YGWKAJKv5dPIzvMIU8J5JPSTBG1L\nBqcs\r\n=H+0P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"529f62f7963dc1ed6cb6529963ff0773c3a8ce0e","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-529f62-kclnmtgp_1594714175638_0.64224944073981","host":"s3://npm-registry-packages"}},"1.0.0-feature-df929d-kclqf6xs":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-df929d-kclqf6xs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-df929d-kclqf6xs","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4300e06c0dd3178c9d5d35674fe1feb036014212","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-df929d-kclqf6xs.tgz","fileCount":93,"integrity":"sha512-LxkmkVoxX2EBtXIIxUUue2zIH86pI9xhkqIvn4ud7n65LMQglHYFfmKU+mi4KJb6SWp1VqqL4u/MXRn4iZCqwA==","signatures":[{"sig":"MEYCIQD6HRYGVjlDMjeim1mtCM8mFzJ08Az5LEQV8wRm4OZ/SwIhANbv64TJ31w8hszsX5jF+LXJxt9fMp/q+ZedFjTZk+nG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDXqJCRA9TVsSAnZWagAAjJAP/R9pDGBk8qSL5UvBXgsp\n9mXdeODmtIrTb3cVsD12jYXq9JePUjCHE8o9LZgyQYtTXGlkj31PkVC+Woil\nQ4UdSPIXnLBv+HJqWZgBFJ1+scWX6H873Dgh9UaPySylJDRAmrlp+4V6MZqq\nRcC1AXjV9Amfh95m+9pWW61qeQNCnc8UgWrdrQDcKOmwOw3QUewcm0vcRDOV\nyUPLngZ/MrQNWJ3IkFAAL8H/MZEELfjDPJg+raWt3o81MGlZOGCWzlHNe8IE\nr0tbTOyVitwO5gNmNAY5BopkNR/iQCnkOXJn8TuDr9Zeex4pp1LjRaOIHFwA\nZn7lIYNLRE1VrOMwUfb/a+ZD1Y4i6MbDkS5kCW7w4Br3Kwj2Pv544LFbvMYc\nDpZIrNwWNJO9Q/7ShAKiEzxIIfTpiVqN3gPIa0/Bays/z5VWqPigLHwE4JCC\n6fqC2WH0VyYoR8WDbu/E2ChaYEfdm/QpLj9fza3QGCx2aUhpMMU23Ab40O+B\nv7dwcBVW6eryZL2WqXmEKuqLsIySivtYvmSwqaC41ugJiZpAGjtaKnI0br8J\nkpvBTqUSwm8xt9tMv2QX8ZHkKJNiRek7iY4zN8rFaWhIJeXDSvtyZ4oCbske\nHZKlH0muYn1FqOXAG+vsNriodPKN9LR5IcINxDCADimOzrguu8S6R5rkqVD2\nSCve\r\n=BjHX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"df929de4312db309bf73391f5620aa379bc4a332","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~validate_request_bodies","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-df929d-kclqf6xs_1594718856846_0.3076090150510391","host":"s3://npm-registry-packages"}},"1.0.0-feature-49e398-kclqthh3":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-49e398-kclqthh3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-49e398-kclqthh3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c0d5a8e5de3c7f5912fc41c1bbd6e608475a43ec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-49e398-kclqthh3.tgz","fileCount":93,"integrity":"sha512-ceAKlqnXwCDNHVshQeCS88S2b4IHu5vYdsNMGW3awJy7A4nOwLPbt4gZZdLNQO/YeGEKeyY6MhPMGtHh5IKaqg==","signatures":[{"sig":"MEYCIQDOoEfoA3zyAc+dK71+/SFw9GP8VAgwPFgCtbQoFK19ZwIhAIrPOyt/ZsernVFthcadavHKottUAOaeFvebNT8/2Ufk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":245502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDX0kCRA9TVsSAnZWagAAPG4P+QADghQzxxWZjNlTTRIQ\nYqsvy268uvHS+7ktZTyIeUuGoBpoD+Tvvw9+zH9FY4TLolImfAQDRKklg5Hy\nAETi+JGUiMFD2Xc2Lm54AgqNf5UqyOi+1hjeqC+uoFjsTjomNk2cJrLPajrF\n6MopX2j1z1cOMld8lWa3WzT7HT5bFBx38Yj9BAnSwWRvex/fXQ7EmlcFSgtR\npcDqs/xaHK1kUYrYRuZK2WCgyRPqwYpDVpwO7zaGfiwRxlvS+lNG1LXjGVN/\nqOkYnMToto94jAfoPJsEzpo4ScMPIyCS4JXBECCnEeA/Xfl19dK+QfpUvwwD\nWEjSevC3PnK+JUQIPnzXj9qVcIzCpuF1xLQi4opTTZ5f+FKhLH1spUhTrjJw\nVhQ4nHBsANosJoYIGbZdm2R1PCwIVVCuGgmCCifbm0YCLeZ96sZeXv21Qzd9\nC35OrncEruzqTshEHa4mIJyjgS97BDt0T13ghO6zPjw3xJHvzjUA9JHOTe1u\nle8ZfQUoFsZ9RZdstCfN++6ChKhhR2v4sTwvLXJ2oIDS6U4OcZcX3zXsCsm5\ntLsVVBDnDcYXtZc+8Io0uXm6/WAQd1iWMfISABgG/HZyymkKkzQ7qNE4t1bH\nShtwvZn5nQFtLMzHDKL56/+C8xblXJ0K6qGALCfXWNFlWxB7OZNA+spFhNCR\nZKtL\r\n=iKK2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"49e398c3bc6fa2f9938aeac4396203ec232aa920","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-49e398-kclqthh3_1594719523829_0.8194303452382117","host":"s3://npm-registry-packages"}},"1.0.0-feature-524f3f-kclrs2uf":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-524f3f-kclrs2uf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-524f3f-kclrs2uf","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f6ba83dcef458dd342654dd8cbbc2a5dbe1b73fc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-524f3f-kclrs2uf.tgz","fileCount":93,"integrity":"sha512-xERzR5ba24emv7G+m6ZzBW1+1D268I55AnWtx6VtVgL0TDDrP5iAs2uoomma1vUmtSOJkVgogiA0hZRXRAnlJQ==","signatures":[{"sig":"MEUCIEig25T3pIc0q3MAJWch6Gx/4heEIMf+46t6mgKXZ0wFAiEA3uIWk/cv7jrWo2uyT5crGv381fVUkkA80NwhfNGWDMg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":245490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDYNxCRA9TVsSAnZWagAAveEP/3EMhNCcvjDOhwgUtW6x\npXStTehOgaEEd1w3N4DOVz/ci2eGUbIUr2DQF4SpXhk2gG8Jv9/FDxRoLes7\nMNzv/VmmHP8N+DYWamomgzXGIXhOBPCm3GdefCyoRRMVlsg0IA8RYRmKZ6OV\nOqoIX6PEBIZxZHSMIYT+GX3N4yKsSDRaIiqptRsLvFO4kSRIrYj0H6lo7SHL\nIem2lPeYaR2PtCU/ufP3zsQgdaDAW33PtCH87k4ASTfwnMGfAE91NVuRh/tv\nZ6ONjO9+IGhviksMPPpH3qLl3fKHyrEcHxKaNcy4WRcDF2E/7ZMXuRwBhrug\nvCuQOJkSk6+pPmdcCapwJRjGXVIv1qY2JAgoeAxKdXdnk9LsvqSc1aSOT6Wo\n0pdLSe6nRRE0FFOrL4xM62sG53KU4CPdUIXoWKojpMUH1/KybK8pz5NL+Upg\nmi0SZHQx1lGYpb4szxOBR0XN8NL6Vif8yLGTHJ22So7Ckqx3+RZbkhcxSUO1\nR7teYeuvFWWhBAoasVz5S78TiyOrreYtHSQi750ovZjRFIhWddhudJtgmgNk\nFEfJykLiPfJJZbRNrCPMcb+pMDBVNatt+tgKTp0KlOnlPBwr9bxAwxGYvTvn\n/1mHsBjzixL4IbB0cVXQrvjux+qdIGO2Qn+Lzyccv51JaqzT/v6lj3nDFUF1\na4Rn\r\n=Jbxe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"524f3f5fb624ac1e31784ebb7df6414bac4e0f53","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-524f3f-kclrs2uf_1594721137248_0.4498419875012005","host":"s3://npm-registry-packages"}},"1.0.0-feature-43bb87-kclruw4d":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-43bb87-kclruw4d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-43bb87-kclruw4d","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"87dc9c433d710ad08f2eb29f7af7e38519429b32","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-43bb87-kclruw4d.tgz","fileCount":93,"integrity":"sha512-C12wJW4jLlIG5b+P0fkTAB+senC/MPpmJZgx/UfKD4U5MzYeqrBOcqhUnvFvJY1SzWcPyoIJVBRb2V57n0N/ow==","signatures":[{"sig":"MEYCIQCoW1oXF0cVbLLtUhY9M7wkC3klt0A8DMEN3seN8zFrZQIhAPaTNigM5uoCuQ4ySIbvWXcBQF9G+78BckauSX9esfAP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":245825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDYP1CRA9TVsSAnZWagAAiXEP/RhnCvaVn5XC91Xs32wF\nJXb7cz1heABGOqkHkSsC5MPtdcPomFmfdg+TGdaAuJixTv/wnkqUwVkO42uP\nuQOuPDVzV7isaZ8TgtsHGc4jSyB4SBpEXBB7o4CNDENf1STA/euvBonBV6Td\nLOutDd2PrzGK6tvZg6fA7tn8fFVxwZYU0FtLhVi9zXHS78kIjITCqPAqSAuX\nEybLlYWj3SoQaPrdn0RSMe+fFr+RFzCeHv+8YvI/XoTmCWr+gcfmbNZEUQQb\noJgcDt5FOAWGVdR9rMTIsGJOFbJpx2EAa5TaIcjkLD7xrM6vjheX6KE3eNV0\n/ZXhJMDhqPLDR2GiUIIr1qNjjj89vHWYO/V5lxxLAalRAo8OcshyCmdg/C8v\noKSwMEN2RbHlyYQithmXyT1a6qBCUOTWzTeUCDZniA20m35s1i4HV+cvjsqc\nEuGVAAg3QJHYsgZrejlOVqKYYN3GsxNIWxxGo3mIr1r9OD59yr+leuuJK7Hn\nj6/UxGGbnMLa/fnbHcHgSFgrIMk57NXQ9gwRXsa2fYFEImx1R4hG9Ioquy6c\nizchRb6u0NyxtQoUjj21fAJbwTlENv+q5EkK0XB8nOooOWVuFuJSjf11ijQj\n65rHZRmc3PkIDRmqBACfw9TlOXC5su05eu0nGpbQ5U9+7ahvjJEyIY8tw8iq\nUaov\r\n=Hwfx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"43bb878b2d7d4bd4d807ee135409ecabe0ab3f5f","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-43bb87-kclruw4d_1594721269440_0.7673987966675939","host":"s3://npm-registry-packages"}},"1.0.0-feature-159092-kclry22f":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-159092-kclry22f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-159092-kclry22f","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7b38ba88e502ae776cdc5043ec2dff33f132d470","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-159092-kclry22f.tgz","fileCount":93,"integrity":"sha512-DaQDlFWUPciwbdh4O5nXWWHXaCT59abJGmCdVkZY6l6Nk+KPZiw6nuq28YFiBbjvIjrY31kqg62NeS9trX7RWA==","signatures":[{"sig":"MEUCIQCGehLkUwxhoEfLQMFw7TRZSo2eCx21bHpZHkHkwyOzsQIgRoxq0TtzGBuT32GHTNJLqMLxWeqrackOAVr/z/vqDuA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":245825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDYSKCRA9TVsSAnZWagAANYwP/A/SsYdtpGwgj1c40g28\nts8VxFp3acAcysbvclQ2RDQ/negvcvEwId/4wK7LV6tBSK8UoxyMpKo+GI2z\nzBs4YdZxwxX2KSzLIeks71KH65dKVHfpvTm5ZW+RwjtANBCqwmxcKlKu7frK\nWskqTqiwCrQOjylEtPIWY2UUGicSvz7Hp9oqzajvaEnLrQkhzkDE6ZVpNJNI\nyb2KfiP7SY6G0zc2m1ZtOIZYgBLRyxA8cTF/vhSy7kh9jDromBjjG7TawfO0\nBMo7/1T/nFW2UbEp8C9deyGzI3iPUdXWzfMVeC3gamgrtBF4G/PQ+PIFrfIR\nVg0Wk4rl/DBfJVI5MGkQzTbMmJ212Qxl1hz2mVAe25izo1ukly/lEg3V5gBY\n++aqgJiybXLZbFAhifkXkZIBP4nFTkzxYdbRymKyJ7qjxEshn2ba7Bcm2shn\nYwkh3PEfaq0AbwW26AKB3y/BaXKKxo0Q9RN0BVJEW7uVtN3JQqs2J+zNShul\nstEz/nVNGMaj0dXtuEjmncsM8hWcsdhmfmXu+4CwXijcaXlhN0r2N3Y8U0yl\ny8eST3zs5Hbr4bIkXM6OfyMX8UKdW3DqPK1Who2ndSJ/otNCXW+xvjoUYubt\nSRx+t2jt19Ymyaf3/Q6W4xQTt6MJYwFXnmmfBR97wckGs38wLg/6APIUZ4Qu\nvwqU\r\n=ZoEH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1590924beaeb51b59c17476f4dd037e9354cdb58","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-159092-kclry22f_1594721417345_0.6173045898727232","host":"s3://npm-registry-packages"}},"1.0.0-feature-959560-kcls68em":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-959560-kcls68em","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-959560-kcls68em","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d4c71ae7e7eaa694996db274b148f75b9a0f95a7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-959560-kcls68em.tgz","fileCount":93,"integrity":"sha512-HV/umX91CyWtOCyQ5hKV/aFdeR4vKlKayN42E/I6SXIw/fX5wgXJNaoj/GV/RsaT088Wg+3CM4vzaGn0XBBEbA==","signatures":[{"sig":"MEQCIBFhVP4YWY5xo3YPYzZgkC9bUKP6GCgckIOFFyMHMwO/AiAsCc+bmszdpAxH1ioxM4SSlbbdeqGe4PRghdC88AQFvg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":245825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDYYFCRA9TVsSAnZWagAATq0P/0r8eUUqq28csG83e0io\nLTmGB5C5Lcbuxpl6NlGaHK+z25DuAL+A0SS6e36f3jeZlufOCJZASikhiXAH\nOfd0P9M9auGuE7qGXImn9W37v3lgdHbiFl6FxQlZp8XvVrqCYz4H0fr5to8N\ndqPvrPe+PpwtlP63rlYt6oXapps31vT9w5CLWyAHE3TnSjTHeAyV+iNCstOv\nAuBijEAKvIxcjwqWF78jQjfwakb5g6HgSszXLrf3tnVfRZTVM+rgZbxLV05e\ntvwie1RxP6lK3OBS5OYORIuplT3GlqMOknRuGB1vCuZ+87lDKYulBDfiD2f9\njVpJdGEXU3Ni4GWZqIRZntVmMa0gb4ZOtid5sK+gx6MdqltSz1YLQZj+9YYe\n0YjRFbxkr3g4LeM9oVFd6R5sBL7B4PDbx43O2y3JA5zuwkAJ2A3Ah4p5ckHV\nXjNes5GCNppAdNJs7y/wdUckQ4QaA0LLXR0rCPZg9slXuNo+ZAgy7GNUe1TK\nSi996x7jXvlQT3EIqbaMY1vNehymWxdqzNAkL28rE3C5NXcjXepKQM3J9UGi\nsAgIF7E11FTsUxy+tr7MUTPy2TatKHm/19+xX+B6d1ugs+g00Xd4pshMh4Rp\nio+yAB/MUVk45MZd8HWUA5z68Y5FZW+dVyQwIy5g5XFQdwkVwK48W0A1oxo/\n920o\r\n=Prik\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"9595608a5d95af5e6c40daaa50cb7c2c085d8fb7","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-959560-kcls68em_1594721796740_0.5373974692738865","host":"s3://npm-registry-packages"}},"1.0.0-feature-060085-kcm4r7j0":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-060085-kcm4r7j0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-060085-kcm4r7j0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b2ba5087a9db8b45e0ff6321f32ac127adbb6f0c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-060085-kcm4r7j0.tgz","fileCount":93,"integrity":"sha512-7ACkIOy2ZRAnYqjjtE8fych8mN2fdIz6E40DU0XcgojAmwOkm6yyiYnINBTWJhxazmkKhPj6DrpMcGIWBqpZWw==","signatures":[{"sig":"MEYCIQDADT/BJ92Ws4jJrd3i0455IBkIoteJael9ub0J5m2NjgIhANz7l9cUx+F4jIKlMhWD02rismKDI7QeLRWydD4fzp35","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDdiTCRA9TVsSAnZWagAA08IP/i3f7XwXBK0oCvCw1pI2\nlYYK861sd+7cMijG+2co6cCQni2y0eGSjEtxyF43x+IUNm7y3r59dp38QDOT\nX+x50CBjRpz+/9zY9jKXYsI7547caOEFpIUij9N27ZprnpcX4Ca0qO7x6pp4\noy2CBj4+EABQcGItjXxSAr1c1XqrFLDAgD4UQqdcz2tFh3kfP1yW1qelLigC\ni85W9gw+9MZJUwdlpDJt1ikGRlhpviTWeAs+aRXHU2A0gPLLX2ZcCoti1y8m\nNVQg7MNBWs2IjtMeHcnv5Y+bpmnkjeTkWHbPJ+gqizONObBIdj2+TvLZsCjL\nVZMAdB0J4K/gnqsaEU3iwzIj+7EycbMDpeuG3CVvPkF1OdxVFFxujpgqWJbQ\n+ocImm0HL1of5bTtGjBreQmeAKVoXxhp7wfgC0ODidFHPF41p2xygztjoDzg\nOC2o01WmKhSPkQz8V852/hwr22pOaCHYC8BnYN9rVtm9HVO5swyDaSKrN5jp\nagCPeOuUfmv6/rJzozbrmFaHcWyWekk2qXnkC30syAhwhMHDNRs/DmuxaTX5\nY52S/W5E5GM0ux6dMKrAP5Fk4BSCtKVUJB7bKTynfk+JvOPYRczPf1OuN88k\nTzo5FmwBKW2OdyFJL90qNQ6yRBlf6Ky/gN6ZL4+yGp1dRvAyCQjhyRA506rL\nEzRj\r\n=4RkX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"0600850ee0a24ea1f2a2b77db63588d9be92f39c","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.18","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-060085-kcm4r7j0_1594742931076_0.05288855736061193","host":"s3://npm-registry-packages"}},"1.0.0-alpha.34":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.34","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.34","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"89d9ebe87b259f4021f9288daf146b80e3bda8c8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.34.tgz","fileCount":93,"integrity":"sha512-5uZwknFiIaClczHwlbVojmGndlmya8ShjZXT7SreYx8CT3X3XBJM+FxyM/55EttEHPUgdSyWIPDFIwJgvEJsZA==","signatures":[{"sig":"MEUCICTkeCAK66OkYHZtYtHXMrYGSU3ExtXNoeRsthQlQcLqAiEA8w4le6kvWuuO0xz04xxDHPDGpNZGA0eSGIPxjWX/ASs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDdmJCRA9TVsSAnZWagAACmQP+QGoMuMZHnXheFE6GBhQ\nV2Mtfw8hWeg4O8DzT8KQ9lDIwlvt7cmnliNtD1j66qErygUccETj24sF6WFW\niVYL/+ZLvEDIHT6E8buCURjWZvHvp651FLmBUHgMc9T8+HVMhGe9GCfngIPS\nMs50BzXMyvXt1ekGK8swvHWouGq7MY+LrfyuPGiYtk6GyL+EZPleOu2IlDWW\nLDavntcQgfv7HuGGISHZwBYHlnSGwcRmQnWcBu3cJLbEH5Uiy81zWR+krzpQ\nMNx1KXkTHtYlhcUWCjtkFkNWE2M/10zkZ3ACkUk4XSgXmfSXjsbNNcTF+J0x\nWj/TXJ+Pskfxg+bckrNS+XS7DEGkqgqS77DSQtLqEU/xqWF69vwKGkhXysS5\nANTLAGQxsKTmKrfLnlGxgsLqtsEDBheTdsRNrat4kXb2OgbMmsXKBK00IPIb\nCK+WSTg4dTqxAfgfLNy6+GrHSK2sR68abHjzeT3dcCsz9jK/MoYCGD24Mhq3\ncCojG8w4mEC9shtrxAmJSjFVVTCY2ERMyyj16L24yDHMFXU1ailUDCWAa1Qo\n+a4clPwI08D+J1P3Ag36zvMUF8HmB95v1iI1edL0Kla/aptuV1iSyW4tqVxj\ng5PfuAWfxjtMhgzORlzgS4PyW7CZuc+Zb8Uu3kJWp/HKMecTmAjnrLOhpsv4\nJy1K\r\n=xVn7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"d8b5b99d2d93a2e91defcf98873121c96bb6a956","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.18","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.34_1594743176985_0.15697388660962242","host":"s3://npm-registry-packages"}},"1.0.0-beta.12":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.12","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"aa2f5c0c1f45e6856688b6eb9c9497b5117b9a14","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.12.tgz","fileCount":93,"integrity":"sha512-2+LECP6DMz/wAjobceCvDUK5rkVcV1d1GRWT6fbI3312iHvob2uanrQHEqEo+Vbv0KM46/y8AAwzH4W1hnIKiA==","signatures":[{"sig":"MEYCIQDzeH8RqQlm6+CLB3kmzOW/qZwivEJoKTu8/y25CEgefgIhAOoLs69bf4R79OP5qKpg6P/G4VFYzaFVUniXkNV0V+pM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDrGvCRA9TVsSAnZWagAAnO0P/3n8v5c5CXcjr4Yaoejb\n1ARsfhUQkSgpM/lE5C2Ly8nSFjBdC9w2oAdogJiH7kqYBpBimA/5Zhe33Rj8\n3hqELw4rfC3yPRLLa8hLZrPF9gcUJif7kNkELNCR6XMCgXN8HyNt0E1PLyy3\nlE0ShCY+0K5kKnoASnHoLfi+f5LABhDvCRrFwjspUKim4p9YgakSROqEWxMJ\n1tZq7307Rnjf5QL1C4PkhhhyL+KBOIsjApyqB2drJ1AYke1xHZKJxEIRL7Y7\nUrGXNc16ht/9uhqKnXAZ2PsI9dzWT+ljVqTQPV6db3nmT7oYX8M0UwkmAY96\nYitBpiGXjY/dpTbTbj9qFq+mxymEs9IxKpRQPDePKa/q+tZWqLhb4zrOc4Sv\n5ZUk3Uv+FIGPgOD49c02qYVjglAz3iDI8m9TjkGLZC/Hpnv9OMfeAEhVa5rK\nK6Q+nK1twZGM3rwnjzBJxJHra61fCuZvJJVuD5XME8M169SRouzETRMly2sG\nA0kOLG4DUEiGCs0LfK2iKJzkURs6hI5X0tV4+osZZ/1UcrmR5vDc22ziCGSd\nK1lO8PiPr4PTSIcTTyZH24ajWK7eSLGCvFdtP17UZ+Y7SjxkXPdiRsOU7gXW\nC3x5/U1j6wl/h2ZiAO/tgiF0Z4dUJZ2S9dDN8bwYbWZjnSy/Det4qpt8+FwY\nfP0K\r\n=DUP3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"525753f3cfb1e61ba7147a2cc041fd657a672c4f","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.7","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.12_1594798511101_0.43057207079775894","host":"s3://npm-registry-packages"}},"1.0.0-alpha.35":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.35","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.35","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"42ef8af8b5edc75e9a97e0f481d9fbf812af6a60","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.35.tgz","fileCount":93,"integrity":"sha512-dBAIt98PAg1AUbJNvIGVSZvF4imPjuClpWg5L2lgZoo5daERLnWS6reMhE7CeXfhQFyIPX0WJvItIY5mxXGIbA==","signatures":[{"sig":"MEUCIQC4e4633kZwYFZNV0TQUW4/tV5EnEu0Rei4g6YlTjCkDwIgFPBvd+GhT7uwGMgIek03qkU6mEzo241S25+6n4v0E4E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDrIsCRA9TVsSAnZWagAAdlUP/11XUUkZM5+yXHSj4sDs\nQ5JNsqCVQ5epfraPgi+y2HQKw7UUj0Drn7V629QieSXTn22ePtLdOvcF+cwn\no0KdQIz8uFgGrJjuZHLb2FpRODQc67B3Xefp1o2r32SEpjmFrzAguv/fLlJq\nGY0CSkdyWa4RvhQIUolfiGgfw5rYLdU+9EyGOs84yzfslBlBE1VINKV0W0ot\n/H1CHWDj0ZgOf4OpHIKPn49ij1LeXE1KqqmR9NLl03yi3HeceF+D1AEwjzmy\n8qyt7yAjthW0xA+RJjxcDjWytVgVh8B44udFLy+cFkj5MRKdKDiwAu24+fwa\nBU7nCWYP6VswWDGtouHQGPfoUCCdl7o2gyKkJ7qhz/2WUVYNU+JQQZpDFgae\nMr1jwph/uY1HohvZxUULgXsJT7HbvGC4ZThej2LURT4yH0ZACgXBCitUYc+i\nQKUVKll49YPpf4yoMEEX8bDcf3/RlKaIbzqrBDwitirfjvZ2ns1/OyLzPPT7\nb3slr79BWKe2M07g3eAv7vpQSx3klLyAvZ4PLRT7IGVpKUJVKqFwcV3IPSft\n1ZhAsDzL63GDZm4jXtNxk68S2O8Cje9FgWskSK+k7FVyu5EJ2PvRUuqeMvVm\nRnR7DOOTDZJ+v2NOC6go5r01LmvMb6HLHTKwprhShAjSfRKOEB6FSw6w2vqD\nsxNb\r\n=AHXC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"3f4acab1b7dc2fa1e764c8ae4350527e3dcb3e70","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.7","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.35_1594798636448_0.9066994235669847","host":"s3://npm-registry-packages"}},"1.0.0-feature-558d25-kcoj8bu7":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-558d25-kcoj8bu7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-558d25-kcoj8bu7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f3eb6264016434abedcad18fefe95b8914aba5f0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-558d25-kcoj8bu7.tgz","fileCount":93,"integrity":"sha512-Bs3lrChhuhUgyIQ7UqA5Td5ZwK7fiiA2lt+MgHnPYUy28Q3doXTZJzhiwxAY4RPgxYBc2dWlZMakro2AB8WL0A==","signatures":[{"sig":"MEUCIQDE1xrJgev1tSRjI7k2oHgPg4ObelgFb8KiPXmH1aTG+AIgbmQtaHZZ3DsOz8kQ/sGBz2w4FnbJrMuHVTym+gVxXIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEA/zCRA9TVsSAnZWagAA2IAP/A+3Z1JbAFVFeDQ0efmL\nkuFAlKGYRm3LHyGXR6rECUs31s0cIQl+LMTiITkThiZFiYNlaZIJYdYyYSOd\nMdsTdIjI0vFRCpZChr/vp2U4O27ho5/Xqlv4jvpMtX9jNx1+baGvjxK6YuXP\nFNfl5QYigd8Kaudve8fbOZxc0Nd6c5sGJUowI/X8hL1LMmG4kL7xk9gJ5/Kj\nlQjEpjlGWlyF91Vu5m02geqdMwkpCunt9hgOi+9vR4uGQG3Fib+E1uNBCrnT\n6ofeNxhY1YVSe174K8K5sBiZVULCCeSFuef1gv3Iz6AOwWSfNcCeFkg6mpCD\naipXYbpqdrRuitNH3qbIP5XqHmYShjzCuOjLwbfxT2LT9/Yf7knQeCMCyouF\n0YQ/4sYpteVRjdr2OsO2zmSeMYdyS/YUffBznv45hz7wyvbauA6ADgH8490N\n6rsoCdsWgHCe63JHT/OyMKVYkK3GviOazAv90KlN3PvoWZZgqcS7g3/L1qgL\neVFW7ZHs9fFtTIbp+JmWcNJhI0RTOTbNkOkonZOfcddRaxSDkhBYqjQsErBM\nLOr6/PRyKWePQt5uHUh9HuPr46p5+cwOpl3M9grIM3wLhaCLsIes/A+B/5Ok\ngaJVSMv91lGkFAtUOcwhGvkG5zKSfsgx1nluIoJNwEjlthIy65kTiGWjpTUf\npM+F\r\n=nfAv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"558d255cf830c52d1d362e6fa4cda28d1a1e64cc","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~add_request-body_and_query-parameters_to_swagger","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-558d25-kcoj8bu7_1594888178876_0.6887293766083169","host":"s3://npm-registry-packages"}},"1.0.0-feature-8ddc94-kconbqkk":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-8ddc94-kconbqkk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-8ddc94-kconbqkk","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"42eeca7018b1b4aca132362fdb0a9781d756cacc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-8ddc94-kconbqkk.tgz","fileCount":93,"integrity":"sha512-c8wCyjLo6iv0seifljCoLV8noUKOs+/WuI8sEcW7AHqbgMceNaygKKvjc4YtW0/380TfBN1vSF2lQc1zAIYfiQ==","signatures":[{"sig":"MEUCIQDoEPpIA0KgDWlp3FDalZiRaeHRlasP+JCNLY2pU2GPtQIgCe5JEN6ITFL8I6BK+ag9qifs3pZ+RSnpHvsjjAgzxLM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfECrNCRA9TVsSAnZWagAAgYwP/jrPMCcDs+Vrm7DOr8hX\nOEj+KwyWUQPwdpJAT4Wx3r7bI6uPoy2Q+XvFM8GyhzCp6L6PV7aMWC2Bme8p\nAkMZZU2yUyzoVjcC0Bl017ft8fjW6DMdDo3IEyC1VwldBFGQk8xkV/zkizvo\ng8/56MK27Op2TH7YMwWEMO7Q/QuuJO3lnw4le+ZcnUx/55mmDnfJO//UdKBn\nBKXpSxSZWF0JodXkbA0a9vvr5pZ9VC57KNOjq0jGQ2uiee8Lm60X8eA5xiQc\nwg2wEUpd5wRSO/VtVr+/Kr29C+EPPhnyRxD5oTneLjCmxLoa4ExFGYWrWtxm\n9i1CwPd5Q1GPHUlnxqfqopPXe8pORa9fljkrIWBQRxXfHNOcZoaCkUTqiinV\nadd+rTOQiCdPy1EIEw0ijFNcmK0HGf5PVPNhKzDtxfidy2fm55aQ6rR6HMEO\nc3Ce4iqgwDgePDkAtlT+Aj6xhRN/r6Fofj6fli+/3gYdT3aKgXiJTUfKjUIe\n7omGa1qxoc4ixoACBDzKE5Qh4L9WPEaMGUFwbsR6QrFEeLjg/Y+z/DC+5TcN\nHxo8/N61GiZWVY1zulz80aT2TMpzAWNRPucgSLKfIta+YX2CCCgow48Kblu2\nLrqdhQc4bHuqPb64z9QLm4urLTCDPwZHSgBzRqySGEjEWjbs3WjCO7RAOlIp\nAAqa\r\n=HwHx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"8ddc94176aeab6b746d39b1bb564cfd340adcd34","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.19","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-8ddc94-kconbqkk_1594895052780_0.19788941802281834","host":"s3://npm-registry-packages"}},"1.0.0-alpha.36":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.36","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.36","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9b295e78c08a11c96776619463580cef99d73e1f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.36.tgz","fileCount":93,"integrity":"sha512-rRlLIMqWtpcZA7czGfy9wfGVYVR0nThyyUB3jZqPA7TmDe1Ok3S70oqR8+/+S8/WKgWcoiIjflszQEFWg0z5wA==","signatures":[{"sig":"MEUCIQCxmCSFw+S1/ToafkvwjoPf+BMnbTDg1sJKsRNAWm1OJgIgMjXzrAAuWsAyxXTiL5ixnSNkJwPRMBufWU3bcgM6G5E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfECtYCRA9TVsSAnZWagAAnosP/RzazIlIkCzHySsSOSfr\nKiAWSwkB9uU1QaP0svQ327LVTmA4g0V47Qs0EcuimCkDwhYGYrIMy5SxpbKV\nlJ8BpGpSlosg4nzqsDj8GpIqX2NUGya1Z4GluKJarlKp3WKuPh+CnX4iAj7A\nqu0EiAnpRXIe3jyhJxsfBAElFB8lhrqyf0xRw3iRRihsZH/upKfFNo7SvLpy\niYjBl2GqgM951Zk75rjvnMEcvdopuNJvmZRifH73EkrSJXU2nmdRqk6tuFto\nizpc0ccei+D/JNywHCADgfIjV0hg+AXsBMAYTwnTFdf43OHbfbOG3feoGkys\nZ+rV+4lkskVX+F/Y1eWXr5fIhBjH6d8wLh1VRGTCjfynKMUyMTlQOEAa7ERU\nXuI1LNo/sKsynD8EB4KiAp4gMSrjGuHVWKytMMw15rPrNJUSxMBQ9Y1t/Cq/\n4SkO0fCZnCkB5gDIeX2P11ZgjG3psR+5zoJ629J6hpr4uWoR5+N+IADRFKEN\nstdZSrB4lJK6wCLDhbw3CDeBDHlmdeXL10EX3Fex7ZCC/WidDcbb5AaVelG0\nvrCwKvlPb4DkJKEtwO2Ia//+FtrAQM5NUvOvnQLx0ydci5qpLWgJMoG8zVlD\nmW7WLVWG7EuGG4zVfU/krm2wFMNUZ4RvV0aqnqWeGKLKUjkZVF7kLIZDxsRU\nozNT\r\n=PM76\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"764e03c66974fbb6ad7fd70774428519c7f83705","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.19","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.36_1594895192058_0.40904786852846864","host":"s3://npm-registry-packages"}},"1.0.0-feature-923d06-kcpu1480":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-923d06-kcpu1480","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-923d06-kcpu1480","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"af3fce1e3290faa456b79df9e15f52f2a58be659","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-923d06-kcpu1480.tgz","fileCount":98,"integrity":"sha512-uGdp0xE8U3bRJ3/2u7S6xyiaWZ6yg8X/0WDHBboIQMkQWGPoNrq/bbVGVZ9dpfaUwPo+XDlDwSwYx4+BUH74Nw==","signatures":[{"sig":"MEUCIQC/FY3mhgcUZiLCSjPCdvlInJ/YZAchjqdr6Yai/5VuFQIgRZ8zMOwBCrdlovpTxdFk0dEJ3gu9mDZnzoGbWHFmbVI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":248729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUL9CRA9TVsSAnZWagAAO3kQAJwHw6CN5uogNsrmUJtb\npVGvNO2+TNhpwVeoNqd/zjOLIJdkvkaQytT0JQASDMoAtS6KbSR9bxjBe9fV\njswLzJ9iAaAKfiRfec1WjIeJHgwuVJK3XzxBrqNBAurNtW8LsMIt1Z7fb/OY\nCfHfoX8tX9PNr/cnX7zo1IZqc3u/W5u9q/UXVY+UyCq797In7EN6zV9+i7fx\n5X5EKHuRjfn1g+Sog0F6afxGm5PpCKjy/t9C91p6KwoIiOtBLeJkyiocoxRZ\nkpgyZd9op2vdEz20uwnWhzrk7qp8p7W2csbNv8r/0HqtIwy3vCnpGytMvj81\nw/IhRYmUOgk3X/1PGNdEphgceedufsfgd+Na7iCeS9vegDf9G9Z27/yVf8Bb\n8d/FXZome/O6lRcHwHzQVulmigk15o1s+3x9fy9otDcapK2KcLkoNVPWx6vn\nlHY0Ici8fs2lg5tGNvEme4oV+C7sKkx8X+6/LgPZWsDRoe1mX1nR776+8aDg\nNEKt5lio8VpeG7DYtrwTgNkAVwYP45YSEJ3V8TN2MN7i8d5qBOdANeLKcEOS\n/pKfiCSipfwQWv2VNwqckPd1XFL3nrZyKL066+hLwRskS9ylUkkHW1iClx7k\nM+lomEblZ5Wjv6k2ThRX/97SkfXvf+6n9el/os257pqQiagjC+VZXaMqRHKh\nNzx8\r\n=uZUd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"923d06ea9aaf952d426b2dc835ed2346cdff61a2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-923d06-kcpu1480_1594966781317_0.7528639599295608","host":"s3://npm-registry-packages"}},"1.0.0-feature-4ba7bf-kcpudwo0":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-4ba7bf-kcpudwo0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-4ba7bf-kcpudwo0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"30301072ac55ba9b6953d4a15b06911837c58d41","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-4ba7bf-kcpudwo0.tgz","fileCount":103,"integrity":"sha512-X0cJQCbCtyL4+x3OjRbFbIxP3s+1WeEzdP3nHlTUrxCzzS4eHBjWxL25PZL3yhy9hOZ6WZHiMb0QcskeUxOs9Q==","signatures":[{"sig":"MEQCIAo46vy07DZi1zulgLuVMize2nzFwy97KRf2iol7e3XgAiBeFHblK0tvpfcdjW4zyBbs0XvKe/nTI7i8H0lA6QBVlw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUVTCRA9TVsSAnZWagAAxSkP/jW4+b6gDOJ3EreIGoY8\n22xt+S+9TOkM1DT262EdLd5gXqDkWeBnVDUG1lqOqmFlS+sNBXtL12bCcZmE\n4Z5eIaUjw2jc6NOD4SZO05J/mJ46DFoGDd+Sf3gJ86unlFbFLZnoCxDF+RJO\n7JnEHDGqub0wD99gxrBMVoOsuEKEVfz3Xqx7USDHzYgvUB9RW8xJi2MYtzh8\nz5HuRbINDuA+re1/TqxBxVnDKHBDVYJtDijknRs8Sa9++HodTgW+gQogVgo1\nJCfXksbHc/Ujh9YOwl4cvmODw8FbmXVIPgO2DOINxntMGpX6u8aVj9YvCR92\nZJ8XsZ93DHqb1jR5qO9/CMCLHocMypanGWFTzTyzOyAc3AoPY3ZPz06fk0mK\ns05uYwKLdsfuG9ZggUHODwKLJdTf3uf7i+SIjufKmebzzHYtArAlz6zM2qb0\nAOLMzBcJVVviWY1Q/vaD9TlYzBObgbw6KdBRYJZMFCrnogCDE6rky1pyOxuT\n0bweUOwLNgoWkUdyOMZyV8UQzaAG/83ZfPhpS8EbcqAnTCDHZq8l5cf8ceDf\nIiJ9fshyWqDox8p5AEYFsRPFlRkPDui5iPFNCPV2mb9L/y6VaomWjdPQ4nMx\nTskDnf40jh9XwDMVZkCcdcRtqL1MUElwKO92qvG25YRBwssZfDMmyWxX9V4n\n7dbp\r\n=q1DG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"4ba7bfe812578161e2f2c288c51eca337903b0a9","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-4ba7bf-kcpudwo0_1594967378936_0.5699322405864193","host":"s3://npm-registry-packages"}},"1.0.0-feature-a29fc3-kcpujytg":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-a29fc3-kcpujytg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-a29fc3-kcpujytg","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5c285bf4b4f93b7a0282e40cdd4a4e00fb1bbd02","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-a29fc3-kcpujytg.tgz","fileCount":103,"integrity":"sha512-meo657Itls6z/85XqH/KED+WuV0WbdQl17OGeRW7d4GihUNXpE0KBHkFIQy0Zm9ARFJGG6vfMIOR3VmyQvrUAw==","signatures":[{"sig":"MEUCIQD9kCbiLrlF++Pi+8YGiQqB37dtR4SfgT9ydLUhBpEHoQIgKJ1K4IEaUrXKtI9G4263CV1wZx2e32JqxBwQa5NQirg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUZuCRA9TVsSAnZWagAApSwP/2Q1wEaC4Xao5HTXfXRe\nKaQiwmLIyyU7v/KPGDa/grXLhzQ0HvMWjMpGDi5NGe+ARMgiTylapKOqEZgV\nGl1NsnocEIHVHLDE2KYX2POj2LJtaP3PPr/Om/exOqsM6fFYB2U9Qk6RNJDI\n/VN9BQKBQ585Yy4herAyIzLrVDrTF4e5C0HER1gZau/lHehEArHBtkz8Rx5H\niBb8AvvSe9/dwMbzbGDNjCtFSrWUu+FKzIL4rTsf0NKN5tJMPU4kxRC3bwS+\n9kFaDsVG/BNOaFOgPJxrjjRI9kRB8F89g4K4fCbekGkAgsSkfqUfrN0DNutz\n5is+k196InbqPJ9JkOPR3aItzLanb2J16lhMtPHbTHYKjMCAfSRo7r5K8C2r\n/qpwoaiJkPvsFNeXo2Ehwom6DIvOiaAAhbxBWmL7KX9ANuaVqlgPN+EIkZni\nGJL1v/pYn0nZPq58i0SkyM0xvDLXvOeTj/NFrKFgaCbPq/Fu7wlLFeCxNTvN\n9gZvoXVYrV2VtQ0MsB/ABrON4TPuniq7Sn9sJbYs6udjTK8cr9JIII4+LZYS\nI9HX5blPtHKNg9ZTYs968KXa5r/46m/MqtZuU8nnsFjE2GTYElSL3Bgorsvs\nKWGKQ4Hnj3WQDtVz4BFpkm94cYzt+1SbjbAv8MKFkuNGFSLJbV31r1rbKpj6\nInZd\r\n=wQJl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"a29fc39f3106a30d1fd034ff32f21e67df9ab3c7","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-a29fc3-kcpujytg_1594967661854_0.8594291782942634","host":"s3://npm-registry-packages"}},"1.0.0-feature-a9c7f8-kcpv5yrq":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-a9c7f8-kcpv5yrq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-a9c7f8-kcpv5yrq","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4028ce2596a52c00a071fac380e07413866e3b64","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-a9c7f8-kcpv5yrq.tgz","fileCount":103,"integrity":"sha512-XY9EJbX0GJNl1aE8e4deXCFa3ZhLP21nO8qsszGCocXDbPZwZwZ4BIFx1b/+ZrzfvAL7JRrxXRLd/2JO0Ek42g==","signatures":[{"sig":"MEQCIGYo8j8q0vm4wGdli+1uI/D2xZ7xm+L6d54X08zvBJx3AiABx7PvLEafPQa3luGK9DYJc0j6bxCG1eH/DOfOWuaXlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":259863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUpyCRA9TVsSAnZWagAAzHkP+wSh4yyDKkivUSkZLXY8\nEh6HbQiBnQaZ31FUXrCVgLxMd3jnvj4m/2d8aV+AJB1bAPeWuJznMlAqCb2/\ntpsF04SUsKqO4i3wDtcX27vVqriSe3UdkD4SDul5rip50+vCjJU14mVXMm70\nqsPMTpFTBCJr5msqrZvVRvTRLp0yDeDcntCSoadHhCx3avxAUTG7JSZQYMRb\n1tb30F//R4N8PnOUy87n0mFUTWN5fpoYAW96akuekfGQYg2jmEM+5PssiNLP\nY7U/i5cwSSRn4FQPfKWMtVpzuSmjWffyuov1amrNw0j9RDExu7KT9pO6ZFCm\nicJpywQ0TraZt1wzVIHMRCRgzFRwo6sPfDbflTOEaMl7DmEdhEu2cwC1xbs2\nxBfYPlqXxIngvZrf38UgtFw1i3qVvtKudPfAAExKev1EwEvo6ecj7Eb/mdDk\n4ORO3/hMqn0dg6njuGInnmDGJyCKu9x1J1TZOCiZ8mPSjc9tH3BlbGQoCvYr\nrH+s6qPpAyD4JqDsvx2v0+2Z7CUyTz2UsKBpTRF9yGG0Vd1xCZkdpn1E+qI5\nFvRhUI4MI/hyzpGgifHSyOsDHdsAahlzqd+bmGLyN0MNOxRNKU72mE8EemQu\nl1LhM4Gik7Fao0gv/+y/sbG1q4kkxaStmgwX1CNCs7sePda4ZGDr2DRVTOdx\ncqVx\r\n=R/M0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"a9c7f8d148cb6cb17afc4529e2095d99a90e41f4","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-a9c7f8-kcpv5yrq_1594968689687_0.678521010214159","host":"s3://npm-registry-packages"}},"1.0.0-feature-0735e4-kcpwunng":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-0735e4-kcpwunng","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-0735e4-kcpwunng","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0cdb4a48cd05aadf19e23f5484d993ce45091a08","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-0735e4-kcpwunng.tgz","fileCount":103,"integrity":"sha512-Z64tYkI42Oqlu3TDrFb/0hX9hx9GqqqEeo3ZvsRN6Xi/PDd1x5oJwM5on9wEVzgEPkKcKNb/g11sxSw8HhOvqw==","signatures":[{"sig":"MEQCIDhREkqbBLriMm4qb5+ahhXPprDHd9BvfZUhTTkU4vc3AiBvSkv9vTtZ/HE3V8b1T+RjiW+szrVe5G116w4UJBMQPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEVWBCRA9TVsSAnZWagAARGgQAKMHkP4/RrD36uquDjCm\n3cfIWGQZxwKqDsBU3/frj6R16MQXQ55qHIirsFWPOllNa3tAHeWEbMaTntvP\n+RKpY5ND354KzocFA41PqtJYu1V7rH4rYNGFaVqo0pv1s2xy+Y6yuwk086d8\n5KfLYJm1X2EZvPReyd+3IOhnz1oSMKF4FnWB2F8cHskWjVE2uYRxIjLZHVTK\nRHWmNiXx97iUOkP9Nafd4d0rLBnD4CtYjeS801MGZS3/CcpR35lKtxiM/uvB\nbs7RXByyjPrP/NVlPeVLZ7XZJTiYExw+OxeHubyo37svp7EF3fQkK8F1UvyD\nKSpPdLFvjxaUmBjeAiJ8XJ39nfu5gBXc57CFromJeHLcrwr0ooWXAgd4Ypmp\nCDCA/D0uXDAU7KNV1E9R5YJV4ns/kTgp3dpq6AspSCDfIcn572T8U2AMDqFx\nMj4jqCHGne2dqk7JvB0j/nw8rUFvvXYLiEyk+Zo9rjQLmXhQ7P+dr205gtvc\n32xMIUmSPD9g2n6E/PX+Z4MELg4FW5UvDB2M262r2L5oxdipS0afHy8ngQ3+\nhFwaSJtPp07VzO/zK0O2rkZhjp2d5mjDGvd5VVCZLlu0ndPVrK+HBOtIqPLU\nrrnNXc7bzy27O3xSR2RsTd0+NmFnF2SIjN12QTLwLosahSigrXWAIBSROq8p\n7Eyy\r\n=1hQF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"0735e4029e3d7a8792e837181f8211fc5e33b852","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-0735e4-kcpwunng_1594971521516_0.6609099067451287","host":"s3://npm-registry-packages"}},"1.0.0-feature-bf7b58-kcpwy9ku":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-bf7b58-kcpwy9ku","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-bf7b58-kcpwy9ku","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f624e350f7163ba734f1db9c4f651e30343a66f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-bf7b58-kcpwy9ku.tgz","fileCount":103,"integrity":"sha512-YAGh33ElwmLV1050RHSvjHEzHBoxcwhpkep+pT9P/JBHPEPvrQlN7NCyVXwdUt1TJv0xLGvjViw0sxH0VIRrNw==","signatures":[{"sig":"MEYCIQCxxIrVNairZkv/io6+xY5ogXGw3R/+jxXE0K0SI/GquwIhAJfRGmzHGLhSU+85+0ygL4HpA8MSFbPCr46oP8c3YaoE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEVYoCRA9TVsSAnZWagAAZ1sP/3Aa+GYgVhSTwGEGA47C\n9OmgZ1huzibRqhFmOTNJVqlWYdlMfzVmzUsv3Lm27HOIrDyTfJujZo1l6vHn\n7gv3wU4Vtv17HB9jFgFAFV+W+jtBBf24KGGjcW+55Lr3tr/rocDxJib0wiRH\n3S058/AAn4RV4BojaVx+bgVI1/VVBT1opfH0KI4hIjmdsNFdhAT6tbW99q7y\nuqT0tr5ozRG0UxSUMd7wWYbWRNUDFEJY3EIvNS7uoS1ChaGTauk9gAbdGk0y\nQ6WqvOslTWSKoOUV/qbLNk0S9QwSq+VfpN+kdoF4Xic4BLDabChVYXmZT4re\nDE4Ue9DI3WZ9fOhGqPjbeh8vI+4Zakso2t+cv7dt1y9KMKvK0MVUVVfP1XRU\nAcLkCoQHk9AqfK88Dmsyujk9M9arpB6SIRw9zecFFbBlTkRZkyK9zxxtaGGk\n9QO73zew/9Q7nElXWPTL6hl+6R4KbEkVHLoxf8CK5F8YxA2wn1enFf/64TCS\n35zZHKsRp4MFKg+lrkX8zJAvQfvg9hYqgkyvdYL9WXOOtUFj/B8xCUt3HGZt\nsNOBT3WXLr8y8XBJva3qh7yOY+lH0aQP7XXEgI7tFFWAEJmVwA8Xl4aehF6h\nkOwbEyMc40uA+fGdC/K7j8fNUMZvoPIihFMp3dXNQfj0OXEsbm9T+ZEApUTq\n7CPU\r\n=E29p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"bf7b583c7ded12eb70d5497dd0f17fba0f1d06cf","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-bf7b58-kcpwy9ku_1594971687709_0.37967086682849405","host":"s3://npm-registry-packages"}},"1.0.0-feature-387ea6-kcpz2pub":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-387ea6-kcpz2pub","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-387ea6-kcpz2pub","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"971baa74d5c58a61f844770703c4ed7cec4f7ca0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-387ea6-kcpz2pub.tgz","fileCount":103,"integrity":"sha512-tTJ68R0DaVE7AGZAUmJaFWBvxe856I6nY+XiKm7kLeI5yccq80uk21cfHYNF0NUrX1KCP7szeiKBFi7DqKYBew==","signatures":[{"sig":"MEUCIQDj3+sGnOTGmo+GdHNZHnJcV8enH8DI4M9hrpzb+GnQqQIgNOle2eyt+kYEugD3aRNYQRj1n/SjjAcIuAe2a2A/pgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEWQZCRA9TVsSAnZWagAAcZgP/0CG1VR2/1306L/yrNCG\ncl4AIPERdRHHmOMN+d7oIWFPKbnGDJcbkhTDg32/ry/Ri++NHNYO7ILH7o2A\n5342B5Uua6xd8quL5VS1OqRtDQA053XMokmo/bmgYn7LHNf5aj1BteBq6U9v\nUO+SnbqfK4KbFT71THISfWaxeTA2QVEE3uuUU2QCMNgnJcVXsgbHC8xBgj42\ndrOn61/CFsDCKRGs2m3UrVT0Hjir5EXTpcgNnm2O17Bik8ppv2kA856sgNCb\njrfTyQG8xFDmhF1BKuWNoJb04hM+ycY5e9oDJMF2TVVQIiidzNY/VWsDwWsL\ndQZj1DU39gfOHa9evnI8YGXtdO4GXXXFUmJSxGCSLSctWepnfkIc3h9xXGNz\nN41Jz3xy0RODTUhSLpqNo+VKsnfvir8c4mK0K6RQvZ6U4h+sr4GvLXVaqm5U\nJDiAcAeYqU7FzCW61gvRrb2k0Gc6PJINygojOqeJoIA8imNJID/3+xetd64d\nmHAKEGTAOiW7ZRJ3zijmT3AWn48p0PaHhKNyJ+hiT76R1V2uWnicmhFFLYbP\nAQ0pZ38ej9dfjt6D/ws0dow5oBHCtbS/QAw++3xQfPtn1+cDXfHmYsZnrgjp\ncF6wxdQNaje7eiETLuvgKNbIrFiWR7h3Q/E4LjM/bCmuMKe02JRvx3XXQ0K5\nm2l8\r\n=AadL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"387ea67aeca5cb633cf54ee144b1b2108e8d549a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-387ea6-kcpz2pub_1594975257073_0.3153122948188658","host":"s3://npm-registry-packages"}},"1.0.0-feature-a4b950-kcpz3j07":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-a4b950-kcpz3j07","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-a4b950-kcpz3j07","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"44f48e5301df0b73d3bd8bb4eb0aed678d0ffd56","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-a4b950-kcpz3j07.tgz","fileCount":103,"integrity":"sha512-Y9TulX8/bgbHN1inLyWlgYpdOHguF7iE+s/N47/KiZuTkwLHZ6xCbNYMWtkGIgqewOqYNQOCSHfxLel1JSgDTQ==","signatures":[{"sig":"MEYCIQDi2LLnqtmQwO4DyI6XoSAo0aPUvnzkbXBC2MQzIx8JLAIhAL8bgqFvVfYOZQxQse2E2ZGlJPT4pzxCa+q55sYykI3H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEWQ7CRA9TVsSAnZWagAAhzAQAKClLvUYwNIC+vEt1gLS\nUAa3bUj54CCntzXOU+ypF3IcjKRBpI9VEdh9rLc2f6N7F0XYqXJgL5WvSiXv\neIVl5agbVVMGV46Fp5UpxHgXfibHoTcuL9e5g+WRqlfJotaYCFtiCKvzeAh/\nQGKsVKS0lHLtysZdwPqMyUswqshLC9Lcbv/+m/uFOe7ih3c06IXf0zaUCP6h\n/tS2tt8LVWJR1UKUDDYu9HZqXVQONzLE2ydRwzJ3DykBgQxxIKM6Wc7C/lME\nKiEtC+XFpu+uuJhiUs/pBOJULShN9Qjhxj9mm/Km2ELiB0MIh6YaqzuG2PiI\nCglHp3Ge9Qez5AgYnT4hPjZzoPVdMkgh9mhAdMPYOFbz64W/CKqatt4YIqkz\nZT4H/qoLpCA29x4A8zmhbYs3hwrz2CH7EYI8pdj4uHH2RgL97umZSGG8zqIC\nmdAOccs200uXDvBzMqDvcn9AelazPP/sFeX00IoeDmfF7Sk8zKeE4V7RQg2H\nqSJxC7WO7R/i15nM1wLM/McJKZ8rz3evmFlESj6YEJaDldiibIYZHjJI80dM\nMo7GXvAvyZCJ9rJ63epkHiH6Uqr0CIWqrHh/S1SAds0y67roAU7L0LAgz5qp\nt3ieObSfZVVEITflSOvsZyv3VYhDtTy02be0d/di0NALSsRUSASxvWtH3+qh\nVF/+\r\n=RyUj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"a4b950a50c0eea72a578c3053cdf8426f53d9ff5","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-a4b950-kcpz3j07_1594975290845_0.802870076341204","host":"s3://npm-registry-packages"}},"1.0.0-feature-46c4ea-kcpzftpf":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-46c4ea-kcpzftpf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-46c4ea-kcpzftpf","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27d5af6f4d251e673e830cb91da286543d45ba94","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-46c4ea-kcpzftpf.tgz","fileCount":103,"integrity":"sha512-8FaYgbbGQ0F/cKmTL/e8fFCcwL7PckaO4eWYWx/bYdj7B89XiMi69Vx3TonBjVBQVg915gKvFLejAEtZl8rpQQ==","signatures":[{"sig":"MEYCIQCC7HQ7DgankXlCEschN1KfZKB3oAyroEcZ+KJe+20IUwIhAJb3CHxOITDWce4UnP/U6OWMn2tomvt/qJsI/yQqEGNQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEWZ7CRA9TVsSAnZWagAAlc4P/1KwHciAbqGDfL/0oW2a\n+5ag6JV00JAUSSaWyQk8vydBgdgVV4mMcC9x4zvqmyWvqx2MAzdZBNOr8fy0\nEQD/eyP/BTNYq2UtAucRc0NXGA8oYpcQqrEVm8PH8qY6Lef6auX3S78hCFbK\nfHgFkdjWFIfrcBruO+1m/X2hKNzQ4l5b5h4vxzMcGp5aVucAq9aeWTmkfsj+\nG5JAXQIg40OsjJiZ+Z7V6FEc4mXDVPmXhr5xTW/n3X2qtgipJBMtryOgy1mu\nRjG7wvATsZhwTPEHeJPP6re2ohmF70kxDQWqqyJhsgTZ8Bbv+wlnS3OREaCV\nXsTR5HrQdDErmEoHC+eKEtw93AS5BtFzLlzI3xzVzI0LNQZPqvN24NsIAqWA\nl9DlPqaWoALWBcsUMC8hVSIA0CrqEYw+5QRh4wRtpqxHQrjrXQy01QVP6QXl\nGEDiFpneFZWtddWS3MJLD6553rB9OH0NM9LIpruisx1K/9bemjNuqooyujUc\n5g7YkEzaael5xIZpeG420dXCG2B+h413VEf23T5LF+2Re807oNRhuj3fUzGZ\n7qGcpAZXEMg2rXNxwad6ET1VTPfgkHhDgDBNMbdT9TTKG1mtDnMAAD9At8zo\nWrCcrI+dy3Sa36akNAl8XBGEoedMvb1Trmsj+peF83nnDtxdfPoZHlhWleF0\nlGBA\r\n=dCFX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"46c4ea2d5e01c0c92caefb0e08b84a9cdf7f0701","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-46c4ea-kcpzftpf_1594975866778_0.5381651297717054","host":"s3://npm-registry-packages"}},"1.0.0-feature-abe6a0-kcq477m0":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-abe6a0-kcq477m0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-abe6a0-kcq477m0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b33d8ec547ea88bdd4e965be14e13c883abb93cd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-abe6a0-kcq477m0.tgz","fileCount":103,"integrity":"sha512-rBVE8dO9VHpyE1dhpj4cEVnxUaQITRh1/hJOm8Q7lKySjPNXnCMyXjXop7kQL6LcD8KDrODESZcFo3AaX2jHNQ==","signatures":[{"sig":"MEUCIEErQWXabnObCwzkI8Qs+F25YnoPdQeytKYUITSIRMxfAiEAoHwZRmkWA6WkEhPI291EX/Dg98MC9u1ShdRoUuyKv28=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEYW4CRA9TVsSAnZWagAAdRwP/i8oKTuuLQfFn66LSW6w\nF3itFOz4ihziz/XKZ7rP/fH6sfef50aGr0lxYv8Rxgp6nuaLeU7mlebPBato\nKWiU7hM+zUYxRsamZ/BA+eWAtbvz/wjZXnA8ciYc8+8sWcNSL0DHrmwlT2tx\n/iJJfCekOq2w1KKXtadz1ve6y8Ds1ILoZhR+6Tji9uZA+rKx3PQZav+74vVc\nYAz1F6Fv+6yLWoRqwj/0gV2dSbeXooOfoKFFIzZLz6t635Sqn9q52hekMlCA\nPsvD0IDX+5NJdwfJ3XGnsP2uiivIYmVz3ZcEJyIvRrIz/FcgWo7jH3nHVn+b\nMcbdMPxtAg4BFPEtgyLPbpf5/3YmDU9E6XdY57IbfIk2hQg9RJ9tZAg98SPL\ngMdNYsKsbcfTDCo8Z6JdKYpgPH8/yuHvluml+AjNf7BX99sp9zKoZzM6DKjF\nfVDfEbIPLEnnHwZy8oZtKks8m8qAMxl89KTHTybZH/PetRaCcQK9/3h1LLiq\nRV5LHvn6H0Zlrg+7l71x/4xjL8u6SNvYuHfV78gJRw0NBwWCYOIcclEONTCL\nnNxP9h3iAkJKWFpzkteHUlF+/H1WIw4Gb5bVsMWNzzwEsRMND48uL/f5meij\nLsgY9rnlNkS36EJ/xKJeOrYcYaTbv+Iv48cgc4Bt6GTofP+bPihLWKzo/UzD\n2C3Y\r\n=wi01\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"abe6a03b9c3edf4d8df4c08f1cb3d95c445c5e82","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"feature~align_ts_client","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-abe6a0-kcq477m0_1594983863753_0.7342210174388555","host":"s3://npm-registry-packages"}},"1.0.0-feature-8f3f3c-kcvlf2xe":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-8f3f3c-kcvlf2xe","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-8f3f3c-kcvlf2xe","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a26a660611379210ba347f481e41087462945415","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-8f3f3c-kcvlf2xe.tgz","fileCount":103,"integrity":"sha512-CFhLhpM4xYhCT8wEcrRYSR5TvsVHl2K/xTkJmZQKl3r7gNyp8azUzC/QF7dt0jrMgBmjPEJQ32a4Wtvavqvtcw==","signatures":[{"sig":"MEQCIBYRQf3y8jFLSTFepzLgDqdZUTp8VmdD28bjuRbDzzwGAiA38TYQJelpJiq8h3bB1sVQ1ZYPOlXaUPazdrQ/c32z5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFpOtCRA9TVsSAnZWagAApXEP/0k6MS7752RGB81Sy1ct\ntcJuy+j0gpPiWsAuVZiDXtpfNPp4ynlO983wX7Ms7L7WPDUFXzufCpmrS6Fd\nIgx0yWYbLBaofL/YxkzImjibc2Y5lyX0WJAjvYKBSB1XBhIgNtcTiIeAJrRh\nQ5eWVa9JmXxLNghYBDOQHtT5lrs43Xet1NrQWYdU4SJRu/J3EFB3ibY3jEh/\n3OoqFB7YOAyzGlsLAISOfTMhzzb8+XF9DwAMga6d/bID53yXriBML64Mis3Y\ndufTPSgLb1CatNU7qqFP+0l/HVY40Q8DmY4R7L5Gat9HOZLIdezFLpUHOcBb\noEDqmdEUA1u5F53oX6nw+gXTH421ptEohbtWDmPmNN0TduraJo1YNyyotNHa\noqhDvJfFVDIMoksbBdXO1O+hcvOgatDvrjSHDtz2XD2iL86CEVhVuQPZPzE8\nw18wg+vOeX7ICKRoGaKpo0g3tVXZgejDwhbqG5cez7i/SchFV10Nsf81dUJ3\n5dtoRKvJT87r4fVPg66D8vgHvkumOYHhV0ebYZw27EX80F60CyKUqeBl07U9\n+TZuc17CHibfM5btrhGQXyOfm4DhCt5kYt11TCN1Y+t3LgciQySYxFiZ5b5Q\nPM1IbRyE/yl1V3ocj6ZoUjB11DDnPoodkc3biuDcI9OQRWCJbQZZA8TzkUV0\nMSJK\r\n=KEza\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"8f3f3c27568d058d48eb7d3666121641d4db9f1a","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.20","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-8f3f3c-kcvlf2xe_1595315116683_0.8690705630279545","host":"s3://npm-registry-packages"}},"1.0.0-alpha.37":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.37","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.37","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6a75f779d045cb89794fab672d143e80565fdc99","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.37.tgz","fileCount":103,"integrity":"sha512-gLC4X7zCwvV6fjMB+HRSCUTaDOsXFTMIIop3Luw/i7ILW5Dk1P92mvKYZU8sVEQwx4g0kLGYEwPKrCd72ukyRw==","signatures":[{"sig":"MEQCID6i0ELM1eWADrkKKIeHSE2xPJe9yvcBdOk9QQpplb0+AiAQg1tF5tNMBicmDULM9geWX1a3XaWQFnWOSWxjL2No9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFpQQCRA9TVsSAnZWagAAWucQAIdUyYmTeXxP0pE3mwyS\n0BJ5lO58Yd8WYi69Qu3f80HVTIrxNTohC3v2+xFHj+3JQFnnpE+0hyVhPtU5\n1xKkg5Edsfr/voNzIKPe9Y+ilMzejHhPbtlYk8v/huHdcwNb+a3xwP/qi/FP\nIr//mFdU13qGJB42NV6H53VU5VDLhRxOgMIXJwi1KDUZtR5yB4om9HoNAoT6\naFSQBP6vvgf7+4LHZU0YKCpvWOPf1e/VGlq0qQGG3TUonixXYMES4F66mgc5\n2b2n6vh6mDQQLEx+GIsedRa0sTmB55JZbKV5k53laCEju8+dIudq2lsyh8OG\noF91UE/T/c9TLrB73uB+OcNkpFExPluuKddKqwM5izDlWY1T7gIypMuAlYTS\n9cgLoxOHTZqiclKETNcPD+15bY6/M15oPnSnZdGm4MAXa/vcanuGqsTnDCCp\nAdw7oeO8T4V1yZpm84I61OTUMtHxxOE1CCmRsPEI1uEzOhx7bmIZt6YhHZ+p\ngPRfFR4x24oVR+eL1JdBQ8RyG2ZF+67H9JyiGiQkMpHubEwb0Mxvb0unV+qm\nFyxfyr6Ivaowuwdc8q1ZqTxNDR7jtRLH0k/xa+jnkvgtCRbxz4ECmQRMO9eX\nuC9t7hZbRE/Shgd83LD9j1uAOSifnHNDfZix3mySOhhhMTIAENYl6Sd1X6IU\nL+Tu\r\n=EUVm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"9e8314a8d3bee8114a20350b736bd5ca8875e216","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-alpha.20","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.37_1595315216012_0.9603411522060481","host":"s3://npm-registry-packages"}},"1.0.0-release-17b27a-kcx7lehq":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-release-17b27a-kcx7lehq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-release-17b27a-kcx7lehq","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e5652ed6fe17aa0795350dcf5a580faf1127c8d8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-release-17b27a-kcx7lehq.tgz","fileCount":103,"integrity":"sha512-IPkMRUFLl+ZXlKBWV3fZzzkqSN4PG9M70pcWUs9QScFPClE7qOD1cvIvW+MavGAhGZLG/c2jkS5hHr95I0uY/Q==","signatures":[{"sig":"MEYCIQDnTXpF2elKLYqcl65D1VQfjxcDJ3sUJsqg+pMpic3vNAIhAP6rkFLSEJKe2AyjvwmefQmuPy5+4cSnXIPtcvWD+5gw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGBFdCRA9TVsSAnZWagAAT80P/ipQtl722O0sRWnkXcqu\nJd1AIHN3efN/Kwxp8oFRuAND81OArPIeSXHDGGV5X+EF1q3tLbme2bw3q0Zj\n7tXC8g44lDb9D8+q6OkwXyQIcDCYYzXkIR3HYKeP4uPv7T8u2aLr94if7EcG\ntbQxBMB3PnbcUMDx+NaF71hpHIwyE4IBhRrEPpBnlaSuA08xHeG5YFzdXr9S\n7g9lWetGJdwXeG93vFOcbhgKgVgnw30yiEnluIvZn28JLhFyAUNYNJMgrah3\nW7mkkkdCQlSzvHUP9MRveh41Yq6/YLO1CTRcphVVSiiW4Zg5jiIMaohEpXGT\nvhF6XDS0eCC0kjtly6bMT8aPimevpH2Ecj8X6Otm+IzcM0S/hNb4sbtxqy6w\nMJcVExdwJGyBVxFIeVme3gLnGi+YPOR6oX5pcHk6SrlR+cptv1FWLr0gXKP0\nPIc6lEVbzH0fqgQHb/klxEQZCbSiCr0JATVmaVFDoOjb0sfnnUD3Sk1KOuEN\npMiPIaE+AOrGwe5NhE4nPlm2wcrbjyC80T21gUdiPV/w4NDf2ObolH8xCfZg\nnd8Zx/6OOkq+mahboGh65KsgFPcLI6MnAzBESbHUNuOPiAehNf5Ae4zmpYEj\nrJGbe+q6+MhImTLKivqqCp819/+92MZh8w7/VNJDaMVhb7zv3BrvaRNY63gI\nqaHd\r\n=YO4R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"17b27a2d3ab9296e47473225876fa940473b26de","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-release-17b27a-kcx7lehq_1595412829335_0.004031277146684609","host":"s3://npm-registry-packages"}},"1.0.0-beta.13":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.13","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6eb5177d83240ddaf8ca25cda3aa1169a3a87604","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.13.tgz","fileCount":103,"integrity":"sha512-y//lpgkH0fb3j2D8KjsGuwxHEUD/UKKrd3cSxGs8tBqWRrTcKcfUL6Cl/8eXcpJsCxQu/aAi3XqUIXPy32jjdA==","signatures":[{"sig":"MEUCIE4i4Dz2vJmGKw00qQ91NukvOnw13V3PXX0M/YJBVdpaAiEA5C4rMcD16VG9XnaCPNp9O2fRpOE2FToGDyc1AvyqbuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGBazCRA9TVsSAnZWagAAvtsQAKTuqWYU5j/+o+m42fa2\n72xj2i6wlUrGLJHDwb9mzE+6+dxXiXdFeCQyTxNjzDC/auWt3yNstl4L6OFK\nE9VRL+q1D/2DTTk5Y04zOGbWcppJbXldoTLiCPaTXHGcXw8J+YAWlMxFOueU\nMNnVteWPtXP48Sh3qFh85Wqa8TdhalyztQbbMgeTDTk6zN+2jx0UA/SPtRju\neGRIr3BBZr2XBQWzURwHscQXL4HUaUXHhxjEW4vLcby+THrmhFvNbWtA7BNf\nVQ5rN7OXBhhfWxD1xPuGXIA5ET7bEVAFPksHbPF8klv+vyIqjQe/SD/OPfWY\nN8IlHE3EdbLwlmwmQhdX8bpPuPMZYz+3QKkJpxW6SZqlW+VXQIlfO9ynJ0Ps\nchyI81VhB5i8JmXKPnhQOCqzSxQSfksWUfoTQkqvSusCEN97K2mJ3197dNmo\nU0Rdv0vixWNh9BQ9rIBj+6YHdA/+xuJ/Aqc5VUthC8NTFyf/5l1C5DGUJfdG\nB9HXN8qw+Rfy2pAr3GjLX6ygcHPa1um2ZL9ELtB89nOr5G36TQkP2P+CmmOr\nbwxhDbACNDcJV3gYxWVgupJ7S6N7KWjw/eSHKfiB2dVd3hGphYDw8JK3hohK\nbs4k1Q5yymO06qp4HPB56+B3rJEzCyhDCOpVYgVtfDOQFSACzlFzAEE+yPB/\nq2KY\r\n=QLaB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"f592c1d52f343745e428ad0357138a9bd4c401ae","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.13_1595414194699_0.802580046869741","host":"s3://npm-registry-packages"}},"1.0.0-alpha.38":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.38","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.38","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ac6c3178ffc4cdf138c04ec8df5348610f25e25f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.38.tgz","fileCount":103,"integrity":"sha512-6FdMnc6Tu0tYf/DY8SMc+WNrwQKHF3DkpRf2D4Zp7KPU/Q6vDvD4QB5WELvKAD/zVLSPKzejX2jRM/EWdUPXcg==","signatures":[{"sig":"MEUCIQD0KipvkApRWjS9VM2pulBoXnQ8h2dFHU4BgVDiJ0K+ywIgIkwAlRAD6i9n1FRAMc55mylunjpk7FIyl9V+umH/cbA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGBbHCRA9TVsSAnZWagAAqmYQAICFcgUjZP/J2dUFUZV9\newf4ugufWLBqAaRFiPXV5bCom33aV/eHRhD7gGxcwqwJ/xPhyJa2BCj1Fzj6\nYhXOhI+RIjh4GAqZhbU9aCermSMf8/+4vSahtSBFG9lmDlykAlDgkFSZLeLX\nzuIPisS+fut2OhKC4sFH36QMZNf0fUqJAQe+IzP2HNMIRwN95xoNUvOaPV9W\nTSxvC7vH+TWDMUTHK5uY6dp7jZNZ0433VPkbVejgJodXqpLVapSWxBQb/BXy\nTdz2N1Cup8WLI/hodZbi/u08pTatS7lU1Yaol9e8onap8vO0N3TgVsWNK0Bd\n4hihARIFsP/PDuGQBwYn9F9Ngq4h21Ga+b9auoWwMXLiv9g9f2o2Cua9n6ej\nkehg8jRdbpm63G0FRTEIEb1ec8OA92kq+S5FFi8glpmcsE9W2mWqdhfBDK4n\nBxsUO0CHbl9/UYkpz868K4iGIuhFyDTD2jCadeeQDqSgHaKQVfaEg7De99mx\nGOU1LfUTt3u8U16jFBfj2mHRXaxdcp6U7zYXrUki71yRqUpQi5B8npThkany\nCp+RfdiCopNKlRKX983gxrLx9sO32xq0wEa2WiVv4a0V7GaZsKbxuK4oDia2\n/SkZsCHlfiWS7ZeFTnKbqDYobavn8S1VdCDDCryuo1aZTDKcQWx6a9TYfLMC\nT2yK\r\n=ohO1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"79cbd2d2ccbfcd17f82157bb22175f84e5e835d1","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.38_1595414214574_0.03548418196781977","host":"s3://npm-registry-packages"}},"1.0.0-feature-33a491-kd5orz82":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-33a491-kd5orz82","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-33a491-kd5orz82","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d4b6a39fa2a8299827bd277e749a3e947418c128","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-33a491-kd5orz82.tgz","fileCount":103,"integrity":"sha512-Zz8jkfVtgPdYDqEIizNqmcVOgx7TOlBunvGu1KP0S4OVsEcP9lyWdrqLQq/obWsFWYIyKU4r4OfY3AV6Fn6UmQ==","signatures":[{"sig":"MEUCIDsa57WImfqlIFNy8FVCmg3spM0u3eU68qcqC55Ks6cyAiEA++VVW9NXhgM0bx6GYdxD2u8aefd0CGEyqFTWlVmGI6I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":262195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH+OnCRA9TVsSAnZWagAApysP/jXE30TSZ99obgr+jdNe\nbz9V2/t8u9AbgzLoty28zmq1AUXNfmzTJDSrjSr7MRgr8AT6iL8XOPsuWlKr\nry8UXM+Ubx10dy0trYQgzxwgS5zMukO2n7YF5/xRpQZSD1RcS+sViiymRQ/s\ndAeAoxyXcSfkGPYFm4xYeVrdMeYVZ8t467GDe55j08Ky9706Uk7zNIIzoMhd\n93a43grVN1qw/wctWywEuipNn8l4Ke6KYk47YIDqa0pFh2famaOx1HeIIYSX\nIK8cvIS1T3xSQqGarwCUXZxkaoXbqPs2rRJ9NIV9hlceSB+SHWbhuXx4+8JD\nGgEthSI6/IKLlkZFWYhUW/j+SP4g1AHXbeSxqjk0vB+Omj+JUnYVhNu2jhcr\nWaV/sYyORnj/edQ1+9fmtgkSgQZR3EjD/SWqWW7zNFlBPFtd4nTartSaHKbK\nQ8N6I3tBcbs46nOgn18RKg64XbmDvOAnzlp7hJtaNrrond/rdnv8yf4E3xBL\ncuhFLGGvX6wD8UovS892Hkl+emPjOyxMfrEz21BRJgw8AkvU2LVwjI4359QZ\nlTyCQRiXBFDL9BT8+XD2iBN/LejD5zPncdNvyaw+yHgeSDYxgBS3KXDIMYrO\n6/6Xyh3AqOD7HtCDq/i2f4X0gm+wUefrkeAltpoTPlaRvcLjKaJhFDIjNLVk\nnMrs\r\n=VRgg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/client.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"33a4917cbe2082a730d8b817a610ac19bf6483f7","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/client.contracts":"1.0.0-alpha.22","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-33a491-kd5orz82_1595925415040_0.19155611264186123","host":"s3://npm-registry-packages"}},"1.0.0-feature-ab2f0f-kd5oud5f":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-ab2f0f-kd5oud5f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-ab2f0f-kd5oud5f","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b2af287c643a6161fa2197466eea68299c4df0fc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-ab2f0f-kd5oud5f.tgz","fileCount":103,"integrity":"sha512-XlSnpnMnr8pAPnSipE7lETxaXYK9cbW55hye61VCKUKFL9O4MFMhBDL0Z43+Nk4syA+61q8iBLC9nZi3E3RFRg==","signatures":[{"sig":"MEYCIQCU1CfAmIhFG1hgOZe6SHiYZQ987+XR9CNEVx1S0vRMqwIhAPGGHXjDdGq6kxuPv5NSx4S0+Fgc8a5/bb7K84Aimdbo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":262195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH+QaCRA9TVsSAnZWagAAnEoP/ReefNiqTeqgPpRBHTq2\nsfizwrYDNrg4euPMMpATbRxur2VlMpH2B/ivN/eHIXXALlF6WdfFbbqQsarb\nhy88FNPNfhd0beYenlxnR9vps7M6Tx/q6i6ul3Mkcdb2NhkJkon1VfcvSv5f\n0+c//dH4m7zqJuL8Gdu4JHKq7xfLVaV+e24F4N2IktSFjLwIXHtyNLF3BP4W\nX4rh0JkJ5zRa7kZfXDtCBfBgKiNNoYrN1GabRsUGzw2P/2Eb1EAAcWZKrI9u\n4t+xSGSvvltotQ/LhZ/y9lgpMN6Exd/pb+11bsrgqq0+F8siHxbQb+2GPioZ\n4D4Pqjc3+yrPRUhB7fH4qMFKMzfn7KX5HSPVaS4wI9hzjAYtq4BUMIWz3eAV\nKWiqV4iNjjGuZPWYLJhQfp7JYgeNXLj0hNREol7P2miNgctqLMScB7zqVUhp\nDvOSoyW6vWvv2inGUAZJcBS1k2ORo8Gj6zi/ao/QCV7w70cKF/tFx2oUn3LT\nQFNmUKGOXMgl2rHfo7CpCsAsIRlicxDV+o7PyMlHrk/JW0CpRIkez5qNC+v6\nkI10JaQszgK422PdOd8qw93ESWnwjNW9iWPwJmybqFD2VPlD7cDEMh2x7kLw\nFo3UP3UBOArbo0AKf+l4KnuoXPHNW2wVefU7ubrPoZj1hbvym6uObyXxvT6L\nWPnv\r\n=HJa9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/client.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"ab2f0f353a6a01b63467be55db04c5f15fc98ba6","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/client.contracts":"1.0.0-alpha.22","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-ab2f0f-kd5oud5f_1595925529971_0.29801994033022483","host":"s3://npm-registry-packages"}},"1.0.0-feature-fe745f-kd5v6rxf":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-fe745f-kd5v6rxf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-fe745f-kd5v6rxf","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"38177399c8eabe077c7c35f4384e10ca5c926bd3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-fe745f-kd5v6rxf.tgz","fileCount":713,"integrity":"sha512-qLw22KKadUDZbf1j/DVYQUvEVZee/XURNMlYpVFN/UZtD3vpdFvEg37lVSnSfi/Ei7ORnhjnfuygdGNC7BjqlA==","signatures":[{"sig":"MEQCIGc9X2K2vXTjC69zIqKLhC1kgHOcAHE9e+QRT/6Pd1QoAiB+VRM0RvjrWvHiABiLFltQ9WJBJ2iDhDpAhFWzDRmHbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIA3BCRA9TVsSAnZWagAArwsP/i03XKO4Z3l6N1P3CNYV\nQp/QrczLvOuVCntHUhV3yolyspDOOnwR25XkSg3L+2VI/MqfYvPleZ825LlI\ndfrcuHG+4Hb4w91QIKFiRmb6gPO87Rf/bNPIScZNurw/oZHyhozier0b64Ip\n9r+vDdv71O6kXU8qMbMv+PilXVl+zR2ePBf+gsuev6/zh0wEhRhiR456t/xJ\nkUpD+aWbg1xCFFAFD1AQVG9wrSwHHbKEowQrwsTaOuBt65eUPuIEQH9/1FMU\nSGhPtX1Yh13PuyHtQaa7jHkKD7r1PBREWPJW1QjX4PCkouOKQBLVxHbHZKAY\nZzpnLRV90pYUyDToT6CjFfIu6K5N44d39iwNqWBTfjy8pSmX+uqn79WHr6TK\nTU3MVmVAmBrrn6cgeLkWIYeh52vARm6HuPM4ierMZXiTC3GNVWrbSWaKeXsS\n6PPix8OKhKnRf0cOlPnv4YmgGrlIkNvLhlhImR6hDj9+9AVm2PyyTx/AzRUd\nrHk3wPsT57xW0Xiz0SlLmZseiDEbtrz2W65ylCPNa1FOQv8qmsQbOXdeYE3D\n0uQFXTRlFU3RGMwzmZi4Sa8oObZ2L107EX3sEl8Z57yp8MR3WfjbBmQ0NJIk\noLNjHilAXcnwPNU7ELBBTxV0+id+YebKUBumxaXCy03UxqAKSlxOhcxQARI0\nMBy5\r\n=Qbve\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"fe745f3250e3f6b4167a56773f0e26820ade17a5","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-fe745f-kd5v6rxf_1595936193297_0.7326113384426558","host":"s3://npm-registry-packages"}},"1.0.0-feature-d4d7e4-kd5vjh4k":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-d4d7e4-kd5vjh4k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-d4d7e4-kd5vjh4k","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8fd90e533fd2e33adf280c42e96313bc261fdb25","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-d4d7e4-kd5vjh4k.tgz","fileCount":713,"integrity":"sha512-f4CKzkIoBXD39xVsAvYQOVBwpNCzEcw4HjtQZLs0iM91PD13ewJ/ZD7psZ1mBDtuveOrXdBvGSK3+02vY4jqYg==","signatures":[{"sig":"MEYCIQCFUzU88TxZig816ULz9d2/JhRI03XgdZH6P2fcnI0lJwIhAMu05ODOzp4jZ+22S2QNiYsJ7fjl6f4KJNL6rhuna+Da","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIBASCRA9TVsSAnZWagAAK+cP/R6J4d9tfpNNqXZMgHqz\n4zb7YkS4MTi3Om1Z1/g82vRsZeuDE/mgkEnf3GoHbHYTCn47cN0klxe5cqoK\n1JxjiizSIC66oWQpVcIObusQg4LildXa7vaeQ5hsLQB3v9lE2fk/fc+vlLm+\npsits4dW/8uPEONdRLC36+70lUIgV6fZeaJ9xqOgM62hMDI0IP1wYP849dCv\nacTdoD31hVz3arogD60SBEz00XegriLNalYqqB1EjaLkynOT2nIeFwXqtQ9y\nUM8s0KK43hDmEbldEzaXTM19juT2+K8A/5YR5zO5hR+FpyYAMT2PvyUnPcXv\nYCy5Bif1eIXZfC+PUefMvoIOkZ8oG91rSPzFdfvZcrmqP26hKJXiNUU0km6n\nLYyd3mBmQbgsNevkyydlRJWDQ4KZxigJSqjl3GYKbH4B8gx7BMI+i55Reko1\nG2fHJ+UpKh4bL/y/RUIvvD/g5YuudI+XC0mW+jpmVX09NJuyTQmSA0UgERSu\njWvs5nUpd3ZMgjUCLHrFC3s+8c+YtTuTKcmz/WvKQqBfKP2hucBbt+SQldYb\nC5JyC2cz5CGEE0aNlK1o0rc3UZnRsNlCarNCVPPgIIojujRHBDb9KB9Qry1I\n8iaYvGcl5+HS/m63D9x/Mu6gVLX5lJYkClFtuuvr+kIwFmwH7ZieOGclRWkA\nVaBr\r\n=a7oJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"d4d7e450ae6c1dbd44ed5996a306f08c07b48882","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-d4d7e4-kd5vjh4k_1595936786379_0.3981811868597407","host":"s3://npm-registry-packages"}},"1.0.0-feature-1732d3-kd60j5xc":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-1732d3-kd60j5xc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-1732d3-kd60j5xc","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"300d17c6b8bd1c17f2ab028bd231ef1ec32c9295","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-1732d3-kd60j5xc.tgz","fileCount":713,"integrity":"sha512-g8Ke2/FwlZhK+7aoZ3yxBNw5uaaSyjlzZg9v5d/tf0gRBoPIwO5IIpUnC4fFRqIG126bqr1J1puA1rypM90JKA==","signatures":[{"sig":"MEUCIBYDPc8pmSj/U9ZMtdQ1zEjYjyoNFWfhnBbUdUnb66snAiEA5zVQFPf0+Hfk2U5nbtmgcZ7NKmPIeguRCSWEzaFKB5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":753979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIDDUCRA9TVsSAnZWagAAZ9IP/R9yylQovnTh4/hRnocz\nNvY0AkIDPCF5upDZ/DcoXPrgf+ER4wFePPaT313qRqdA5h+wGfcv37CLFizT\nOE+hVozaCTypcck02AIzqnQTouA0d7WXHT0GOKqssOhmT/Bx3SOpk7QUQcSz\nuEchLtN33VrALRfZHcjcxZEMHhLMRwiXMvgux1QjTrcjPYFWd1o1yPZBnGHl\n27znBAEL+FAjDUlDAt6eQlaX/0PjM14s4stkZun18UQnUlT1INsEGkc86z51\n0s471YJTVlTx62TCsuPzegBUB6lq7lDQWIL0VHn428dtYI/8Jy8MhLQpn0WA\n1RZElGoMM8QS3Hs5kBfjT/adSmESHBS/AGb60V5VtybiB26sqXdtBybAmzxn\nnHkzguRJ3tdvjDNfz5o9XxZYaS3CkK/SY2fzgYCHBaiVpGoxODLL47l0fOxD\n8hwQtgEpET+oHFapb9N8naZGwnC9KzYm8ntbC6Ean0oDXXcl69ytGzpUtaki\nJzuLHxwArG3od70SZYKgYOb88f7uBukpBiFzMtHiCBtn4syPVJiuryWQAcn5\nGlbPWbfoteqD0wSwtDsgZs3K5Jb1BfiuadCDtzaMHDKmdw27VqG4gsqyoAnt\nZB+xY5GOaurQIYz5uUwCQc0+MdajeYfGnSqT6jQq6Mk59EvXnEho4JSQcqHN\ncRu5\r\n=gxrd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"1732d36951fd031b71d618c651764bacb7bdb9f6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-1732d3-kd60j5xc_1595945171929_0.9470761491380797","host":"s3://npm-registry-packages"}},"1.0.0-feature-49c611-kd72ctxg":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-49c611-kd72ctxg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-49c611-kd72ctxg","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f660fa40864a16af020ce58620d23496232d764f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-49c611-kd72ctxg.tgz","fileCount":583,"integrity":"sha512-tN9/zui5UOuuzffO861wn2wH6REiNEojW32Czx00SYe3m0sbgmuG2lVWiLSf4b+KqxBpe3+IeQ3IFt4WCX6Bcg==","signatures":[{"sig":"MEUCIAnWvnU6fF0/g2nnN3Wi+QGLCsLjhYm67pmLnj8/n5AqAiEA2iFGTj54rqn17Crlh2uJrpx9zRqOdsa2SsTblWi2G8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":612172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfISj4CRA9TVsSAnZWagAA2WkP/3DNVgBvtEWVBB0SslTy\nK5OfS+KQyo/YBya95HNkVU2yv6k8t6Zkp9D7xmHz9THCSl1V0f+W9BiML7Qp\nWNKO1ISdEMFkoJuL1NpeUNjMANlJ2n3KiQktZ8iKjF/3thRcAwSXHUjF5GTw\nOBi/N97lf5oV1tHrOh9Du81l5F2waOvtQkFv9mlojKRs1u2qK5bvqk32Wmkq\np2WIRCFjeM4G2qeK8z81Ctx2xSrL1f2zUwI/4ObCsbaywUlZs21KPrvh6nj0\nx/+igGIitg7F5dYNgiP5Zry0J+rmK+594MKfmPzbwxCcviHwTasrrMd1d1Hj\nzc91uQgXOEQpjb4TAUj4Q4mIged2jkOxe0RkJYgRQfLJqn4rziweFfIPWeds\ntMu8VnIVAgAF5D2EgPMvWmvuklJqzbU5L7/QBRq6UyxhtA8pRakCO7hg1wek\n3dhEpGlEIDpnYedGCVrT4zKyiClt+MJNGBL+XPKMHzbkr+PHZhUP0U8yFmkN\nqLqNgRXc70QAAvWMpNgMi5pBkhgkrIlPHpkMDXufs99enqo+afnTdwqX4bP2\nXxRJcofFJZ0in/n8sLmn4iHACxmaSrVCIvsmJiuN9C8L8FNYZrn122t5Po2J\ndqDEFHQ1Tm9yeF0pisFezgSMWn/C+SYNjFHMAx8vxU51h18eNTGFgyqJYIWg\n84Il\r\n=FtP3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"49c611102e52d3ef7e059de20a7373e3a368c25e","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.2","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-49c611-kd72ctxg_1596008695678_0.11300277955225568","host":"s3://npm-registry-packages"}},"1.0.0-feature-79cbd2-kd77d5fb":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-79cbd2-kd77d5fb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-79cbd2-kd77d5fb","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c5e1dc55c32106416f267e9ac842c887a9660ccc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-79cbd2-kd77d5fb.tgz","fileCount":103,"integrity":"sha512-zRLbklHiLGY26CGQeK1XYdpXAnMWlaTmXVg4yqtrkrhxmhX/KVY6H4WgEdiwasyzUXnaFu3kPgEpVGbX7SIOgw==","signatures":[{"sig":"MEUCIF8uUk9l6TezqWx60WUyBNqKmG/Byc5PY+WEs9Anhg5uAiEAzfCPHJaRVpoOn/ryvFV859+/sTkRdpRI32U4ffO2yj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIUnQCRA9TVsSAnZWagAAsG4P/1R4K8t4oWtih30kh8yu\nLTWfSOVawjVjNtqTQeFsFePTee6JftIzEiX+z1u6s+X6Tu8ewXUmVH7/g8fD\ncE/2ldFxemIWJ7MrUZ30KVf9mGTOcPaoDEx02LVDBYSCSng2RCeP5tpE6PEw\nqzWtHB7MGpOVgkYc8WhVRZttD/fPvGTsqaGA2Oz+Bz7c3XxueQV0/YmQ6yz0\nKH90g+Tzza9eCk3T0DnhL25Z7BRUeBMV6ZE3N/eUJJeYvMUKglNQ0H1hUqCJ\nHRGKq7XNIYhI1j5ZvIgPezp7Q4QXW4KgWv5VCJiUaWlUSfla/zYaPSIdezXJ\nVkqeeBojrqqBwRVbItR11hEJmOr5OIzfraCq+QeeVMAMkosDX5FE8bA21lxa\nLac6QMXkC5kDZnBMwxm2ILtgkFLmrahoSI7LdP+0sOwgPk/2v2dzQBEFD/Xt\nCFI+VWDAu8ievFSf7qqlKdahTCSvDywUtzElxKk9m9hNIA2XuK6jcRIxrijc\neA20AkXUzFBkqiBbhrtrlv/d9o46pM/5se62MWQBHHSaXVq5/R29Kg3e4+zV\nRd+wTF3pGoiPWCpddOswBbIh09eBpMGaE7iRGn5RwzzcXaMmmYmwliqf2T7+\nszx9B0wgiP8UlY2qanD/HtLNyLtdC2CLi/ylIKJGEN3QVLXa4ZzL03bIYWg4\nby9b\r\n=xdNk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\nconst userTasks = await client.userTasks.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Querying all available UserTasks\nconst userTasks = await client.userTasks.query();\n```\n\n### Starting Process instances\n\nYou can start new Process Instances through `client.processInstances.startProcessInstance(parameters)`.\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n- `returnOn`: Determines when the request should resolve. Has three options:\n    - `CallbackOnProcessInstanceCreated`: Resolve right after the Process Instance was started\n    - `CallbackOnProcessInstanceFinished`: Resolve when the Process Instance has finished with any End Event\n    - `CallbackOnEndEventReached`: Resolve after the ProcessInstance has reached a specific End Event\n\nIn addition, the following optional parameters are available:\n- `endEventId`: The ID of the End Event to wait for. Only used, when `returnOn` is set to `CallbackOnEndEventReached`\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the PRocess Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceFinished,\n});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnEndEventReached,\n  endEventId: 'My_End_Event_1',\n});\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {DataModels} from '@atlas-engine/user_domain.contracts';\nimport {AtlasEngineHttpClient} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst client = new AtlasEngineHttpClient(atlasEngineUrl);\n\n// Start a Process Instance\nconst processStartResult = await client.processInstances.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  returnOn: DataModels.ProcessInstances.StartCallbackType.CallbackOnProcessInstanceCreated,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\nimport {DataModels, HandleExternalTaskAction} from '@atlas-engine/api.contracts';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the worker\nconst externalTaskWorker = new ExternalTaskWorker<TPayload, TResult>(\n  atlasEngineUrl,\n  externalTaskTopic,\n  externalTaskHandler,\n);\n```\n\nNote that each worker can only subscribe to a single topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker).\n","gitHead":"79cbd2d2ccbfcd17f82157bb22175f84e5e835d1","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-79cbd2-kd77d5fb_1596017103336_0.9370431245288326","host":"s3://npm-registry-packages"}},"1.0.0-feature-5a909f-kd78z56k":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-5a909f-kd78z56k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-5a909f-kd78z56k","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f5e44a30e2d08315a519da5d4192fe3afa11f4c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-5a909f-kd78z56k.tgz","fileCount":103,"integrity":"sha512-rn8PhzjklcToj5ZgxCyEJknWuwTfnVHIrrw80d1GHoJ8FJgTG4z9OzUlxWjMlXphvO6z0R7v3vQ86T0DhOYBiA==","signatures":[{"sig":"MEQCIDQIjnrXOfWVDXyYTuG5nIIrMij7wpeyOJWFKJB3ZA0BAiAMJGziQPS96nzSLV/RSnUYa4bpEblLEoyEvZqCZvuocQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIVRqCRA9TVsSAnZWagAAbEkP/0hgxxPa0lNCqZROFUsY\nWqnsoR33aPKJykGCA4yBtL4zirzCQeO0SdeZ+gOvjTkpoXqwmm94NRIU+6c9\nU2iCBULvozXmm5g1NLnY3CAG+hDNZF2HpVXPFVP6OT/OLXE5SACqDWka0hMJ\nA7OZU9eDxxaCfqOUUTccvoENfH5LmmaRRHnJO+OFl7C3U3aWK07mrCm3hI3y\nReYXJtR4v8mift4cZsokMHk/T4S7/wPGBwXLzy8ABbPZkpfNrBlwFkfv8JbD\n7EYY6Fu9+W1lhWgJYyegFfICh5/pLoMgKDR5QKfhgabaU1PCblkV09RjxZxt\n/HGc+QMYJ9WS2tUJ5lceF1NPUnQE9ry/S71fkxOlB1PaYVsAT0TEWOsqSm7S\nNBeSv/2Ygy4YIwq9jKtm8//ti9IYx/Du5o7oC7b9Zgw5SuUwvQdmLHhxyc09\nUCdIGmGowQuf/GPGASpzaurjfQpN1YQiQILV7pV/CxdAMCIeIosJkhQ0A+NM\nlBp2UVvQNS9E6LxHorbGqfOWS4OV5P8WJ4EoD40Qoafk47xk1c4zIfKIyfzL\n6J4k0/17EIdIMfbAUAUvZ+VE0cbR77gAnKLWLmzwcoRgNbgebkMZb/z9QVdp\nZnqcwEulW3BFScM2w4Y5LjWPGNnbGmvBbyqSV6HFw41MS7wrBPlIVw0JZpYz\n4tbj\r\n=qKnc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nAnd has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker, DataModels, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5a909f85fe65b7e49324530de5e3a9aca062ace2","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-5a909f-kd78z56k_1596019818098_0.8089670215245937","host":"s3://npm-registry-packages"}},"1.0.0-feature-e69d34-kd7a5498":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-e69d34-kd7a5498","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-e69d34-kd7a5498","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e6b5e83ca8e9a3c540e9385e293d4c40980a5b8d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-e69d34-kd7a5498.tgz","fileCount":103,"integrity":"sha512-Yg1bBakptc7Sg8k5eYnDJ+uevPjkcoP3zGffFZoq2c2XBWDgyCL4HNlO0xj99oSH2q7E+LgEGS/fAqKR6vP8qA==","signatures":[{"sig":"MEUCIQD8a6YHiiA2aXq6QRH3N+ymG50p/1ZR819cmi75btAb5gIgEHfSGJ04uciPwbDPTSurdIS96cIvr/B6opqO/MwcTg8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIVwLCRA9TVsSAnZWagAA6XUP/iazr9irTcCkcW6v7oYQ\n2Q69JyOWt0fiwfpxh7BG8ELqnlF0yYKy+WLdt9QXAM2m/1bJNO6KwOKkYvy/\nWzPrb3pUbeyNcYsdZ0gYOyxJAiyL6mn/ESGh2xkYY1rdLqSq3QJrS3ckWJAB\nIVJs5/oeBoucpUNb7/yODq8Rmm0McAT+Rx/JPwNPpGIdIhl/GD5zuLRlrp4E\nYn9WUq5EfaO8JW+SOILCd5pDiTLPbXkaqU8poqvsx+5q6b954QeWxm0UV0YQ\nrmdO1ssnvCuIw4LBqnpqFitw7I5ygaTbKvFGONUwRkc7oVCWu/dr1JLag+7M\nn7oTXt9ytKzq20fA0vNdGkXoiMRlbKYozaU7jet7wvvxqpJDLOm56XPTt0aH\nsyIHz3N0esHGUcyVjAFeFGg+Oa9KMufYUyIZjr9H0B4miNARV++yOI7pZHYj\nmnFXk3bnNx5KaIM7PIz3CE65noR9wtobfai/t0SMa14Y3owpsgcbR7hd0B6C\n2SXsxPIO+Y4v17+IS9m1QQa6DdhsyZIt4zWTC7Zdsw7/v5oUFXQ4PzMw521Q\nVo6C3FlCYjUBJRrP/gbydM/B61hkvlxVvZZ2fkRwxgqw43LjXujocRk/eGed\nWN5lOhlLZqwl3Rn9ddZ5iAwDFgH8dMtKLRMUI0sKdtAGUNOVIFXzo3dZLc4n\ngsTd\r\n=Blsj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker, DataModels, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e69d341965a0d0640ad82228fbc6096e10da9810","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-e69d34-kd7a5498_1596021770995_0.23951188619700003","host":"s3://npm-registry-packages"}},"1.0.0-alpha.39":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.39","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.39","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b51d41aa9be0d1dd7893aee1326fae27f827bab5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.39.tgz","fileCount":103,"integrity":"sha512-V8kex35OcDoJPRNLwr6TTuoTz0Vn2sX7+vYP2UX1kulzWvJGdDZ1muasuzWL4NMaEckRQiMr9sHtwXTLAr+R2w==","signatures":[{"sig":"MEQCIClG6OentBLxQ51O+qNE80hxyslehRkYxB0Hj4FGTL5JAiAjJgSUI1sl8QBysU+xYxI9K/ajjLbMz/gbHjWzv2XWkA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIVwSCRA9TVsSAnZWagAAvXQP/21RKzosYl7HGfmy6El6\nr7sJ0AnXkT8u9aX6Bdl2eVSf1TYlet6mSRo+pUolaoUKJwgaYfD9PEDULn4B\nt9mfD2QDwpuLPtDtm7wmREoptjDq0RD1Ih6HJfCEozOmcBYylYMmcj5QCwmO\noPOhj7iqWRXji33M2cP66uK/ph4yspOjNA5UOSo3W8nPodeOBUo9/zzdYkDB\ni1cbqXRQ/esgUvDUo6neQGlUqNqiroXjb3k1LfMcn42tlID0o3H/5oSQtMgZ\nBw8jt8LmnRTxzgGZfmhHy4EQuHIZGEVkASKM6e516wIgS4vortrd2SShwJiD\ngz0dyXjiUUb2p8l/wmgSC9ednDRTrTmQ80rTdQQ0u9qCvzy53xmc7Xrt91Tm\ndZeqgPBa9Hvb9evdehMFPVCXL3MJEbL6Nli41B/8e4CK3dPVh655LyJLDLMJ\n0jIsANx1PtGDobnI2Kzgz3sHSV5sCy8HD2SJ8qgqAdCU+qU/KqoiztzgEe/l\nRDopsTnTQ+6wMRnANZe6LcM3bRqAPL8LzvXyzDO+EfyYAO2Ftv3re+JwbahP\nf+PJ/JnQCTQr5CBy/0YZWlCigGKb5MVvAm0osD++4kMGIZ4PcNLqJoTWVqVo\nv+uJIIxQWeB4FJzfaDJM+0vMINZc7rsmhmw3wFHre4tAXzv+uHGin68Rojbf\neuR+\r\n=avPU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {ExternalTaskWorker, DataModels, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5ae81343c22ec4b280b65c154d80957a4d954570","scripts":{"lint":"eslint src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/api.contracts":"1.0.0-beta.8","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.39_1596021777648_0.0286345912977215","host":"s3://npm-registry-packages"}},"1.0.0-feature-2bf421-kd7a8u3z":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-feature-2bf421-kd7a8u3z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-feature-2bf421-kd7a8u3z","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d5bece0975e6845d9acf05218e9444264c0656e2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-feature-2bf421-kd7a8u3z.tgz","fileCount":583,"integrity":"sha512-xzN9Gd5BbaK5dJjdiIcjH/p0PvE7Ypl/4N/zGSlXV7Ue//DOJjlVHqhPVx1uTfaV4CgB+X4ACCVM6O/j1ERkAQ==","signatures":[{"sig":"MEUCIQCTJpP4EvWO0k/Alr16IiqdLRHpOCSzb2q7UpSLm1UCJAIgBldcgdTZrz19iwQ5FcOMAs3fFU2qZEKo87+kjBZ+d9Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIVy7CRA9TVsSAnZWagAAvOIP/jRdF7WTpEcKXEQsCfss\nLorO7xbXZZH6Bp5cwopTtmUaUdFCHChLyu+q97Le/2w8ykZk2kru364Hyfk9\naf7mRCXIo9vudKnKwWWetClSan5gkbsnpegJ3CrSlSnossa7WaStEiCXg5EH\nl8EKEs5HgTrvF+tuvRADSsgmJWDocRP+VCgeKD4wC3tZ/DdI7gfbCDAEAeJ9\nQx1odcpTZeLMN8RaiTkmct3n8s6/RkxzTvJR1IzmeOsYeQ72dyRCUeEBkuTj\nvs9lzKu53r/y1PfNFGu3nOYHRz+PQxy1fuFm0DSqOoMO2SQTYZBKpPSllD33\nbNlJsWrpn5FsVNrT7FVN/nNugWepZ4Scucnu+RTlog65t+zlsyKenfdPZWV0\nhw9RGBFuiRuQQMEoIh/8hefzARlwik6c8nKXRvsBP4vH200B6Zoz4lDwxqB+\nTqc33jKND1qEaGkVEXJIgTZD8Imlyu+w3x4hLy1sbe8GwB+Qlfgs5p6kbTSu\nw8tvf7dNSs7qjWPY7HdwfZmnS357Od2P1wVnpHfAWx9zWG+8NzWg3SRfhx/4\ny+jYiFxmpa31VW0nu3Rq+VhLpYbX0PVSNUiD9YRDaIHLhUTRIHjwK2YbbQsj\n2yBLx4tkmhW1x12iOOpgwJA02r4QNSC0q8bFhF3evsw/naxPtugYISyul+o1\niPOV\r\n=oa5g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2bf4212811b7a5da9faec3b22cf6b59f67bbd9e6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-feature-2bf421-kd7a8u3z_1596021947457_0.6709645390316015","host":"s3://npm-registry-packages"}},"1.0.0-alpha.40":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.40","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.40","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"09a4aa6f680e932c1f2bdbdc5edaaec6ea0733ec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.40.tgz","fileCount":583,"integrity":"sha512-6j7NNEG915NxOVuS07RGDDMX4DqkBrG56OXqyfduWM+1ojFzz/vka+KhLPeR/VZv9/BUKdN5Z9yNBXgd+GSoyQ==","signatures":[{"sig":"MEYCIQCxxzj3Wnldn0FdtmS/zCwKgB19ztvt6kUIZtX3cBNJeQIhAIcxgU0bwzUcspbqINCUAkIHhyDALmcSfbWA8Pysx45f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611829,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIV0xCRA9TVsSAnZWagAAVJkP+QA3L0EW5Ts3opUm2glm\nSr+m+Qm9rUIEM3ue2MKjxNcyWG82h0UJsrIZ7GcTRwK48TdxvNd0EQ+bWmEZ\nVOa+gWTUmxLvzauWSwEzRlohfUVlTGURkndPB+F5MO4UgIA+1aMJTW7lL8wW\nLavPHZCyltzSq6uCMmo9K9FY7CiGWReZJ2keN++HSUzA/oNKjMMb+21FSKTB\n+gezUz3qonDo21RgxS/wf7wTbXMOPlCyVT5d30XAAgt3126FGncw+Sz/3NPS\nmyIIhawHYW9NmZtOzaqP4cyu6TBnxBa8CHNfb8IlSa0Dze/1hiaNG9eR2KKU\n7DTobzJbjMZsiNud0yq7kDroaVLMzqEidILFxOsa538dU3DmMxu3/vE2GHWS\nMTmbH29ZKiYm6g/wI7qATaGdlCfFQkPoniNOYrWNRx9cE+sr1nIBSlgE4hrR\ngJBPVsp7uhQnQDLfwxlTI2CaJkOyROaHUs2lSu8bzH3EbIK3rTi+yekFM4HY\nxNltp8GB4KEqBhQZ/hNhYMyan8svgZXaM67mzJ+cAM5v3YAf+oZ7w7H90/HW\n5ne7DlcaeeZ16Bf7C8fPC3/t6h15izpG5LMLLAVyy260KUGVewavSs7cdS1N\nUAECPKL7QA3q11dm00e8MnC96AJOee+kwkH/PpNiyQqFHHaGtLmhDNn6McHt\nm5Vf\r\n=b6cA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"66c4627c0b8d2dba432c68a84e49bc1acfbd850f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.40_1596022065193_0.8663125966860024","host":"s3://npm-registry-packages"}},"1.0.0-alpha.41":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.41","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.41","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0a4e304ba13c261244519644d6c89f7892802b2a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.41.tgz","fileCount":583,"integrity":"sha512-mbpAuZkdWFb6P3PS8yXxc9UXeKmJt5OSO3+Em+Sw+Cvyzjfd3HU7oMu/0negm6jw6jzgN7loEs5oqSY/L5JFDA==","signatures":[{"sig":"MEQCIErCQaVwgZtD/nijbA8n3D/526/xT3GN6SpP3BKzazx8AiBI4Z0V26UAKElWMqQA6RlRoKg/a8T8GbQRRnqrx73ZzA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611829,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIV30CRA9TVsSAnZWagAAqjMQAJjn+ZHXh4oLX9WUp4ti\nNDKrNwvRa6evj6oRX+HKtpFhUUlQ8h1om7ecknRoXZCRbp0kAI9fptszn7GY\n+fVIpILMt0c9pusOfJrm7VJxgTzvgke8PN3LJqb6DcRVmC0bFwOYZm7wG5As\nVS3jHZHYoBt+ND/AeMIx1geGySFIrV8kOSxXqGf6OAle4M4BOV5oN7mYoCSO\nVJ5N+1ALM6ITmCsRhgRa6fol7ZftryVMmc561Bmj0AlGQO9MX4TvMfWyqU7H\ntjgffUq2/6YiU6SDDTNgtUAn95DQ6wkKIS45wK/I92RftSP3mgv2450UAmCD\n03ZkDKHHxjHGfExIVifYJOb64mZV0KfOe960r7541THZe0uKnfYJsI7szsEO\nOJmtsRXwIHm98fFGtBfq/5N92znCEEmw6FHrx1q4YG6OngFiJwgLeQYJiuq7\ngeSwP2GdqxDjxE++iCIKLXjpr11U/W+YyUkLHhV2QiFq44krQxMTk7L9tWwh\nuHeIpuKdFpXqxPtkr8t3OT5EMGfiqJz0/ymWaFkM/1J7U+WpnTgANiUCUXyO\ncEX562At1FHwlqJMRKD3kHNifs1FTS2c0pkTFdUhEanp1Omc4NrNv/uhcboP\n1p9+zQbbuG7aXEs1mMbIMNTFs/NQQC1fM9jL+lWLen7isKcfbv15TkPYEcEs\nFxq6\r\n=/0Qp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0807b777005736f79a8e1db75a572416d3eea437","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.41_1596022260510_0.42964344695115275","host":"s3://npm-registry-packages"}},"1.0.0-beta.14":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-beta.14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-beta.14","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"19a4ea7ce3b20e5cb1a105070d5ebb4fa32d1e84","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-beta.14.tgz","fileCount":583,"integrity":"sha512-Di1anJOZPwGxlaXLC8FN4mLaEpg2c7PVL0AVEEabLEUx1rqb0FIoK2TvpdAgINXd1h0VAmC03v/0kMrb6P5iDA==","signatures":[{"sig":"MEUCIGo67IfPF+GdpqIbwpow4DhB2xjWMfFeXYj/Rq4iSPnVAiEAowzWqXNj0QxlO2jw40p96hhiBSfbx42j6Z2v11kH5gE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIX8HCRA9TVsSAnZWagAAOtsP/RqSaGQMDkljpdM58BTX\nE6+FpQpdbVjHIPGSZFrgPFST/XSMeU7ZncSrzgOb80NsaTO8ym+5bXHQextr\n3FjcihBFBrgfSOkysyo12eejdF6R0uRvDhpTdsYZTjB7aKa1xGbkmMAGuzdf\nH948EYVeJa4P88fkvtm06GcAvZdHpaZR3lAVh0mSkzZ+OQkNNoWycUtc49VJ\nEu7izJbIv2GgqKFTvimtIwAaO/aNxWHg7ap3cMEHUpwCvNbAfuxUtOPBa4nl\ntKbgYwzLJaKFhOCHMMYN1Foux7XaVXchFEsC5qM0IE+7kKydVC5znpqPQkeU\ndKd1+DP88d9VfkCJ7c9JXWA8jAJdpoRGfpsyW/wfS/cNYRcGYB0rNLmlrd6U\nupu3OjSEReuxf7IkJsWZapgIbFQDGRhIM52c69Pl75P65DG5Ttn1/6sxDoE8\nh4W+NXW+AEivKG/IrDpy5YpDR1KGZUfilpemJBY0Booct7EFdL9OvCppWnBD\npXNyLST+xxY7lzWmkNcOwnkUj4LqbBFQxlSVmrRo87luXVdjPlhGG5zxQwVo\nKNCYdZ+dL0fX7BY9wTb4EqDI+fMsxROPgz9tr8ljj3mRCjFGdVpMLfigz566\nszBnWcLEpC4iLxI3dF7C0G5/KADrHo688LXKIcFL+PVYoVOMYVBGQzme4X4H\npUpn\r\n=ZHxr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3fb5112f0d4df2be74ce4961ff6ac81ed9741bbd","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-beta.14_1596030727391_0.7909721601615218","host":"s3://npm-registry-packages"}},"1.0.0-alpha.42":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0-alpha.42","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0-alpha.42","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3b50e9c0d5a46850eb33f70816dbf51adf7765cb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0-alpha.42.tgz","fileCount":583,"integrity":"sha512-guiER0zsZR5GSNO8+p6ieIfdzgIYqR77QF2UIF98Bq4J+yF6vuuTRkI9V5IvA8mdItJC9GqaYsMWB7LXmNPBiw==","signatures":[{"sig":"MEQCIFHFqqiPvRe08+26syDt1cKzv2Bg98syvYGSbUtlddKjAiAExxO2vEsu9/T8nIy0D4ZdB9rPHEqM+MLNZSnaRdklRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611829,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIX9wCRA9TVsSAnZWagAAKzcP/RgIGiceMHROayAlEY/c\n0fggasyY3ne+agrE12N+DV+47OIdJD6jEoNKLdHO8j+g4/yOaDCHiXs6U2Zx\n+C1IMg80NIvZlI+jgNOYHAl5CeiAbqQAE4VI7F8NywZGGtA05EU2vLRZMIMk\n6qtCmYFO8u7YChnpXvviVGz17OVilLXn2q0bCGKCT2SUh9+6osIePUVnbsbZ\n/MunVFdQCRtWFGN0N67v9Xic072CoUb62CMQcOfYFyeVV9pGWlJU9z+wakK7\nNZU5oyo0EzpGBsPX/9IUSsdsKTl+opZYWh3rpuUTkBYQf9cIPIqMkA/2P5jd\niDJXImZCdosUxZ8Uvz6k0FKARXqkPoSQDK0efMdudpqk1CZwrFggbIW6uZdi\nEOjAITfWenyYHjSHei8BlJclcMhL6CRUa/RMRJsEK1VF9buQHwsqH74CYpbI\nx5MWP9HQ1mvSaEtR/C0AwHs7b5gec1trwLjL2tQD6f5QG/IV/UobY/faJTVB\nPp4/+p6AXtPmXtWO7K248NCJ9aHLUpymJ+3Ag2iKiCcw6lL8PvI6TNMrJ7BE\nsqwUuvCVyxjSK8TBjsrTy4iQI/iDY/+0bmaynvvIqgrqzLBE8SxUXHRFhrYn\nVUGqWxyjSHjugBddrq5zLCD5UWkSygPzRfQ1Tj3jaz5vd4kvMScWH8GUAreD\ncPcQ\r\n=eXTu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\nIt provides two components:\n- A client for accessing the `AtlasEngine`'s User domain\n- A worker for processing External Tasks\n\n## Quick example\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUrl = 'http://localhost:8000';\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\nconst userTasks = await userTaskClient.query();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\nThe ExternalTaskWorker lets you process External Tasks created by Service Tasks.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst userTaskClient = ClientFactory.createUserTaskClient(atlasEngineUri);\n\n// Querying all available UserTasks\nconst userTasks = await userTaskClient.query();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\n const processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitEndEvent({processModelId: 'MyProcessModelId'});\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'MyProcessModelId'}, 'My_End_Event_1');\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  correlationId: 'my_custom_correlation_id',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n\n// Creating the client\nconst processDefinitionsClient = ClientFactory.createProcessDefinitionClient(atlasEngineUri);\n\n// Start a Process Instance\nconst processStartResult = await processDefinitionsClient.startProcessInstance({\n  processModelId: `MyProcessModelId`,\n  parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n});\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {DataModels, ExternalTaskWorker, HandleExternalTaskAction} from '@atlas-engine/atlas_engine_client';\n\n// The URL of the AtlasEngine to connect to\nconst atlasEngineUrl = 'http://localhost:8000';\n// The topic for which to process External Tasks\nconst externalTaskTopic = 'my_fancy_topic';\n\n// A handler function for processing the External Tasks\nasync function externalTaskHandler(externalTask: ExternalTask): Promise<DataModels.ExternalTasks.ExternalTaskResultBase> {\n  // Do something here\n  return new DataModels.ExternalTasks.ExternalTaskSuccessResult(externalTask.id, {hello: 'world'});\n}\n\n// Creating the client\nconst externalTaskClient = ClientFactory.createExternalTaskClient(atlasEngineUri);\n\n// Creating the worker\nconst externalTaskWorker = await client.subscribeToExternalTaskTopic(externalTaskTopic, externalTaskHandler);\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"30a53442479f07832e310f4c9a5c9374762199fa","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0-alpha.42_1596030832430_0.7201655774880882","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@atlas-engine/atlas_engine_client","version":"1.0.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.0.0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"25c79a656a922fb86c6ad0373d1bba72d24c7ab7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.0.0.tgz","fileCount":583,"integrity":"sha512-eIByxFgD0Wf9I4HlGCV4nXu37agEC4Y0gRrXB2TMjxjP6tNnlIcQA4/Cxg0loTDgzKQYVy7ypAjhNWqE/qZsBg==","signatures":[{"sig":"MEQCIFluJiw6bNRO/p6juCQ+Z4c7SgWFdiyoo9cw3cU7PX//AiB/YTGFxiz2uXJKdjIGQIoDwGNW4jpRcH9Z8ttwYKgJrg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":612053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKqEmCRA9TVsSAnZWagAADBkP/jC9y7xE2jd7zutN0xPH\njk94QOgU0V5SIuXSATzgVzpaYHzqBNkKx1cF440qTaS3jcqy8Rb5Jx2NhFoz\nKM6MW9ud3pzqg9x+pLjMiyrq34mYsR0oD9vAUCYMSnYCapGogLY0MSSwzFhn\niLu3ShsnEpKybcfczP0g74qmHHPTMOSo8ELUnorPX8D2d8Gg4UtmT5TUCrmP\nF0yVgaa9gY750C1uZGjKA7CelNIawXq/bzXfHjfVkbCd6EttyB2HVaqof/mR\nNvk3VmTfTn8jnUHYSfHT9LNAzSDyV47ZvoCocMaZQF3PQsxnSo0sWbFj1D9h\nXeYLk2BMdZtvS6B6padwkd6DJohky+8f2ljk+JKEaoJaH/a4aL2BoBu3Bwv5\nx3tOO8EAEI9uD68LWUtpYhRHFyNXLZraa0wEqOhTyb+8xb9JbAagfyUUOvf/\nQKXQkQC/A/dvE6MYSIXOTBLCz4v1IUvA9QM1PpGM7RXL/AMdoGz2SuDaXxV+\nv/oKe8T3KdHl9f6wk6rYLhv4nYIR23WB9/gh6n6NArtYOeVBNfw9HMn2KwBG\n/PEaouw0vBXdfM9y+/+SKDUEwYHO98EcagmLsHeNnuaHJ6920OkVTLE6Fm0d\nZozYipPKnuPgSxsNG1b3uQcEr6TB6UEDL/388pI1VXAhUXwzyYWkumjv5HjR\nF6Xp\r\n=iZhv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"8a00ab714fef66e4426c4379d4141d1f844f45e0","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"^1.0.0","@atlas-engine/http_contracts":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.0.0_1596629285494_0.31034222345506857","host":"s3://npm-registry-packages"}},"1.1.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"52e4cabf5c54fc46bb63e6c6e25987bb8d8b7cf1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.1.tgz","fileCount":583,"integrity":"sha512-IcrXO2YXm7OIx7YLzfeaDVeo6y/mjQ8ek1o6NtVYrETeqCPxR/1woF93vie+pJ/PgzkIlzTvsofJ9RG1hkpV8A==","signatures":[{"sig":"MEUCIQDRXw/YU0Bt+h6NQL3FjzZ3lqGDAGhyhZ9nwz5gY8AEaAIgG2hJT9+ND/oSz1002uT7dElR/Or0PdnPx52IFlZfI1w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNlftCRA9TVsSAnZWagAA6lMP/0PwpiwHaExf/osjlb0H\n1rEI03jyV3W4DgN3lyp66AAMzStla/kfRHW54Qg+taDno2l6/BdW8d7DFj0b\niGs6n+bXa95UhY9lT3GaoTRIMaTEIOl7RiJwvl3CSfSndAenJQZ5uCbYaQPZ\nDbS/OgI20PwSRAclxjH1Yo2UfIBpqDk6Z6xeuB/Yz5k4zCEIrVdpMGatEM58\nkJl9K6F5G/i1kL7NEYCM9SpKm5YTxO11QY4QjZF8k1pNOp7JPSw9qJ4A0ibe\nxDD1Iuaj+UoEY/0WGUC/7U2YF6fzFp18uaQYE7VpXBq5QcRg6RK39XEjW5L+\nesC6po4+oYTKck8WiB3egjTCPhXkL1TVcfXOeQXyr0WYPyLWd2qMPeXS3IKC\nJllIFmVkaDR2W/a9yM87il31jxd9VxAS9o4aKs+3bT1rDIi+skv8nZqjmpfN\nDSkThctlyHWer/q/+zUbLrbVnS342PrSdabmGHDVjhOZYgbCjb9uAHpiY6jc\nZm6JuWShHEbJ90vRABrTkzS226GZyYsBXgiy16jLVHjtp6gjDog/C3PlD7AT\n6YzsOGyzkuLo1VOM7V+RAzyg5BNZlS6dnWvsy29CUztf454pNSdExzNUvbjz\nroqXl+/MCEoIa/aRrocTC2uMx/CokhpcEbGZldZYethdUZrzbwcFGaL3QG9H\n5GHe\r\n=eMDy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b89c891955466f312f959d27843e7a8b19ef8466","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.1_1597396973198_0.6415887815277197","host":"s3://npm-registry-packages"}},"1.1.0-feature-b89c89-kdykcoh2":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-b89c89-kdykcoh2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-b89c89-kdykcoh2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4d8c4d552f60b70ec9b22fe499fcc122e8a7c5cc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-b89c89-kdykcoh2.tgz","fileCount":583,"integrity":"sha512-4pbzJ+tY6fTq133xrltHf83f+U/alknnK1hWWrcNBx858KH+sfDCBq4fRTsyDCAszPV/cGDsR2rJ6fWBxK2XVQ==","signatures":[{"sig":"MEUCICOcZUhIeg/OHA8HeP7t/fU/8Xayyvfc1hbp997j8G/IAiEAifFyb0lYNkw//NlAiwQwdPj9BOEOeB0AiL0zIOtm9ms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOohRCRA9TVsSAnZWagAAVlgP/RwQDewNRjHhtPCKlbXD\nH8b/O1Z3eL7lkV5HffOiYWQZ1SDYiTnlw8fPfSf6xDh33tNZDlPsPFUJ2JhA\nPUSjdr2VIvVpHOiRKVVzUnlO7f9RePPWCcLY/bBxSbhQuuhfsHx04+LciEw5\nrOS0+hLE+EeTJc0n+/4dCXiyDz4ofmBkeK8WT5ESwckaQL6bGs1JmvoyXlY3\nsLLm0gJFcd+waEfYPAHsqT1lBeVkS3Uxlinn88/UGJRgrGTJTwo43Q1+YS3b\n3UMXPr2tU248anNUSlRtq/szz2E/4eiVXidP7y6a6KkVW40qRQIluH2zIliV\nsUisWnxO1pRTDHkBtYZfGPOjSlnc9tGc8cmRYMd0jT00Fa+rhgjkLudoVaLI\nimCxbM/HkVtItxAySPB15XPlB41J03SuiRLz4GUNRpKE3iDCxNFoiyXGzW/i\ny61pSmEd0LqJHBIqC2d7p0/jWzEPUNSQXHiE/sIaHuf24Oy2BuFO7MQKmsS3\nDy7sfRcUEz9KgNEXwUKGLDys8s60RwB+uUg1oDbjBsKJJLvLiJvY0Y5U90Yx\nCjCd30ia/HKvpfHFI+uhqqVtx6sHnO9gRV/lLRYy0+XVMYFe2Eo9ACj+A6Tj\n3eZvsoLb622duFtWPNKb62+jzqKpe0kkf+ZfL8khk5hvLNcd5WFRIzFxaTIN\n6CvD\r\n=uWHO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b89c891955466f312f959d27843e7a8b19ef8466","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.2.0","clone":"2.1.2","moment":"2.26.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.3","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.8","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-b89c89-kdykcoh2_1597671505387_0.0295842072163377","host":"s3://npm-registry-packages"}},"1.1.0-feature-8b4393-kdymjxfp":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-8b4393-kdymjxfp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-8b4393-kdymjxfp","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ad5d99afb3c78ef00e9a73a5150ec45eb8d9c24e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-8b4393-kdymjxfp.tgz","fileCount":613,"integrity":"sha512-Ha/LZPYgbcDmc6P6n+lRjL5U6Pm2yezqjxFiwswu7O+FEYlOcLMplUPkEOBZntnAjmFylESv601HrYE8g7YCBg==","signatures":[{"sig":"MEYCIQCgTSu+qYffDhLXFr8oWfqlYp+asKMRbgGVsYYgUEsCfgIhANETHrQxvVBCRKPXtr0qxy5H5z4YcVebj1uXaCjyR/lR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOpbGCRA9TVsSAnZWagAATE4P/iEgOsMwFGgKUoXK/8P6\nLRYnOo5y6I5q25vW73i5n9yqjjGoOMTVLZ6IidSI55mgI+RPBFqj0d6thsme\n/cITWKjLkr6InYWixnopl/BToO8fYPifsHOhoW0ON5/NYtbZbXqzN0MC7xLP\nkZtGILKbW9vM0gJzUK4U0bbE5gn73YWqa/9ZAwfkESDY1gDdNTEcovXPiLp7\n2xqX+NQKK97s0pineKDw5NB4xwPMRIAP4z9RVpUlgLPvk+uKqBV6bUTYu//2\nRb1CcjAF4n4aI/Na5+m8vHh7U6UJQwJr4ZFxB4/51qBxDOoiv/aQC1UMv4ee\nuiSaDFikGMSKF8RMipBGzQH+LYfnod58iUfAaZvT5IT9HH0gMuXZm4CYpcMj\np//s0M9442+w3dh3juSugxjk6dRLKkjtn++gy/ckaCTjh24QR95A811xHhdx\nYGfhjRfxg11R4J54JbSAnbbVEqL8JbUi45xAMZvkZxKpdXS7BiRtO/TjuPP/\n6Iok+d1b/NRyALJYzibnRB1dZudovOkO1M5Kh0lx936lIgydw9kW6gsj4GUH\nezAkOjx/iUzv5k/UKdQcb+tlUqaWmJA7kswX4rMC7tMqdyUW7UmGc0er9D8z\nIF/yJ5wZShwvGvxGG2nw+xJd+WVmAc8DvviI2LG7A0P0Go/LsIPRkLDc3bnG\ni5WE\r\n=5xYF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b4393197b0790ba8896ee01dbd9354b1458a08c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~data_objects","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-8b4393-kdymjxfp_1597675205881_0.21588161695650898","host":"s3://npm-registry-packages"}},"1.1.0-feature-f0db9e-ke142ftg":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-f0db9e-ke142ftg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-f0db9e-ke142ftg","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"931882a93d35cfa26bdebcbb8ecb4fd4cf90ce85","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-f0db9e-ke142ftg.tgz","fileCount":613,"integrity":"sha512-TsryVs1AnadnQH5r9RU/y6i02C3j+HQxlZMl/hDsEdwCiIePPDZTvRaIyr9A6vxMcBWNb87MSxuk6F6UnJrV6w==","signatures":[{"sig":"MEUCIHiUlmDsMfSDbcvRSt9Y8c3SZ4R9ahN6fIVXLSgErOwLAiEAxLcLE7SyMVnogis9QzmSyxgzDtaH68CF3Tz8GHkDM3w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPOIYCRA9TVsSAnZWagAAEBAP/jFxpSvGTZuHyv3CZ5au\nt7caQ0iQjmh2cPI5ZT9E/RglPqgEM2ZiNuJDdAXaD/x21JtnfIrY6cyEgLvx\niITt65/bSjxUxrhvKSsfni9+XKnWf5xqviVHAPc5YUL2Ig2/3cbA4llwNqcQ\nHd27HLHBeTFG/Za4nD3/p6xWr0kKSrZNkxkN2f0AbKy5yhMzHsLjzLqwB9ou\nP8TeFOsJ+wma2VDNElr9c7dtsmzrjVE//aOoqGVIVnre4cpJNX3whIAVS4Wg\nJQpOCArfUnG9XMfHiIg4NZolKgl1ObBTCUskjv6+GcWXsDbCjjpoTFS+1CMa\nUmPCdji1To5EjD0IO3NGR/413K9hRs9D688gAtFqUhs5VmY/2Zk//uXGBWu2\nEU1bzRZ4EGueWl5VRR0l1c3VsH1mupRGh5Q7yfr0TClkVSu0FpxpVptmbaSv\nAPhgnlLsmVOHEOVFOvOn3469Dp826dAxgZOlxK05NJpJze2+Zf4ZR2vGRTfq\n8JzTQVHDfM5HpvE60cBsyhBd1w8lzY4xBrroinPj7L9dHLDejCxDZ2K74lJW\nEqSp3+U5tzYe9sObCTYUqIt1xufeaYWiKiCEhoHDYXNDBUoo8rJfw2XpiGf9\nD/WL7DK7RrGe03UouWzuraRhu1ChSa60BLObi38LgAAjHj7aWKKHCwIg02WH\n39oy\r\n=8ve2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f0db9e6902b1653aca324766c909bfb44c357423","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.3","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-f0db9e-ke142ftg_1597825560040_0.975107632039963","host":"s3://npm-registry-packages"}},"1.1.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9eb22b607f641b1b223e706a9c190777866ea747","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.2.tgz","fileCount":613,"integrity":"sha512-mF1EQcu63zjkvrU00X1xXFytjz2WS6QuTvH5c51/4iKqPKqfyHDBeafcaSpRrNwQ/ya9nTuGTUGqR3MmoH4fVA==","signatures":[{"sig":"MEUCIQCgLNjif0mdqRhYaGEApvk0Z0xXZ1smu61Yc36BzuJ+9QIgVoo1B0D6SgwhTXv/NsSldIwMDWbF+nsi6sRmD+NUGUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPOMMCRA9TVsSAnZWagAALaAQAJBXHVtyxbt+uhiyjfks\ncoldQzdTQazofHpWGU7wdXKOkCuXdDEMGFRPsdJQDXciWcR/iNB9cfujT4fi\nywKtK4id9HetnVaETI9khVNw6kDgu1erNJZ8foKIP0I/aAOawJAoM+rr26YU\nZwtdKz5lTdDjWDsBKbH3AfNSLGtkDF3n6e6LaPfAExMnMKm/0bQ7D8FGD0d1\nXok3Fv1Q6N9DJnC7HnoDQ6PsKnsKq1fe2B/FW+rv9+Yp09loaJb/4JS8EFM7\nGsPDfZ16aI95w44Su4GY4JBtJA7QjC8CQEbi1GSPEi5lJM4J9Bi5iajBvV/G\nr85A+tyHLhWmw7LqtM/sUwGew6VQdHfnReVZAn6Kyy5x6KSt2pKb1ABrTJxW\n4/78LCknHfWNdSjBluWzmEpFR318pDE5k81FN7/ahDbqlwRPN7S+fchU9Ddi\n3sbh9NC/sZxBLgUa2vbMMRbmSc9n5KB8B5uhOHreZDrfEL77C3IiI4rWJ8YO\nwulho8ziQCMw1vl/rZKF7LHhORV8s2xrM4DvZo1lUmZs5EKwxi51Ykd7cAYt\ngTyPl6LuucMaxR+ys1+xIkO8Al4wDNH9DDfv+0qY1HUtV3kcyWz+/SPtDqQo\n0FC5DzRJiomgc3qi5a9SzhGSXZHeIS1nn+/IFxb5+N6INhfJZRcIvgRNfamK\nbGPw\r\n=twb9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8a54e04ced492533188aeb3da91ec5a666cada1e","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.3","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.2_1597825804452_0.4936301240759784","host":"s3://npm-registry-packages"}},"1.1.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-beta.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7bc8d7d7076422e1c7b2d16d682239550361574b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-beta.1.tgz","fileCount":613,"integrity":"sha512-+Y44epzrkMh4BivCybq8Q3U32NGQtHusg6orCJQ4/wb6pDtH9HBbCECLZKHsISVmbyj8NoWZ5O14pFbuTo1LDg==","signatures":[{"sig":"MEQCICmD9aQ4AhlQtcHqX3LtDm7W5zAQIbnT29VTRj2zDmnwAiBhFFoPT60Jo8yFmgVMk4kWMUmP/DIpAFrMB1yPpF8VbQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPOxOCRA9TVsSAnZWagAAnYwP/3vJ7kn8GwZGROTkrogr\nSZhvSomWNbus0/x2UAsNxpMM/crxI3BNXenB+GwyaerqdDVSIbw8kdQJ+WY+\nebHKB8przu6fCLEdiUu/S2IuXwWiDTDeAPJeEciQkwX8RbLdgFqOsqF18y72\nlwOISX6I+R1zW4rEFSZBP6B6b6O8gWFM4fvrM7rBjCTuh9BRY+wsS30DGKTP\nurjlApZRAQJ2mMAm6n9/cABTVVwauHKBRGj8SroKRo9T+aI4d3RqZlMsma/G\nPj7DwKMjhq0p9y0bk/E3NTMQrbZfvq8dxo/rkpUe2eFtk4gmWq0giebuVFWX\nx1abtKVypvghen0L5WJg63hJo+7O/CYA7QArN5ucCyvlzUIU0sVwBOj/+eFz\nXBmGrYT3TUu0AopSz/oYYK/EFmDkgJUbsVKckyh8RbCnH4kXkKqwNPdeQlwJ\nZxZnoB2JxcQekdQs0ZcftiLnXaDvwBzXe8/RC17S8KJ1/xSyaVK8aIODdWCo\nN9dpJ/tQ1p3ED9NiCNbATG3AXnOagcK4fsjm67jZTFjdAJDnADzi9OAJXair\nqVARINTGcMEX08GeV8L9pMA20FjFaE6M4Bm3sjJjkT4CfGz0NvDWDEvZ+/8H\nqYHFYE1Wv2c1IE5M4j25p0Zk2VKtxm37H6aCFjgoi/HKI5cWuKHJDWs5ZCXb\n/Oao\r\n=KToB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"24cf40a38be1ab0b1d497df2d312e8a695669e4d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-beta.1_1597828173831_0.11328538125477272","host":"s3://npm-registry-packages"}},"1.1.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2526bbe10799593bef2180d5d3a752a1b3f4db1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.3.tgz","fileCount":613,"integrity":"sha512-3CI8uyeO7lHB1x2lcwBNvPECJO+IC+IPifylht7aFY/gqM1QqH1fSjsU3UopVNFh/R12IxzhLJNctO95HJUEGA==","signatures":[{"sig":"MEUCIQCOmsPEo0FYhsMGgac+p/uYgdONq3OS+MU57+GQcOOy9AIgMXWuLo9AmCFyzQH2naRR6Dd1cZ2WNHFJeF1uQ974clY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPOzBCRA9TVsSAnZWagAAg8MP/3uTT5duUuxo7M/5nXvi\nzr1wD6k8M1IBRtnCpbSJFXGL60F60Trva5lh/22PHMM8J2YGw4doWfer6//N\n54EiPmLuM+sovBR5dl3l3V1nRl+HJDuokkQkFM1omAXJgIHHNpyZtNpwghcY\nMnYGZEc+BPEqTSSbQZsPgWHf8l6gZ/IgQjpxA84wrOIY/pFs3Qjq/QcGpWAC\nIvh9SbNSENKFYKD3a+EcN8rW7vNqRPZTBgdhf40v35qA6qS+w54eSUtfICIy\n5C8Uj194IwwV13D1nDLOaxGtIXbdHFni7IsuxvME5rxaABjkacMr435BxpFa\nSqOOJ99aOnBO/ZUm2QJmb/3jM4cON4VsekX5NTUjXLENh2/gMW0+SnHDVc/1\nM1BytxCR3RRD5yUxJVv66NwXUWdjf54XiAHQnwF28N3V8YLnOdivM/JsFA44\nMaxt2ulVBLCUL0jDNvEIFU/nus2LbCpmfYDOF7sY8vNVfVVafe6N2zbuUQWr\nDEh46SgImXqHB3SvqV9g8kklDnYP3WUbvQO4IwjgrLXkacTA0de+HxMI8oUT\noJWc010RNVJWLylNQBJ00HvC+2CCnuDypAAZPR0B2NLGgW96e9+6QCH5Uca1\nvS7UR0DpiA+L57ZyEcG4tgc5o6d2FDdfoJaJosDiqdYykeM4tBK7RRaC67Ls\nRSIp\r\n=1/JL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"716d421a4e1873c6649cf6d645db1caf76116aae","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.3_1597828288611_0.32628174375875196","host":"s3://npm-registry-packages"}},"1.1.0-feature-717290-ke2k9kq4":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-717290-ke2k9kq4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-717290-ke2k9kq4","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"293931561e1e697918e5df847695c8e31b64827d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-717290-ke2k9kq4.tgz","fileCount":613,"integrity":"sha512-ZxZL2eKkK935DHtRnfepjOHceBqrIqIzGxocEqBhUqas58LGDlzrAk5Hx8jZO82OpmPOG1ckPG6hL4m/IOZ0rQ==","signatures":[{"sig":"MEUCIHgIECSLBtC0uVb855B2YNgSnt5rVM/08NShs248F5lCAiEAyViLJ+2oAqthob8hriKsX+SLoGqTYaU+EaP+bqrQ9kw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPjiJCRA9TVsSAnZWagAAjvsP/19Cm8WsDUIjk3iWrrfR\n1zItqN0GdqbFfO8uD9LJgu0MzszJ41n43UEdIXG8E6wPyRGDZgtbOjPINjf5\ncuuoZzHtDbgj1BEdL5EBbr6sPIjqRALBKASap4wdcDdBFalfeMCpwftayzwi\nPFmMAfRA//XxJXjw6NAgNTAcksoCN3NS0XUZAdzaTg8RpdNIsc7Wl9rPjA4K\nPBi7DP0d/F9/jDQ6ofLPqpuizqZKFDC8B4ICEu1OWFfOPhf3YzJMBqhhTBVx\nLDhSWPzR4ENbzseKmavN7J7/gdDnxRl7g9151cRcxzmogXmTN13KQf3egxF/\ndi83Fwq6wYZEihJm5rQSxm+5iyWSr23EBvkKD49ONgQFxzB5yug7Doga4j+l\nrqflJ7+5JPvrN8IMgzdLTickHS8SaCYrPJsJ6YLcIFMjAUFRaNegIZxp8RnL\nD+tr/56FSebMjeZo7F1EqfYCZstIZXmu2F9oSw/aERz+zy1M4Wf7JlRVMBaQ\nDA6JiugRvuUzNm9loJ3DfFJBYDBzeGE1uvdKLWgFkT0cl3hcFYnEy5t74LgR\nhXEkbzs3P5MnAvnEeKW9EeYQnF4Gn63x/K69GA6TzeeCAym/te/Wt4j2ITGx\nLtKpk8qvL09cC7JX+8TbEL4mtu0ctyjRzGj1j/sYl8b2ZYpTC3LzvRAV6GRm\nA3O4\r\n=RKLB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7172901604a4f2b9e45ce8b4b1705c189bd6b31d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~rename_preferred-control_to_custom-form","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-717290-ke2k9kq4_1597913225269_0.7024661608979317","host":"s3://npm-registry-packages"}},"1.1.0-feature-716d42-ke3uvbav":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-716d42-ke3uvbav","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-716d42-ke3uvbav","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8d27ebdd2ec73f4614d88216de27e2d52e2a7d2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-716d42-ke3uvbav.tgz","fileCount":613,"integrity":"sha512-BR8RIy8sUpmTe2f5/YR1BaAqL9feRDkBjGEexSldntwWpR7tdmQmZmxq9RNaAuDf0nJL5r2IVWYmhzguQ+ZyEw==","signatures":[{"sig":"MEQCIFmL3Ag+VMfdnnBy7oJDC16AYYecNiqHtyLV+mrmkV0FAiBnZZYLptYNao9fB4bR0gFsAP25khr2zOhNMcy01j9NYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP2pSCRA9TVsSAnZWagAAwkEP/3xSaUcxYNOL52OqWmiP\nWwKBUdIWcHBiaXXCGvPlM8AvVT+tetF16R3dUt+i+M7czTSpjN5v0IeJTJgN\nSyh1o1BmgTN0T8P6SADWJgaU6AAGONY9KRtww6z3SmO2zQtegV6h4t5VG18K\nKX78AohTLr5TT2GJMK4NOt1E+lbFKczoygiQyfD1CpI2ngqBkZDDkVpRzrq4\nTCEByWUKKOZXaHJOzzQz+iHIj1h6HNOaFqB2tSd6JeSe4BSTMFa+DHKYVxuI\nURtTsDxDGFNGDekgDEobWUajnpgd0hNCOkLQwTj6Z6MG42wQRGcbN5LUM3UO\neqj4QwapdNhN6vdRyQHGhnDARXzr+aMh+161WpeKke+/i1snzdH2pm4Z2W0O\n2zremCY0Nf/JBYx4sClQq60vEQdPgVsRQwyam7KwRT3CVpDT7HLf0JgYUM1N\n/VZDrOTmq1bhoVgX8XpPglGuQM7tywHoSiKSU4jYH77NKhTeQXYfWfBf8koz\nGvIDVrTB87Ts+JyONrNZjDApfg0MBd0f2aBJEyk7XlxumHYmr8QotwR3sKjQ\ncakCxWOZor6ethDfeEF1cAVenP7Im7N4Uv3eQo1fibYpu4bxcrSg2pQXOW+b\nYVv2/G6ftU9vDSO3C5xwHL+Che2TFft4LV6qVqKKSMRZ9O0NRUGudHvqRIQX\nQsQR\r\n=pgwD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"716d421a4e1873c6649cf6d645db1caf76116aae","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-716d42-ke3uvbav_1597991505932_0.005326175901033681","host":"s3://npm-registry-packages"}},"1.1.0-feature-55cbb4-ke3xdbfe":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-55cbb4-ke3xdbfe","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-55cbb4-ke3xdbfe","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0cd6f6fc04568237174a4094b84dbd2595e0677f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-55cbb4-ke3xdbfe.tgz","fileCount":613,"integrity":"sha512-xAu+sc3SHLfQ7cr3iVwH8m3AF+nDKvOt7GCqyHUHK9SpkQi1OiTpuNEoKgwNrVu3kRj2K//THpM8ZuAMdWvlOQ==","signatures":[{"sig":"MEYCIQCoFxaEM8SUAkd4rAJ/jZ59D7zav3O69Xpi5eA3vPAfJQIhAJJSrdhnwdzXnE03VpaTRvIXPUdCHxMVLbWan/NDxMRj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP3q6CRA9TVsSAnZWagAANcMQAJLOBbns0x+sjukvF+2g\ntq/dEUbRGvjre+5qXiH5cqJTBCMXibJmbMy+l1C6+4rwyNbknDaG9+/5sDz1\nGIj5XbtNXZmOYWGP+G1KeySd9oY5Y10sC1KsrOqURrBp43tIpQraqZ0z1Bov\n0STk2WAyH5l51AhUyjP2ndaJqbDtHc80ngMyv0RNLiL4rS47P8fh7E7VJ0LW\nxqo1Kl9zZIbEeCwqNT5Dj6EzK2HWm1ygqJ2GfDvNQmJW0HZbZ2M9+1AzTSrr\njiaOUGJYUKN8YZRUJng2Ndkb+OR8MwVspMB8+OOANqG5eLnv3s2uvJ4nm6yI\nn/n0U/nxTsowxm3IkN5MBXzydaXElZlaSltNOOY9ay8QW8p1aGRzwVlI4Hmn\nsF2am+xdDGnAdCLKsH+A0VmqKmJsGqQ5ZYvfvmNGkdOkCtglnaqRtrE5oKeQ\niwV/6aPqleR+SLNWClOaDN6/kUugSMf7bE8wlIgQc50yiP9KlyrVNWfyK4h+\n1L+qXjcu0Oyf3DsZNMAq8ojmDsHumgXfOtUJu0dZZiEktAsc0NgmBV7YSWhP\n0hPxdf4ghey4hGwHiYTa+KX2gv+nDIGetWexd3tjxaV4NznWUGA8fCCUUqH2\nCW2vg3DSIYxP3HOIVz9vLIbNzLP48pnZ91UVU+wxvuGCWc78+qFpAZkLmwdW\n79l6\r\n=K2TC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"55cbb44268ebef4e1b6883404ea94fc188161b56","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-55cbb4-ke3xdbfe_1597995705577_0.5468412865621535","host":"s3://npm-registry-packages"}},"1.1.0-feature-034a5f-ke483xm5":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-034a5f-ke483xm5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-034a5f-ke483xm5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"97b6c42dd18717d8c1bdeced89aac993b7444bb7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-034a5f-ke483xm5.tgz","fileCount":638,"integrity":"sha512-h89sJ9aL0iXtzJWzWFxAgu6y/ia3HbDtuDgPk5cXg6H19grGACTCMDt4G7Rj1pq5ADJX/wQFopljpZ1aVKjNBw==","signatures":[{"sig":"MEUCIES8DSZPWLKL9NUT21LOWSjACqFeVk900+b4AaOBMDC9AiEAvJYdmMZMxItsYT/nGYqxV/M3uPI4rJELj1zs6rtQ0Rc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":654857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP8EzCRA9TVsSAnZWagAADyIP/imWko1W+ZFwiVRChsz+\n27gNNDKRZ36AfmTxt9l6YbRpf5I9G2pLFi6Z6gm2ica+uXgBe9Ch/ObBCYUf\noSKQq5NuTt1URpGIjr7iF6yIrn7eq0cUqXKL2+60wotMZzjT92+ip+no/B4Q\nrkLwbL7RVUaWu7Uu3gWxcNLzoXf+/N1qRsPi713ll0LQ7EdsXc1iuqyENYmb\nuv/CwvQVVwoLZyJaRVR7LIOQU3FmVuAkMgxxCaKhQPiJp4BqPiGZeuAv0ek6\nV9/T2AvsMfMJrv8RxkVqPR4C5UpUgOtg5FFzlwk79i4+eKl7u2yhL7TSAazn\nqWFUGBMJGnb91keScjrXm76UMgn5SFhIpox2ieDkHJw3k2DmeGrjRQU0ypzP\nNidod7aMYDTQxBQkSPtNFD55wSGbcuGxCZHv4rYG1KkpayC1YndMYipd6c0b\n10t7oUCTzgg4aqG0S8KyRzFcbsgYEcPwzm1UWkzBDqq3ryr83oqmS50JGnYi\n0XSDz1FqwLuwvdsqr1WDC39HNbPxzQRSwBE7bLQt5f+PmoixKbT3gLnfdAFd\nrXtoZAKAKQz92TfLRXlT7NLX3QEugd+uVsaKIt+pfsvRaEoibUl+RAuk9iq9\nyiHO843RfixQOxUyuSjoX1rRbQYJ4epJvR1nbwZKNwaX6Y6xvMush3hnW4vz\nvylS\r\n=9L84\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"034a5fc13baca2da9ed177c6de167e4c2271c3c8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-034a5f-ke483xm5_1598013746640_0.6126455355526785","host":"s3://npm-registry-packages"}},"1.1.0-feature-3b0d13-ke49yxbc":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-3b0d13-ke49yxbc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-3b0d13-ke49yxbc","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"463e658807992badc1174a6be63b1db7b24d79b3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-3b0d13-ke49yxbc.tgz","fileCount":638,"integrity":"sha512-D3nHNe+/SFY+PehhGzKrSd/SsVeWVwVFwNwBX1EIx4JkPvvJjITILKMqGIsZjATq1ZoKP1wmDbN6Wd6hI0tbHQ==","signatures":[{"sig":"MEQCIEroi2EljvfmfH64QaDxxAgYnyEohsO6yUGiR3NNVuodAiBaEprVb/o/NCamck+kUHkruOm8vZa6cmk9AO3smGKf3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":655486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP81nCRA9TVsSAnZWagAA4toQAJ/GS1Fr3m+X91JflQKI\nqKXgwBEUn+YVwONjxpSpAPtYoRN+NqFbXjr6I/Mzadmw2qbFKx93AJpvhKcW\nYW6/sH9FP1lOaheh66UVPbjfVHv4d5vdXDiDjU0x1Jv7oSAdMkT3a7E9hHhz\nlDKTaT6oQUYMpUA/oURwVnNBTZQJ83t+fRxMiqWH/y+NCuIzeGw9o/Ir/tec\ntQBKy15lJhoRwpwxHJ4W/w3ifMWGK5nQVTc9FwP+Wl2soLwPBn3Q9DsyGqRO\nv8XbMm+2zK8OupZQrJ3aLnmiwN7x0vrfX3xAQTnDGjoTEDkJ94aIkSUolKn7\nuhhQJ/Mn8sZAwHX06PgEDyBpulNUlK+PLFZF9EnTJNnv/+jxSinhLzwoPxUq\n/ovum7NIgLJ4++z8V0klPT7M3NefPoOprcbnY3Sv19ivc0Ixb6otUNw1c9Qi\nO46HRE+YGVTcaWZNUx9eei23pgo7BeS1zfwwmzkILNMeClXF43fdtHbqsyGB\nOxGgSC7ZCp8e9wzVXUCtI+eCbG6+pi8ocDFUdnrhpw9Vvt2321RR0J3PER2y\n44OaU6autyy4rIecuzDeWrsjommtEvGUdkE0E6DfzyheajUZ6XED8d15I649\nU8H3chOqjkdMPa5BrSS6h34YWIYRY933kcXwwsHdTNZcJv6c3/oxqE3egYIr\nXL37\r\n=+QEj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3b0d1391c1d1b0630e8404a2ce570ac8b0d373c7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-3b0d13-ke49yxbc_1598016870532_0.9504593612506802","host":"s3://npm-registry-packages"}},"1.1.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.4","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"97030fa5c035b8164cc5289e4ca3d74cfd1ba110","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.4.tgz","fileCount":613,"integrity":"sha512-xlWHhVcU/pZh10vZHw08NvsMN6Eyom50CEK2Pm2rX/txBPrdpnlkW3sCQ8d7mc77ryo/9zyHaUpQn2eHUOZIAA==","signatures":[{"sig":"MEUCIQDxGWMumoXpLHTcItyR3HimI6GAnsnOvoyvI48Z7tma+gIgN+jiO79kPH/RnP5aVnB03DbIsm+fQPzKyKIAjR0R1Ow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP9sqCRA9TVsSAnZWagAASy4QAIseg54tC8BYJTu1BjOh\nArm+Zw27+GSqkRqCSnWwtfvBWPCdZQuzuWTWkf6ulI6kgdkX8mYcuf3GBgi6\nnKNbR6mDobNTlEzc6JkZcjwDok9kW0FPSOFKQBOvnqawl+C/GMfUjOrhzOvq\nxYita7C+Z2rLP3zcav45H/YoL1U1r4Gwr0iDduRoz5Iu6S4uD0Z+rCJwpDi0\nOSYZKP2NXH81beTz6inVLdW0n/TXmSPB8CjlcZ8L5VZRcW4eKs7eXMz3xG3y\nOE63rvinK9eehO9UZQvU87q5R6cxkTiK9u7vcv+5bdfWjzh/p7WZXhghbMPb\nTVUZI4DWefa0cO3WQ3VJW4TzFF4CXLvb595NJR9DqxxfN8iF+OlflvLLra5T\nGaPY3TUZVOhtpCbdjYHaZb0+cEFVg+d7pyXU5rm7yD/IYxeHWiEHXhsf0i8f\nAuCkPnxyhjl5omBr/ify9a9CC1xxTrOrzJa/j5bnESIidp/q9vNYSvWkLjie\nXj/2DqmeW3Rt2GBl0sCYcSWwWuhbaxBgn96Rgb60XtwjtZn6o+zBxiB8zYak\nqUXs0VMQL/61OehGfcOPgVZNKvZhNz0j69z/6Y2lI1v8bvYoud4LuiwiM9+v\nWcuP4MNef/R85kdxSK5k8tMrtXkPVpv6YPbr0Iu8zltS2CrbNDCIL7AvPuGd\nJiyp\r\n=+qtT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3a79e1d8ed76aa28ca57f7fb5df5983833172e3c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.4_1598020394016_0.7262142969599275","host":"s3://npm-registry-packages"}},"1.1.0-feature-5ccd3c-ke4dlxwu":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-5ccd3c-ke4dlxwu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-5ccd3c-ke4dlxwu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b1da69419d2faa0cc6fc6df3305f211582b883e0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-5ccd3c-ke4dlxwu.tgz","fileCount":638,"integrity":"sha512-G18JxRoOIF7ZCu/L4MkfzbSaRbvMW1TbwvEJ2yT1tn+zFcgG8lKpedjxbMyFybPfJ8Fp+E9cEAwdhpm/5yRBwA==","signatures":[{"sig":"MEQCIHEIrhqPkIlhVulJl5Ot0/+Zm0os4S0nf4zI75qkV4y1AiBpAxNP37ByQVaMzUFxRMwPDrUqyIjFGp5kYKfx6w9Nmw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":655856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+VMCRA9TVsSAnZWagAAXkAP/3lIZTlqhy+xqc9fU5eD\nMHREVzIJdwULFDIrD4gsLREmaGje1u93X3rsMTlOCVsI8lD652bm9uz79cel\nVvc5VqA9OylMh6176LWNefMh//mNRqDFA3Bbw8Dv+Rwb1hQIYuF/Sm1QCPZ4\nAMUenlL26I6mvIMC2oXDCAGV4cvkLXjepKqntTNraOTBQJcDL0UU3p3OHm4u\npVK1fPZyIhNPx3IjBo2X0M094MYgub2iVgcZudsZnC58c028moKEKZNnJmCB\npbAKR3n0KwEPZThjuL56cvUcMK8x64o0INo7xTMOQgf0u/veUQZkrjXXHXFG\npaAkXWIzMSJuFHmdU0+KLmJ37meVyYYdxSLE5xViF4ByanC++Ky3D9hnrlLW\nVTL9RRkV6sRWK07fXbOCzvoLBDBUoAUpbN+yE72lvMlSfizgDq8sOY+g/mTs\nZcN9NaxvGwk7RfDAtjLKpRpfsaBQxbAyA8Lk8AvUlOisXyAuND4BHd27KD1G\ngThMyMO6r43WapAUJOeS2PNFsdcUllVibcqrNxy6AD7kB8HV2ex7d22na1iI\nSjtwBNKBI/0gtBYowocZqwNFQ9vlU5DYo5GxZZh46W0nrYxUtyOO4BZwZwPo\nubcjECn0O6J/EJIdRY+zokZUurm71YPxnT/eGCKgWQgvXL1MAFU7eyvHY4Qg\ny524\r\n=j4SE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5ccd3c11a35cca198a9d8dae6713abd4d03da8f9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-5ccd3c-ke4dlxwu_1598022987718_0.8820980814999215","host":"s3://npm-registry-packages"}},"1.1.0-feature-66ee12-ke87hcd5":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-66ee12-ke87hcd5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-66ee12-ke87hcd5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b6c26323758b4199737e85537f803497732bd545","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-66ee12-ke87hcd5.tgz","fileCount":613,"integrity":"sha512-hzpQbHon17FcnDdHsvxy8+YJSSTgB086aBjOwXDHAmiiZ97kFHkhB2vMdxiLuZCAGWdkXrQLhOrtgRBrkmfOjA==","signatures":[{"sig":"MEUCIQCcw90pHKQq6qrJ9EhJ8SEb/S0yEod61Q33pSEQF7yxVwIgMQAkVPdISZKqaCJaSu+l24FNhDYP7v4aeL2C7ojTLzM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ23YCRA9TVsSAnZWagAAjIAP/1nTKqx3hoDuzNS9C4bS\nxkg4QIoUlJdKTVYtKck6AIcw6dHgtwZz3VUV4ae1etz8QOqm2/sSun/bTZvV\nnM1AGgmqTtR4UKWxFVUXm+NIvZ2pWGun4baZ/nkRaOoFVuYQb3yeObt6MPaM\ndqXghrRhVPGJLaDVjEs3Xc2ncJ6PgfjaLWOWyeLkWn089QQBJ06nCDcVMdq3\nDGFgJ6yrfF+/bAUo0xpFltM5X7vHx+/mXXPqOOsRKFB8feRyMs1UdXcpHCi6\nO0/HGqHHJ/OiTmjsINkDEnBCTplokvv+HTMpA0q6WjT/bFXG3iHH5nxmhdsy\nc4FU6xH291efdFY3+E4ggdT3nG/Ozg95i7Tuq2FYs57K+gg5hCY3DF/iHXx5\nC2QSaDE+5U0WILh19k7DnPKARyzwBkfkXZ+7R4qK88frEgWqF9VX54o+cAp5\n/VsINI7EFvEjAQOqmC60lj0EbceQRqo93+qAnHVVWyq2k/CqaRK8oW0iWHIf\nEq1P/4lKFe6Ur/4O0speLtopAjK+iIhlm96OVc1N9bC0hGSxSxSO6mqODS2s\nENbrDWzL8xQi7ZntXErCLuwxvGgdZDg8IRI2QmOkieo+lC1eLBJl9vrljO3h\n++LNGcFbwO7ba9OzH65IZwdn3xHCZVmFO/uLnwd6AbcR1gta02fB18kF0q/0\nQMFz\r\n=iu+j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"66ee123ebe666040c62fb63b75085c1a644a2629","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-66ee12-ke87hcd5_1598254551933_0.17009321242372044","host":"s3://npm-registry-packages"}},"1.1.0-feature-968a64-ke87i5uu":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-968a64-ke87i5uu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-968a64-ke87i5uu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"648e338fb34ca049bc2cde95c9b0b993d63a7bfa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-968a64-ke87i5uu.tgz","fileCount":613,"integrity":"sha512-Hb66yYIDBU0uWeiOefVloZAqndcNIf030yP/Z6lUxelM8igihGpAVV2dgHz0kSeNOOPo0BJnMM1bt/fRAXMBWw==","signatures":[{"sig":"MEUCIQCeUQs6/6jXWRmrr3BaLHvYjuqjisH650gsg9n3YHSWHwIgR/A+gw+flGX0VqyU12ZwcD2NWhmQBgzlSDJxFDnbR0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ23/CRA9TVsSAnZWagAAV5EQAIVgm79NDK4JnXeyS3ay\nNUArDUHsL7u6iAy3QcWzQTHNevLUgFxMtcZBZBpoIq2WkEQUXEvhmP2usRQv\nttsQd7KkEE1TXbQZIaU0g7P2T2XMQb+CCwof4RQGatLkN3m/MROGb0meFrAI\nAVK9hAkZOstw07XeM7HJ2cGx4e8rpmqqh8+L8QAO5zKGC7zU/MX3LrWeX3GL\nuKue6+gDoYmDF3pC72lkgcFbT57GVv+gn2tQE7LsWzz/KfVCsF6e8qMFV9PU\nyqFRdfAEzcvnde6oHM/0HnMt4iMHSsXdn77yjtl+YrfiDQQVTsQ8JLqpRbEc\nwaYnNS6Bk/RengNHh9FgF5sA/IJiTdAfKbtvl0apth52r2Xfo9/J2gjLfUjd\nt6OE4v8nmWrWYUnna5RNnFtwqvq/LL4xgIUewLV4zGA0aWIEBwRhyrGpyQIu\nbGp7quJnXV4qXegyX5kPVnqfVVJHD4cXUNU9CUPxIxt0zdytyVhtsRGRjSpk\n1hTztH3Ocd8q3fpVOWWfVJbpfBpB5pTjkMEA22gL9c7EWXIB6JrDX05qyMlN\ni2KLfm0a85D8gumnR/KoH/HhCNnMjRubOhATegISabAaXbAb6PImtrF4xh5Q\ncSVsuTztfw5hOZ3zxbtP6EDTvA3fy5ofhbuEbjCZdaA6R3+8Dux1pRo9caeW\nxvga\r\n=9JPy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"968a648d8c03afd335d620d4ee03f8284e27add3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-968a64-ke87i5uu_1598254590695_0.44463013139146934","host":"s3://npm-registry-packages"}},"1.1.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4fdeff1bdedeaa1acbdad3fd7119d34566e0bc42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.5.tgz","fileCount":613,"integrity":"sha512-e/7CbiI5CTA4KhVqn/+oh0B6J6VPGeVDDoFkuFkmXLQ8z/PM+VbM7U34jNYCXcEh2e01/JXhVDx1Z3tJJ7YkVA==","signatures":[{"sig":"MEUCIQDKB9MNXVA/AzbkV4o+fjI3yfqbN2UtlN816ehvd+7OOQIgcTXo+F0MAvUOpN9eo1L/UUbCNyMg/S5+oDBfwuYWIBQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629463,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ26SCRA9TVsSAnZWagAAcW4P/113hJ4GTEKX7GncfmEt\nu2L4/sQSj4O9r9/oVm3BUdnx4qQr8HhjsckwmD4pLqZ3+wqsIWLMxaLJbV9R\nEXmgH+0ncpbX5FFzySVGlfghgKJBz9T1ciMDk8bCLwb6snOtko55U5mgcNGx\nPtmiyLc0g/nm5AccIxg6OLAat4Rt7VEPFMXcUifIfAL4o3GVEaRuPh75Uw2J\nPook9tHD0fXYgB8h+64NtTgbVR+WrM3hts6Gzs8C2cBTzTUMuie7wL37H+Xo\nDAW7QVaEbKqDnfz9wViBqoFJSAhTEUgP25GgsYxP45hbybWJXRe3aSZE9wNS\nlkwRgMHFAtD684mPAcpB5VCmuGoW1ctpkcFDercSMB9HXXTNxfTuYgECafXV\nqwrgQa2nQFFZJNf00TqE540e8ldw8H05ly+SJBgnmNtg9ZafvfPHs/9QtEGi\ncyxAQDggNaYLUzM3YfTAohT2BzaQlVXMpTfQsDkOn3kK+2qcFqwLiMw5lmPp\nodXBWyy700FZRbd+g+XUiN/8HGnAwEGcvhTxCV7ZwyBR/lLoRk/ZmfP6HvUu\nEnNFj/6U0sxg/HgefUZ+RvXfcl9pOuzIkf4a/lCkuXQVm/dSEUWHcMq5VhsH\njJ7oeL+RMESl0j5estYgz4j/MGYWomi8yu5iZx62Vrkt/Y7TSTCrG/xlaahz\njw7f\r\n=IIc1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ce5c74b4c7a6260d3d6bbe57e50888364e5bf07a","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.5_1598254738475_0.2921331709970003","host":"s3://npm-registry-packages"}},"1.1.0-feature-feb216-ke8bd3ld":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-feb216-ke8bd3ld","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-feb216-ke8bd3ld","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6b8a7a375ca7ded58f28d6c51d8aa9774c6fb128","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-feb216-ke8bd3ld.tgz","fileCount":638,"integrity":"sha512-kDZmH3PUWY1Ufesf6lf8yQ/UzqLaphdoMPDBzbOZBU1JvVZFfDys20q0bw3VZsLyk6rIlAEvc5WHPvl/5l0Ymg==","signatures":[{"sig":"MEUCID7NdGlkxHhLHydIh7P3UwZ1TrZHnGdWKloOGnm0w9r2AiEAnl1CYPH2c+VQaOJpwxCRsxSU1e5icxPdBQnA+y6cxwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":657030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ4dUCRA9TVsSAnZWagAAzNkP/1cW4Ygxr9rW51zD2cR+\nNpORHhrTtrjDKuax5iPHNvlddXdy7gVU790vF7A1G9CPT5tE/DOjC1fyoTsq\nHAH/oejAFUc9LQWqHz4Iy4ODkILOPWUCr+RqoXpRcjTD7F/6zzYJ7tH5Irop\nbKyrs9FSlfmy8j1zfsSofhyDtAdReirVM9c2keiyjGmEPk9WOCqJyoBzw1qJ\nUemzyBMpAx+PZgu2j0UBQJAY8JGP6S7dHb5pHBl9IovPYaFF0W6gsCAq3NwS\nVehMD5HhDzGDY8bb0VwC3xWVSaKaBeGdwXTZvxPB6RidcZb27UEByP1S8zCk\nH+vnEiGH8eG7bzx23wTa5rGW+hCmRQAcXg3icb9R63kaPfUUNbLLZjEDSU3G\nE5dCDoMWbo3wf4fSUDTShbiZstLkBvujOUqrJqjo091fQhw42V/SBAI8d+LJ\nbXml0xloi5mP44EWqMVTGZFZ3USiG6bKoeG15t7+R5AhbAw+Q9jXKu/CIkGv\nUy6/ORvA5aWGwe5Jj/XOs3k4jqoOCXRrC5b52yMRmcExeuJcXn99Fo+chBiA\nDRE3/jPc4WoZrJnprOH6GyxOyVeS9SRAnzEIWjI9lRvWc25RterWTYWGRLB3\ndF2tghoe9DwSIzWhebtCmrrVDHpKb06gcmHhFfz4SxRgrWTjvfzvLyEqa8WH\n/h9j\r\n=0/Ds\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"feb216fe4412ba70c641a4bfe79bdfe2e0ad4d5f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-feb216-ke8bd3ld_1598261076171_0.43107073241030025","host":"s3://npm-registry-packages"}},"1.1.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.6","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8261e32c179799ca6aa9ed8bfbb35e4de840fe9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.6.tgz","fileCount":613,"integrity":"sha512-BWTsickpZG+OFGbcwH0A0yir+jdVgzBxgmX2hi0jb/kK9dBViwHRUdawMaJ9wt72CBqMsvEhyj/zDeSrilzdmw==","signatures":[{"sig":"MEYCIQD1vn843gDLsU5gj/X5bvrYqCnUq/kdoXdgrtQZ9DAgYAIhAJAmeQ4SE+6O6gLbaEdPPLhHnM9DqSL5IZcWyUg035sc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRRUyCRA9TVsSAnZWagAA/7kQAJBGKVBirhUZtqSUxfwg\nbM+ljORM2BEp4suzxzqJ84M0mrc9i9yWuIrE023mqSqep0hQWI1BL13OmGPH\nff6R8hd3nCpEAvi/UUUnBV3rJD0XccrQBFak5XWuwF4tg5ZvKVerwFIDP8Jy\nCh1Q7gCvGS0qHfHfdD4hRsxMuuDDqkmUbd1RY4hdG5COzoZviIqtmezzMQig\n1qhJyHgU3COMtMoUaUD31UZ3eg6TZUzjuQCE8DbrXCODOSr4+L5MM/BfTbr7\nEwWSToojmSu7tFoeOLl8soKkX/KasauV97jfAZaMmRtB4ioTiDd4DaEjYBbh\nnEBI9wBEw1Qy3mr7Icu29RbQcHje5YsBa/sstjyLp3T19ZkUulEvI0VeA+mf\nNedOtOSX4QjsRnN7r2YeIXD7084Dq5DlvWcrat3e//rPQK0MJphMkOJCQ2wN\nqevqu+6gkLIU7aegrfi+IGCZhEuezl8m8wH2hguIIfw/PSLNXFBEsHFDAz4E\n5kloUDA84Acr/WIxu2m3kf+9b1oaYoUdVKQvPSAQxVoBn2vWIVM+GKDsuF2y\n0yLyrbMPk/tz3uVl5lAH671yEpxfjVlUyndDaRSOh2Qxwj+9ythnjxwae2tN\n2+3tff78hYQQRuwiqnVZObvSMWEkfjHKWDA16GQRS3O8detHOfQIEILUiA8T\nDoWx\r\n=BGwg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7e5186442f0a57529c22c3882a5ca1825984a224","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.6","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.6_1598362929503_0.3488678244242518","host":"s3://npm-registry-packages"}},"1.1.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-beta.2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"79cb7d0623d704508aa5c642c5f97592558755e8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-beta.2.tgz","fileCount":613,"integrity":"sha512-HNmypKZT5gDHpfyxR0WSjNrZNd75xgss5hfPujb34Gpwvr/dgfIgSHO/pCnnYIf+wBmdiRrFOcmfb/v+ooJo1Q==","signatures":[{"sig":"MEQCIHSnI/O8M7sbciN3yzmO2vmKguDGxCU+HSNF3ISRvPzfAiAQhUIqQu01C05u0DnP1ExYShcsF3CGf1g+YnV7DZD+aA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRhCUCRA9TVsSAnZWagAAHOsP/3OE3dtwFF7R16kjXOrV\ner3nNKGAof62ETZVkfV/tZNb7a/7RpCmTOQlQo6PQrjd2b37457eM1wbmcC0\nhYD1fbo+HaH4j8lEj3WIBUHckkPDvIIyVQw9mBi/j18NWZdIDgkOtjaoC7B/\nbBVk8RhOn4SNAU7i6EsNokPq23Ro/5xYsRv+Jx3TYvYkm3+u+rETI86UUbxS\nKMa7l81nGknl6BOUEqKWg0OkebgxKDANkgl32LmzgBUmrny/FVCFjLm9NRGy\nyRww7XI5LKdPYc1h7DPBFnm4/kKRppM3oswlLpn2XFGqrgWs7fb+4/8Lw+lJ\nIg/QLJIByqK3xNxbOVU8Im9zl2MyKejZorXslJWzlBN7WT4KtHL/Q45y3EWo\n/ek67SEyOgfOB5i0U70ir1Fd8QeBgZK+9lLtu3pQBMvagdvIj9IYbx4t78Kj\nKlPTITav/qDwC1cyP7i4ASzEHCFpkL9qB3P4gFAkTDmf74Bg6Zdd6G1iZ7FZ\nZu8oM6+QgUH4v8R5P7Fxr+Sh+K5QzPjBUkgN19XTbqgIfHAZcVMHmg+fFUXq\nbIc60Lx3sXVU07kZVv6PAZBuhA3M3ONa3N2X8OGepgFG1eNcitoK/SAN5r+q\n1I5xJdOiMDDfEfgI0UmwJ1CFOjPoFGGOlHbop+wQjS4eHlzfo9U7F1jH8/iQ\n5C2q\r\n=hBvV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a8a7687cc24e7efa3e1982a87836401a332245f5","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.3","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-beta.2_1598427284500_0.06205271195702178","host":"s3://npm-registry-packages"}},"1.1.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-alpha.7","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"567a422bd132ce74bfc292f7c93947c39f28e063","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-alpha.7.tgz","fileCount":613,"integrity":"sha512-pP7PG8uO1dNXECvvTU5ZDJi4HipiaQsP9gXbZWIjBu5y6o5DFTpVidu6X+BJ90Zn4tbRRFQgcRiI2ARrbQjU6Q==","signatures":[{"sig":"MEUCIAaJ4gRt/CQUUrLeaKhfK4WWl4BV+HB4d+RFRd0QYk0aAiEAj7xNcgdozy4zQHOJewWpTbg6m54SZBoVuyp+7TjydKk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRhD6CRA9TVsSAnZWagAA0TEP/RGtTQQ4/2PhF2zGjnmy\n9/wPi2TcQ/WPEl2HVdZ30zfRXSXPTW7Nq+dpaDhSrFsJ4u6ZQLHxTAFtvb+0\nPdB/nXczdCu8HYjzVb2vS5T8Sq34Rf8Z2GfNfs/wAiEZ6XQeosT8Bn2sHhj0\nerLAY7krgQs8RLjGZPVQLbGNA9PfoonIMyEwUYQ1sXaO6Fvqn+LuXsB1agMu\nYG97dacY3v+DIbW1bgh8XFLYA+rALLp2gDb/1ugrz6tAsO+kADh79J0ahFmg\nYo5ikKRqUUmj8zahLxdb6CcQ0GUiIuk1TT3UcEHgEqWU3zf9Z0DEJsRfSDAj\nGuBpbymvzyBjgG6HCBzzcilM4rjOvn93UaSP934KkHoHtUZOu5A9RNq5jKZB\ne3XMpU/RmZdVl5gsWLEm5sBCeGUiJYckPA4Zeeu/hqwhkiUiqyNF4PXxWGIx\nAMBQzf5q0AAAgDeYP/LspDF0y7f9J4eUkClxPn1Jz4ftV2xqxBQZwhXQX6lq\nidFtWr811ZppabL7LQ9bFXxL7XAOpiUGj23ztODSRdbDEFViNNlXdgqUtZ+W\nmbhMQ1/wtgdrUgCMeYlJd8mlBSs5ejoixQiiUmH6UFF9ojZp1ZxTtSi+CfTy\n8f1MJbglgpQJy/cWoIZ60eMhWkzLRJkZ3P03iiVCFnx/goIkn2S3dRYhz4fV\nMtQC\r\n=SoLI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f6b5179952b8b767245bba458cdae6a7d72cee4b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-beta.3","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-alpha.7_1598427386135_0.8430700479752398","host":"s3://npm-registry-packages"}},"1.1.0-feature-611790-kei8twgu":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-611790-kei8twgu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-611790-kei8twgu","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"22c33f254fa7845f5d8224ebdff52a38f9fe497e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-611790-kei8twgu.tgz","fileCount":628,"integrity":"sha512-UMirqQfGvgNlt0yZeEFBw3KJreJwaL5OmBNy0LsTY3fq6Nau9zbuni3yAI34hCjj4i1YUX8PPabfgo/W+oRORg==","signatures":[{"sig":"MEYCIQCqEmCm6kAabASxEVgFwKxIS4h9/wlg9TVYC/ebBUBqiwIhAJ7L/GMY4Y6pXsK+WGQ5+/YvrRWgU1diM+IWA9TISuWf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":647386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTLCqCRA9TVsSAnZWagAAuBcP/jx2+zmKgZ/cfi7b7Bo0\nNLIEjQRg+quEDJ6yQsvkmpSdHFE4RvkZPb6bKoxRFERwmRoO2Byxc3OWxJih\ni86vcRQuRwgjtsTF+B4i68e/+BfhXUEVInx6ntJ0I9hDW7sAklHYTV1AWZfQ\nZPdhwRjWv2VJjgDfm8243OM9SRRO/3q565z73EcWiXIzodvWIoP9pWdfbWrr\nULAlOoUR6Wqv2a3haQiaiy50Pdr3mFwG5Kl86k4T5w4KEY8ux91KroWpGh3H\nosHVUx0QTBtQwtM6c+WkjJiuzdf2h+FVcyqjSMgVHyv61XQrKb/d7ldEO5Yc\nCPi/OPdyIgTukwL7vK4kANPtshhFa5VfsKOqDlgpqtNJOfqOagrNr7LjWQ4E\nvxNvDMVZPZJ8YFKoNjLGmcKCIiKrNGiRt8Wy9jHBH96wQR6K2QC9lb1P0jrf\nx6XXlbOPrFQ73EDYJ6SXwEq5wIrkkZj8Tum6f5pzhULi1lNl8+EmOQiOF4d3\nrjcxrbBKvSwECjSl9d56SvVS2q8L/oZsQMC0bmCDhqaH4RBa4QC/mtO4YgIa\nkHe7yuHC51dNs2HK8AGRHHMwyZCYSjrjP/fPk7/5c7V3sUXqGj5BYhI2Qj9k\nImVZLTsWqwEFn1pyIVTXjhm2pn/NObU4J3zWvYG6s4ppSaGikh0hkdfptMmR\ny1OM\r\n=gkdq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6117903f9867de6e7f78501cb3bdd5b8d01d06af","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.1.0-alpha.5","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-611790-kei8twgu_1598861481832_0.32505676328461286","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"36267b1537b519d72b26f4bcd486c10348fc5505","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0.tgz","fileCount":613,"integrity":"sha512-f8LyQHAxEHdDtUNRswiGAYOBJ7Rcbrilvr6PDLQBWOXG8k3evKRLn/KsLsFYw1yaPyElKVIWDGOyu2vG3ti9Ew==","signatures":[{"sig":"MEUCICstnreA0pEVMxi3//pL3b13pNdi1p/bkvivuufABWJiAiEAqki251NtvX/KZI3VOnFV+kzLJUhV+ixdBHLkvJvr+hY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT146CRA9TVsSAnZWagAAj28P/idsGDQmAHu1yg3zLWFb\nVM4+ZkS7CAS9BOc+kG9kSR39jBBTOVBi/5cahiTXf3QUx6pJDaVNa9nMD+0N\nxs6wyQC8r4F8BOvO31bfvSGJqfuqHxyMGOd2gDw7e9xnmX3E21VAJbDRXexz\nkCptH33/6eCbRixRsO5k/340Ccpu3mtcFsOZ2wyil7nFBC21gbL2P4bu3SY9\n5Yv/A8z8jL0qRrT2W7iWdZuUskshG0P49V4R/I0DigP2v/kYinZbEeo1soJq\n5p/TtO9en3O50w45UsXin9zXooNzufdJzMLWSqpTedLW6O0TYmA252aK0gZk\n6vYBz4fjFxa4/T1wy8UGLDgC5dWsljy0gaa9+ycGzz7UmxmaE1aCPiStSgdD\nMdhXgvkx2dwM6G0bxcLJwPBe32Fc5uloBB43skvQYhg1MUu9GHLLgzzoAt+z\nkqlZHUu4LTyMVPRr5HNsxuw19Bvvr3rYhA15ZSbpV2/CVYoB/mKT9aq2jn4L\nPCZyhdKRlVKyJFUHZenFrZOlD/2DH4EvykLM+8JcXoyKOUYW1s/8uuFHb0yY\n2+U0At+8MBiqeAGj0rqjrVL0XC2VDIS2512TRNGLr3xKsovLCxRsJbKwFczH\nyMVpbEwVkCqP+9aZIstLgOHWB6xNJAJWTPnGevRd5+e9cVay9e99tXo7LbWq\nHMP7\r\n=aJNf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"b6e19f9205c421090b87215c87393d8ecf8edcd4","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0_1599036986096_0.04977476068007869","host":"s3://npm-registry-packages"}},"1.1.0-feature-4202a4-kel7bqk2":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-4202a4-kel7bqk2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-4202a4-kel7bqk2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ce4b58fcaa238e6014d99f73d9d428de46dc7155","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-4202a4-kel7bqk2.tgz","fileCount":628,"integrity":"sha512-+KmG7pYrRXHduo8dGka/QE45QikBUO9qWbXFdSJbCeZEldo06fgLpScuuqIPBtJ+KL7GxEwyEI+7r3IX4TNWvg==","signatures":[{"sig":"MEUCIHfwxNmJvAPECEvwHrOWdNb0rQvNgFv7glsqdrp3YRkqAiEArQevqsaztXyW2q3bLlvIiYM/2SZ2/UCvuISAUzVtl0I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":647840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT2tiCRA9TVsSAnZWagAA93IQAIHaYz8GVJP4+ztzRkVd\n3Kxg/600U4DtAJ+UU9JivgtDwojBsvj7dtzaLzQQA/4TVHJXV/+ezaGZBkvl\nArOkoUSGWa5a8/VzdrbAHIiImrZJtSjhZ6D1yvqsfjVHOoBEgpIFg37TTORo\ns8uej8/XrJCdhVGoRblBwYabdcp37E/kxBNvIQknIV5uqNoCDW/Jip+kz1BB\nUs5xNzxzD61WDcOzXfpoz8J01b9WvRpvq54lahvtVICt4NtFNuKl08Z4x7c+\n9AMPNIYRHzCLO1TSSA4tNShMFnihSxoLVeEdcadzGSbXo6s+jyoQfJoqSTAe\nsafcJ8RLnRByIjCVOFq0xdyqaJI4esFoNFyt5aqn006Gzb25p84JI7F6kDmU\n8UTKiXoBH24+ZtcIEyunIz3r/BXDSQKSzWKKJKyGI4XYAKHU58E6BhvqE+e2\nV+GR3mph5G3WPPrlGAB+FPq9EPObLaY5y/DvudXlHJaAglxSp27OhTfSHNHk\nTMXPZAlARWcHfrnhsmkFcA7+8Fpttty76yqg6ypq24Hr8SVzfEDq8N8GkPfx\ny6FudF9jsha/hQEq8gQVQJpXEvHvWpSuvSXS53ba7iCSGOe1tkv3FMxCjIO6\nesGk4bt0gRuxag3xMs+MWw9WXzzkahzhjRFt7Ptz55kz25ufnr66J1FT5hej\n3BI8\r\n=Oa2u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4202a428526e945677a6d5f4a8a749737fe8ad78","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-4202a4-kel7bqk2_1599040353878_0.523587071319086","host":"s3://npm-registry-packages"}},"1.1.0-feature-d9b11d-kemu91ut":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-d9b11d-kemu91ut","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-d9b11d-kemu91ut","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d64200c5b8b8f557e073e1d8eb5ce32aa4d2e2ba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-d9b11d-kemu91ut.tgz","fileCount":613,"integrity":"sha512-MkLlV08kYnuoOlyOTSXm2EUST8oPR326ZnYuPFhXW9hPtaGwaCiwsMbb8y0B0mZH54AIdoaYMvA+VwLEJTLGIg==","signatures":[{"sig":"MEYCIQDq1rusCXBQNXDSpV0FsybqvKjWtoDAG2RNvYi0HeaMzQIhALMm9OhMdz7Pg2NI0RuLvzlnsdGpo34W9krl1AngIGPe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":630332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUO3/CRA9TVsSAnZWagAABSYP+gJei09FHJE4yhkrZ+fo\npohuiDuppkaVqV0swtzqqO64L5/jmW9oCq4o19/LBchShrJ6tca3W81/EFNO\ndVAnRflSyTCsTfoYwgtV4tanUYV+f4qI/aYQHBFbKpcolzfxU/Z5zwD58pSf\njnL/59Q7qFursn5kHmRVUZllk+igyQp8K2ucms/f0YZimwV51zzWvk0YDMmY\nRVQm2ClDjmgwFijj/L37L+TsxScxpRQ9pPQ4X2i5eu8RumZlK3Ylld9brOty\n5yesDXHFP6Xn5QKMZmHyo7jaqi9eOb+zgy5JF0JzCayIZz/VvHV2sBQzvoYJ\nzZwt/K9ic8fcTQCeS5GXYsTKBC5kfJKpQ3wL/KrFB45f4V1JEV/OTj1V7LUq\ngoaFv3oW7YJVWzYdIQNzpwcvdOlfsZX1MbFHRsX07T4uQwzlZjiRe1sbsgjy\n/bTNTqr/ozjsUR3kyeaN72gtnsTwGSeagnTp1FltOujKxuczUZScHGJmabHV\nYH+FTR3kqZPc/18qk2kkQJphEKbyPrVlojE0INH99D3d4jLiLeCm0R9a4IyQ\n5yBmaHNBNB2RiwPnt6XKxnpM0vfAnFmxe7aExgh6dKlxxOPU0z7xmF6wiq2w\nUQPKiyO+IXD5DkMQ4GY1POAvMHW3YH7kipdVtnqQ+YyO3dO9AvH5KGOegNlV\nDeQJ\r\n=wZW7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d9b11de5c2933262895cf0f6ec7478712519a2e0","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-d9b11d-kemu91ut_1599139326904_0.8286969004992548","host":"s3://npm-registry-packages"}},"1.2.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.1","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4c9919c0995c6141f67f3898a3ebf1b0874d3928","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.1.tgz","fileCount":613,"integrity":"sha512-wa/0bVKAsq4Pd/UJLx/GE1Neto7k2bbpLtWQ7gD7k6ok//QZ9Htmq5Us1h6BbYGUVe8X9idDzCBsvA5Dabs2MQ==","signatures":[{"sig":"MEYCIQCn9s762hYheLqxknnLigQ7OYFnYfY6AWDZOELlSHozggIhAP0oqwGiuX0Q3oH00f5vM2W2mHzh7aGKxlTfc4/V8p2T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPQ/CRA9TVsSAnZWagAAMOMQAIo0ILNewN1Ss1B0qFel\nvH/T1XSQmGP+ev1F7wMMP0Vw2bD6d8lYrh8UK55blOyl/Gh+GVh08ytokdU/\nafpOaIRlFQjFz56jQnLFYm+6LWUyE8+XYy+qBxnYwh3ZwLuy7hNjtopu8WNM\nrmcRCF0Gcs/0IfSRVmG3dOnI4/n7S8vkCs+YaTbfHzPSQpglN3wpQfbeMryI\nAyREaWpuTmIq3EvbvNvnSbDwmVlSMPXBRcLPTI93t2pDKsSFtpnMwfYvBwVu\nYNv+NZnHnzl6U00V1doEJpicPiFZKW/BsHiYnvnSJKD1dCZowHP7jkHpUiOn\naOuVA4F8GCh2tl+NOjvaqYQ4qLyHvHE36XOiLZH3J4pKuqaO1/3/FsawnrZX\neXLuXdYFFPz5kBmL3uJ8EDBUdJ5uEFSqHJMcPkYYTsARcNwlZYrsRnf61lAq\nVnjhYNogp8LhEewi4ldfUGIVfBKSGv/4utIHcyFWKv0sKkXzmFfBRya0wUdS\nhzYofsN4ISN4L6aLqP9Q0RAjZrTRafJvT8bWTju01quZUND0EJoGg2QxXeVt\n0+usvv+fecMdUisryaUSGXGyGm7C8pWsj+QV9AyIwIJf3BwfnLf+4TKPpsGg\nywmsBxuM/YcEKgbxb89svzvYUK6b37HrjFZeanht28ZWg2ABeKT/hFuFQDAz\n4Ti1\r\n=J4Q7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ae5525a43c89af91cc2b155988e2902049cfc33c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.1_1599140927241_0.17167934882905","host":"s3://npm-registry-packages"}},"1.2.0-feature-2929ed-kemv9mqi":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-2929ed-kemv9mqi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-2929ed-kemv9mqi","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1cad359ef11baeb52533586c10d3b6bcc78e8a78","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-2929ed-kemv9mqi.tgz","fileCount":613,"integrity":"sha512-mjLxGG/jdt/6dXDC+5JIKIJ9Dtut+0VSLOVIGEqqJglb6ZM0AR/dAPyU6ZxImu5Xtqk6aLMwRHT7cxWwu2z78A==","signatures":[{"sig":"MEUCIHbpA/ZTY7jNtAkT9drPifLe4ecP/09G1AdaUo/pq//WAiEAsuJgpgcxyOy1lVddWWpKK0v/84zx2zAjQ/flcjfGeLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":630332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPSqCRA9TVsSAnZWagAA0xQP/R5OK77JGz9JGyVhTCAV\nmTdkMHwlXBjjcpOK0r5F+ch8R5ibYwhOIBfxreDN27qppSC8l57cxL0hiu0t\nCgJl7B9Ng/3RGW+eSQ9AeQT+uS8y5MlTs/RYrmf08hsFKL2TD36f3X+GNpbf\nNy7jHIbTydiBnbOeaZSKlrTeIw0x/ZsXm6tIVWmMlvpDus1Jxx8chFb41CTW\nB8YDDgOgT/4QpOAZLoL0yHPeSSmWRqxnmkUZNIGV9X2ssUvxX1EZRNrrC6Gn\nDZiVefo2P/4I/UJfFttsEgd5cKil0m7WG9I3AxwXZRW/qFDPGQxb6Z0dETYj\nyudZxDT7nMvT4aNvLUYUOhSkLHfppyWprCoJOdn1UW60mg7ue1gs0igBX86g\ntZx0XduShri+pVtNYxmhOlHTO5tWB/LHhPyXC3xHH01PTsodaSMeIfvQNia9\nb9Tx2qTqPBnLf69k/dAZKnMMZnHUvyarbSrnUogXh1rItT4mHUxZsO+Co2NX\nnOu4xZudR8ng6V/PXRDZ/PKy2Wa4xXakoqc3oZ1sbi2EPh+2NWNd1GCoBg7S\nHf93110H/Ogd8yg30+YX10s3ZEVi7f+RIPRAZJmy8cFmw7hx+SUaYDr4K6Wo\nu9uuRUB1EVVOMIyhaBTRAWEECJMq3S1ZE+n3bEY5VGbjeKvxDtYM3SKUJaLp\nRrJx\r\n=EHCU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2929edeb0e8bb1657d0527745fcefe66ef88f5d4","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-2929ed-kemv9mqi_1599141033641_0.34821884981629814","host":"s3://npm-registry-packages"}},"1.2.0-feature-d33bc3-kemvcdus":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-d33bc3-kemvcdus","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-d33bc3-kemvcdus","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fd8106a9e83764e5c1a471c12df47609b8cd4eb8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-d33bc3-kemvcdus.tgz","fileCount":613,"integrity":"sha512-M4Ji/kl2xHWtUuxwIgqmRABcEwZNauE4TPYsgtACPh66YIc3XZT8CZT8Hvdw5lg1zyf7jKKAHLWOLuJ7luwkkw==","signatures":[{"sig":"MEUCICdwITOJ4qWxQ3FrEF7fO+HLkqcSqQSLnSxnPYbRycQ0AiEAs8pl7QttLrveR+V3wrOd1YJGmxFzh2WwsyCVwT403no=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":630197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPUnCRA9TVsSAnZWagAA5BEQAJM2oJ2Pf2dvzKi57EnU\nCUgXVAhAl55LDO2bhsO3kRyKHZyWSdeWQJin9oI7XbnLH1ke49cRt4bXnshd\ncnsgFMks5VKbTrWto0ceo2Y+iV7R4ugEuWOyeIl987lwreUW5O9TSeonLWn2\nA32vtX5WgTlN6vVHnIiv5O2XHXvXUT0H57BMK1sB31PcDcJctyElHgNHvYmZ\ncJ/OUGb9s68cUBiDsoUbeEpKohE4ahSXzT4kbTnoNcSNYnP3h2fMkmbVl/M4\nqgeL8N52ZNVlebz1HnVlc8iwv7g/Z40WW8IgpVwYmAKWhM6BGJr4eU4MduWZ\nO4STLXIC/U9alhpC/ISGmqwI9/q4ZUUl1x0Wgi6Jcrhc3c8F/YLHtgfhzt/N\nlCBK34X9NfBrasqNXiRqd0K9jyhIgl/3wfj7ZLPyPLet3K/fNYysm9D2Mt+U\nfUFBGwRTcCNfYwTeA7QJqBc0RWK0DxAl1sErN21g/7oIBJbR6dPnJi2R24+E\nCqlzfLg322B2q/ogkuGNR6FAtKeL2f9fBdVlHUS/lTPa+dd7mpvmdNSKK004\nWAU+Ji/BTfFx+S2kgWPqqwbA3bKZSHkQi72i2EPPLzyorOdrN4lVDTW75sFa\nILWW3e7HArM80RiTvLAemwKIOCWvDMrPJodiwjX4q5boEjuCDTJXl8raUgmC\nzw3c\r\n=m+Ge\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d33bc3a432301eac413c2f13a5851dbb52762ae6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-d33bc3-kemvcdus_1599141159429_0.27541449773686444","host":"s3://npm-registry-packages"}},"1.2.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.2","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4a665546a88c1d3027f7afb2e2645f7a18a1b486","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.2.tgz","fileCount":613,"integrity":"sha512-9pHUxMRPHM4O36XBGC4seMXPDf+/NeqM78J/ByJ5qrKPtwv/nKwx5aMhllv0J7mFDfJ8LIO6MqnSs76rP+mZ3g==","signatures":[{"sig":"MEYCIQDPPR8h+Phz79JpoasNRjgY75dvAFRnrmIGTrxBtn2p2QIhAMTSl7l5PyV2UDAvTqek+ADPFe7+clWaCs3IA18QuyIp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":630316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPcRCRA9TVsSAnZWagAA0nwQAJlQTroegJOzzFqhfL8X\nneMTbflIg3tPMPqEenH+IEj8B8uZrS1iuko4Ugy0uflg76qPXMDLC32GLDVo\nUGVQkkvWW2rUOg1V+K9PpzQjMzmZJPeFoTsHvqlY71lce9KaRhdnJPU21V67\nBj7d3lgEYKpLzhv7HwAwYKriOZNVCliE6aEKKnJAgy8YCUbng8lO1Ks3GM/z\njen0druE4/SDPKrLxGpFkeAc68FUpuNxqpT9fy08KJgNfxkTi1xWuVsmBDy+\nbG6PEON5mYea3y8i5sW/LBwdEYl92q9iVw7MlXqBknNPTqdF4CuBu8Y97WEV\nbp/OuO3XSVCtl5m5oiWZXbpZbozsPdzk9Embu68JwydFJ1PEoMVNFHMMeopS\nC416ejFQ2c/P+q1uODHcWfBRreaNXJQAOPASIwcvSwuoeqCugblwNn8IFRGi\nJiqkrj8b6tv23hs0QSyURzPcf3TNQDj12WpdC30djPtvduA9GPN7JOWWMCXr\nLZx00dYcdX3DhOKtF2iZaIzrNvjBxMmq/XJmlw4ESe4Bawqav2DkeazgeVcS\nGaG6Q1pntjuegrymX6KR7sFR88f5eQAlx24OhqntJz/lYrLp6ryVbepLNgA7\ns9pgWW6DQmLOSfRfnkdiGwS8HnFOYOGKhVpOCsH3qGpFH993bTmG3R9SvntF\nHthK\r\n=q219\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e2755a7ad71ef8008f87b98f324fabf7d658e911","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.2_1599141648628_0.8972603635960361","host":"s3://npm-registry-packages"}},"1.2.0-feature-3a225d-kemvotbz":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-3a225d-kemvotbz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-3a225d-kemvotbz","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"753614bbeb638fd758cea0d5c7d0b4962ac7b7b9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-3a225d-kemvotbz.tgz","fileCount":613,"integrity":"sha512-U0S3gUntWCTtFbeX6UDXu9wvJFnP705kERIat8QEAsjR0xVDN21yLmYct0WxegASj+4CTCx597l3L7mmk+Uf8g==","signatures":[{"sig":"MEYCIQCcQTNq0C9D0i7OHKbPtel+UXzNlF9xmFXiB8JO9sCI1gIhANrhXEfFH4JlRdcF8L4FFu9X0h3zU6/ozqrxggkH6Fv0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":630596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPduCRA9TVsSAnZWagAAtBMP/03O3L7AR/sHyrdJM1B9\nzwRIOIqwlqgInJBKFwhACalEt+/pgzYrB1dTLRHdyQvNUNcnPyKoaClPN1vZ\n3r1x8Qc7j45HJXxIYSTytR9KmXqu/Kudk9n3IeP9XT2eAbu0Y/+9WnieS3FI\n/eJKicyS3nUe/QwzqSCQfh12o6JZ9lyToYFqqTXiH60VC0TSaPp1h6pmNe2i\n1w5zhCb5NEbz4nmmWwNIYNHbp+7djxY1kN+rtfcbAWxUdYUwX6xx5uW9fQAI\nlm6Ttsc4EA6lqVHrmSIVOhkrYViT6VPuVVLv5MvfhoV4VdkNCYIMZAsoKs7o\nIJnT5eet54Ry0HqgzSwHNGAW/MjFZEjCJLkxIgO9YL1Qz7VxENBzI4gknV1Y\n/CYg/3rdWD70qpK/NVAQsZ1wHo4Uu7CaL4/x6e+gMFsjlqDy1ZZ5KFZZWNlh\nQMalb/TnL3pv8CIju2Mpx1hzAkJLbfeCzJyJT8/+JME1QpU4Mwam+yRd6Rag\nIjLLZADI9RzWxTMlqIzrJvctKjfoJv9vpn7gIlUk84RAsSXxwZxILTIKZaEc\n4kwjQ56Xr+kSyF1lY4mb52F4Y7evo9ox6ue7nCJtjgOuZyy0u0WlwcSdxWC9\n13kfd7BwRY/b4Cmsac4TZzL9m93d/9KQvE6I1stCe+CHWSVV/+RZ/dNZtDZr\nOIsK\r\n=MZbS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3a225d0ab4422e06fa986e0d0c33a3fe946fc1e2","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-3a225d-kemvotbz_1599141742108_0.05764051312704699","host":"s3://npm-registry-packages"}},"1.2.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.3","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"197d812b74685c5c7ed90d955323985d6493263f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.3.tgz","fileCount":613,"integrity":"sha512-hkiSiqP1+G5WElTT3OYxVGXUONej93MgJE2cZkdg+lSr0c6RpxskoYzaufXUh5g2qsBPoH/4/TWMw1eIM1dGgA==","signatures":[{"sig":"MEUCICIYwITm1SAoTvHD/8PlsdOyayhOtrGRKybmwMzGO/MqAiEA7/SxM+lex7rppsZbZdhZCGC4YVurOpXptv5GaP+oksQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":630580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUgxgCRA9TVsSAnZWagAAEhgP/0io5yxU9eU80h16YRkx\nznyJdYfP1JQJQWOPt0+s4eJMwAk/uCHoXRCjAZRB8G0VF3WhMRp3saejsw18\nY+haCHMZ+fDd/KK7YIL0VbelLErlV7jPoGFO19c5m6FFG/Ncobc2lOGAe2p9\nNIpEi55Qa9nMLVMQG32V4DHEbncIOfq7te6nG8FwLkHAzOz/u0WWd+A5OOTE\n7u06jOXxPuQ6oA+mU3ewSt7wc5bDFj1fgc0dGuatpsu4tCvVDcMqSi+2N11T\n7gCnRi72yZ8rB6J2u2hOz+6kQDvCP6eteHcX9Egws8G1Zio4I9VLum5wOOZX\n4zXO2foO2rpUXInttE0bKDPVcvBi9sgW4YxW9C2LXV1+25QWFyHf3NYjSHcf\nSwTSKNcym5zckzGIoS5BwKu2NT17x1GvIV3172gaPCQkG8bj7T7g3oSkfVBI\ngfZQ63At9KxPmuVRIkioSsg96UJddSfbrC6yiTyaGiJvVUmhOh0VucLIMsb2\nNNOHz00KmuoR/4uvkF6zyleQFSMkfCDvfzdc+2hpybVPwEQIyZJEiMJtN6/Q\n7Wm5kbzw47dSGx+ZlvtdgJxDp/xromnVa8N8DWZc4ULxYR0zJnLJu1QIGppW\nuNcNCyfAmNpze0O00uv45YLUsxJOAG45YBpZpUOeRd5B8nC8E2eZj9q4zL+m\nqhLl\r\n=pFZ6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"562948396b93c789f614fcbbf9146619f6d3b85f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.3_1599212640294_0.41637807321267073","host":"s3://npm-registry-packages"}},"1.1.0-feature-953719-kese79d5":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-953719-kese79d5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-953719-kese79d5","maintainers":[{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"08f20c592299cacea1af68dbe053cb15f8c31377","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-953719-kese79d5.tgz","fileCount":613,"integrity":"sha512-dWUexZlPYdDQoY2R5od7HS+cCRRGb97affuI7B9s/0yhip+OcreRQrIWAoWbbSs7kJWJslI6NCEc6TPPkUCrvA==","signatures":[{"sig":"MEUCIHWEuN9VROuOEKd1pzNuNmi8irXzVvgjROeB1tVVnTJrAiEAhXHYEACQsY3nNMaPJm8htvt+EdCJOWhsDfVJy0jaAkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVg3dCRA9TVsSAnZWagAAPG0QAIqtXOZXJxAbg2kswMp7\nXWAVp50UHsZlVwNrwEBL4XSgWwbEBpPpmfZd8FBMV1JrtACADRpOHTjfoDFw\nqa0Nun0+tE3XdVQ3okpAZAYX0HdvS0+cMCz0FXSD637cB0Ujd5Sg/bYhHEUN\nLILVeaMjS3SDoGkP99xCPM5LTYviESpQg7+KPzAqvGFUeWvOkwHFBgjatrD5\nYX+Bdb4+eoaOzjX8YS+5uVoplqAMnJ5V/Z9fwecQIB/pHrMtuIKtY1uKcbEr\ngvMLQAzZGeaosoH7EqPXTdb5rJIqQMmKZ0HPlYAkU/gPIf4bohUkTTYVUyTg\n58mTZfLAJb7dasVjXMarpTenQy/qhP45VvdFoJbtK0BqGzJB0rBxEdLBbngM\nATZwEdW5bYJG58ihnrJTPwltZ33TRAXzqZTRIGsbWAH+UtIqQ/ebhPPd7Tv3\nd9IjKA1dC4K7iiL6ZGezMp3TE/iyANLH29L/+fyjQy0ks1iHpjaPEZ55uUox\nmoNaMd6sms8vMNgQGdzvbKA2xON2PQxeXUYECDE8X8yBL3s0iyk6ZvN5mlWo\nDfDHBQHZVQUetJNxlU7m8mssKcYKxc5EtA0tukFbBLkz59gsDdmOouci7+gC\nbPc+fEeFOpPhlMbVZlfXRJgPTEHw6j1HEJajl7TDdoFiusQrd0BHnkEIt4ST\nXifo\r\n=rrey\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"95371965759314657d3e6d185395883c99f00e60","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-953719-kese79d5_1599475164972_0.7623843239691745","host":"s3://npm-registry-packages"}},"1.1.0-feature-3c4364-kesjr80z":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-3c4364-kesjr80z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-3c4364-kesjr80z","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"44af92a1b0e9b83c364be512b02af437948738d1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-3c4364-kesjr80z.tgz","fileCount":613,"integrity":"sha512-QpqARawlbJkJ3LDlOC040Q6J3dtIXF2cLdNKDen2KjgrLtyBTG7XYo1kLJo3b/lMsOmPWN5gO9qkScb7t/09yg==","signatures":[{"sig":"MEYCIQDmpgBHpBjaFP4qM2gi4QUbqHZkVpr2ctvyxw+NoYzlTAIhAPgc1DFtowXalxSixdGMkUabGacMwvHQTtWSKZmnDye6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":627147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVjJSCRA9TVsSAnZWagAAUfcP/RUluJMnoXupksadDa5+\n8i4Ta7qNoC7nhfAfFnCgf9efD3Nep9JqomajqEz1Kzx/VRMOiabUvt/Zfsrx\nR9diVupiZ8YIAL9GPnV3jNB7vnNCLh0xOIwhf7yimTj2iY7xE1Iqq/nVjNDQ\nEw1RNcYUtlvHYQKv6/+ZL4fwstP7PzFnesMY/dTLfN2dNJuhSMH6b4Uig1Q7\naZu6yQjDnDbMzCW+fPNhGNxsb//rEnV4bV2HozJGPl93UROlGyyna+MtlZhF\n8T4vrtsdM498zKxMQA9eUmciXJXCwngkcqXcYpojil/p6o1e4qDac/DXHP0w\n8Hvi+0ieB8wD3iG+NdJ/pNRZCssG1Aeurl/9B6WSDrM0Mngic97Q3bUXoqpX\nkj5I62AWw74LaoczsJgP6MAvRF38rtLEBkdgo4UpXq9C2mFstfhtaK8Rjg5G\nI3unaF+RSRspDVWaG4arT1Dihdfx9skCK0trnyNg+VhzGr449C0RXgYA8dhT\nf7IPqTb3I2UJwRhJ4skb8C6qcuPNeu7/4HneQ74X23MmanzDCY3h053fh/vP\nY4RauTfCO9vnWP4t+kcP6cuYQWeJL7YgR0efyOpkZNlJAnBezduJwOUwGzP+\niZVXnu92Ah0IIRMNQzbMFrGY7PuXay8j64txc5opj1Evi5Sxijt7hmI8CvmM\nio4S\r\n=z/mV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3c436489cbcf39574f9428f9008081ee614eea32","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-3c4364-kesjr80z_1599484497409_0.8720556681352971","host":"s3://npm-registry-packages"}},"1.1.0-feature-3148ae-ketlycqd":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-3148ae-ketlycqd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-3148ae-ketlycqd","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4d0e46439f1e354ff9dcd1f18445e4d98da30989","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-3148ae-ketlycqd.tgz","fileCount":613,"integrity":"sha512-SXv+4Ud9hv6zBacZc2ms02CzhzFbAiSbdDVzZ0hiWkJNeXAddB7SPsg+R84dibREPIX6IlNU+5c9XdjmYAlSAQ==","signatures":[{"sig":"MEYCIQCy81XWrxqtCiGK/h5w10omuTtJqKlm8GyssOMMf9c7ZwIhALr4vSgTRn0spGNmmgVU7mxUEQNQOD269F+YcTatuWV4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVyzsCRA9TVsSAnZWagAA0DAQAIomsi3X32qCYVq+VtkE\nX+ezL49BA1odcdssdPjYFKU5XrMIeV1CDZKTQcl/99YKDpOZjvzR5DbzlZIk\nqEslMMH7Wm9IW3XscwuFxRTDOlVBkBwhlwis0CdUzrxk8rGK/FFQRgE6xjlm\nNrGfInlkgXo2OMbN00xAl0WiMY43Hwhl5d4EzZpJ4OWhZYZJz/JxYw0dvO0q\nkpRijSKn5Ky3BPPGrFlLXzulAFakC2Jda+7mXy6tl1ADsJFogAZWOgUfl4n7\nTktGPlzsTWGWB1iBjTom5HzTpjVeeLtJIQtwiGOjV+nlYMRm0g12eM1ZIVRV\n/W+x7E1nMjLdi6UDGPmZm/FmtdfqpwoIzEpnb3hPjSfy+5ngASC2xPzzHpw7\nFTImvO8t/JYBf9V8Mf0e+SdUIWnH2vblgFA6k7IkkIA6bTZtOMaVZ+H0iwUD\n7Pv51+TqN0xIlivIDKAqhNNsG1vxrbiM7bOef1eD6k3zfBL7bD6P0TzTkRJn\nhxbCDFWPPJ+EM3naE0Cs8RtxPRxyHuXZoX/KoostAS0Jx4XHnhGQD/SDsr3c\n4MNNPQscIY++maKuADFlSq9J7IQudT9IARVDPkj+KFWOObe7dZoeaiz8W89z\n7bzLGCnM4hWXTFVxm82+2PQeupzWV4dqxxEuqbcqDjpC/LrdrCARHcoxO1QA\ndmHn\r\n=JdQj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3148aec56cd58fa830789e37c3cb50ecfb53c5cb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-3148ae-ketlycqd_1599548651816_0.47057332183797107","host":"s3://npm-registry-packages"}},"1.1.0-feature-125120-ketmhz1q":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-125120-ketmhz1q","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-125120-ketmhz1q","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3935dfa2940c3fe0c9f11d07e67cf56faa9d6c8e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-125120-ketmhz1q.tgz","fileCount":618,"integrity":"sha512-mKzgAgBkGPNDNAvoEG9/NZgWZzZnQnSUDWuWo/FtlWHDV5oo3xty3rkZA3W+dTBGSw2tEiMwD4/v/WzpFe23TQ==","signatures":[{"sig":"MEUCIQDDRV7L6AFssmNbUGsJNR19pHcoMeoxK0VxSATKAQ/8zwIgDgMJSuUhI/lXw+k/ChmLX8Jskvb5ilC5a9W9d/v0imk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVzCCCRA9TVsSAnZWagAALxUQAIyUSm6/ATBQ8QgSf7gg\n/3S+ieJ4ZMPL39TsqKqwZ+WFraNRpH2piu6iJVs1ehC5iSdRLlk2O2PMeDSs\n7NYWJkAjlpncx9a8CbNeKu6aQzwXeTXS4VfdDLJT84isIPQu9KZA95w3oHz3\nEYT8hKTMGxFkRGSVTFKKBLwDupG/2TMvFuZeNPns6mCBtlL6ikuFJezrBYhM\nmIhqd2A+BySFVlinG+y6DzXZQgwMGD1zKdcW2C85lUbqmfx7pUIWLwASIVSO\nMIGQUa1YtI2VY/HAFmyoB/zmvjavMjJTQNvDDEZ3Z9OjvSxSt3xsfKDnOIcV\n0zpPoHShcSKuh70zvURwMFSf2jyK88/8oL5yBHVYitucV79/oaz2xoZsbTR/\nFFQvlHe0SgIgEe/8JB/gtrdguEd4R61kFDRT3YdB36uGcFM97H0pV1KpgVfm\nIjxkzxRi0z3rjBzPW0cQ8Zw2iALWZkgzqJWiSpZf8tREc82dOR3E8GETPx4B\noQjnzkT6wYLmDsyo6fc36FEvsZqp80Ww6Ftrvd5jfa8tk/gUAsnCQircpxFo\nUeKOLQSj1sc5muAEKq/BypuypF+w6hpYKXInZTyigmIANaIJII1cEpVfq1rs\n0Cu+IMOeTdH2t9PX6OQ2L9ezeV99txN2loAG4f0Gh6SxPqVo7vO0tLYIqsY3\nc5uW\r\n=uEWV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"125120218b34fee4cec236eeb21b8f3c25eeffde","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-125120-ketmhz1q_1599549570257_0.3500038600029767","host":"s3://npm-registry-packages"}},"1.1.0-feature-f66cf1-ketn06zz":{"name":"@atlas-engine/atlas_engine_client","version":"1.1.0-feature-f66cf1-ketn06zz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.1.0-feature-f66cf1-ketn06zz","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d93bf950ce7b0cd8c6495a3e401072dfbc8e40f0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.1.0-feature-f66cf1-ketn06zz.tgz","fileCount":618,"integrity":"sha512-dsZdR1kbPQdH7RsS/3gDgJjouzdkrN1B2IZll5xCQ1enY3ZIu7EN3lJhL0uS5OxKgQy8DivAAjoi7e4ccbQLZQ==","signatures":[{"sig":"MEQCIEZ5UpsH7ahMjNKOx+lmRwDMf48noujfr33QOxLHHQHTAiAaTcvmBRYAbtvqHHGXSSDIUZEa5x0Q8OGkv1ozdwZy2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":638365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVzPSCRA9TVsSAnZWagAAe5kQAIXiMA5Flv2LdAA+3pST\nJ3Q+GiyotuarTYSdf+qFR/qc8bV3+gRMGXUJcjV2LQmjx8fG34LGvwKVs9YO\n2i/S6TYyB8fWsr1Qp/PbM95DpjgWwqwRb6mbvpojohYTV19e9JOhF6ABQEYS\nwdh7RSb+QQhfORZKF/NT2C7EnVIiLgCcZq8vGJI4OO9iyKbph5+a40i+ABgc\nr24B2D1wAN2q7yvRfH6aWJrftvqhmXLjB3AAhAq0sQIuzX2lF8obLX+Yc4Ar\nuGrOa/BMnUmXuhGSs0I4IibZ+hL1ZOca/NexifPPVW3RyrLSEMrlQAoPA8HB\nOyUom0783f5fzivAOM/W3aMQRM9/tnbrlbjWXSap+FawHn3NJExEj+OKNzFv\nOYo/lOkto7snbR+42/zo134vr6czMad9CM6FAmWz/iP90Twh1hFh2907MCkN\nplo8Tv/L/Xe7OVjQeKFpHflXblilMQrfQ6utSdJUnBnJrfa5niKTNuMQsgJY\n2o//NefiMumBMEPyBGAHPzkCfSHNSkpjxI0nJj8VVG6/LvjbWyNHw1d1E3bq\nvAMlvYyVYK3ui083HKEUZoT6oshILXwDLeiCDB2+sFXdvDRGZ60f1RPfAiHV\n8lTyv3Z1H09Cg9n7UkyOeiMYEtN8/87Fc+hHRedLGmCmhFgUzIe5RZUJnEct\ngVdB\r\n=a3Jx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f66cf1a500617bc78aa8026ba69c34b8892c170e","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.1.0-feature-f66cf1-ketn06zz_1599550418245_0.9828372188546064","host":"s3://npm-registry-packages"}},"1.2.0-feature-890417-kets566g":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-890417-kets566g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-890417-kets566g","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"590765f6b3fd8993cddd353a778e51e0ee3b87b7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-890417-kets566g.tgz","fileCount":618,"integrity":"sha512-i8Ni1IoABJ/STpQqfXTEhvjvdp/1oJ94bxNZxha0bARdQ0/JKSS8B8BAfg1YIf+W6RRUuHJHag1xcas/S9O86A==","signatures":[{"sig":"MEYCIQCJuda9QDD7/2sqiQ7Z4/mapy7b7cIW9BIM3/7ueCQ3CwIhAKLQkuR46oKV2ydHU9PeBSw+RbOEtyTxmoKpS2V1wRBi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV1WKCRA9TVsSAnZWagAAKhYQAIZcbgEPy2coJU9iqhXp\nVpFLonoDT4+nVzL8Vv8VId2p51I994pA/k9Bh0p71OhfMZbp+p15VIovWfcW\n5H/IMA+GoNl4fFA4Sf71SA5Nyxu1oF/Ai1C4hCvkKRwSexwekZ63sWR/g/qq\n6lsW+xmpbEDa/th/UTrGsdqFcb3YbEM/z49JY9Kn8BzeUscGMgefeurN7krc\nd2aywRfDAn/pcu2gZh+Q2CE3Homd6lWYvauGaa0WuMH56fq/brVBdQ1qmjaA\no1gI7D06NTm8m7Yxk72gcXlDQg/nJRMD8eRNZkMbGf+Kwu+e5IunWq2sXtrG\nq6FBv9w6KYXKoTdG3aAbBd2kiAN18ozWtsFPf1RGBvV/9xwgoqnF2q896JhG\nw91jY84Zsps9AbxB5p+IbcKgCiSQj4kLZRZCD3emrhj6DBuBWQK+7FijMo+e\nwj8deL/KUywZtrvgrrw08i8tiySmreRCvSetlavxerPz63hOyalBoUV0Kpu1\njMD8SiEZMt07dejF0/CIGqA170y7z0Pvdoupr482n+1CJ4EXJIFNIY3/2mzS\nJYlmvka8D5LQ+8xxUDt9NEZ1DTn2SXRTEpH13q1i8TKBeylm8loY3uYkZCGy\nvBy8B2/6pqgk0JnFqDwDULUljfZd1SELkwBrgMYh8ICOWbsXylWFbPssNxZN\nXWXX\r\n=o/TS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"890417368b66c0d3265236d2072861a5501009e6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-890417-kets566g_1599559050104_0.21363823929921222","host":"s3://npm-registry-packages"}},"1.2.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.4","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"42610fd4aeb176128dd688a1452768607ec8553d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.4.tgz","fileCount":618,"integrity":"sha512-d14yioXT3IMGwOapkfluJC7zJM0kOT5HT9IE+ro3JbKXomQqkzIzYeSo8bhB9AX5jSOOvV8arsh6u5GyNL46ow==","signatures":[{"sig":"MEYCIQDS9oielAYKZOwu+2GFlb6SSsOeZCC64nCfF/agr42SyQIhAKWMu+9LlzZ6D9C7x1DWIIIHYrIrbrRvykt99jDLFYV0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV4xLCRA9TVsSAnZWagAAXt4QAJU4b8on0QvUFXHjDmbw\nfTeDAduz/ohs2WcU91WwBkK2+8oeoDg9i8oTM4JOZbAedS7VD3E1UXGiuunZ\nBci0VpCo4rIC0gX7Xz+E3Ew62mpFU39+JGS5jsMvJT8f6ROQddHVv1Qf4SPx\n/oXfpiVIFmfmEyjLTM+BbJSjCKeJDmcpvsZpvFtLjrA2SC3envIItCpdxYbu\nkXBgRrLPpSdki4t7jDJwwTIoFS4rfIelVS3RYPZhoULqlEIy82x3fmtQ36JW\nJnfqBT4rxmkUZsW3YfYwGOBCFsX4f6/6MBzneW1QPt5x9IhGFzlQSD8JTQqx\nC3ZMd3avFP5JCD/KZEu76d+o9aTkUG4SGC6gOKGkc0vLPnyeNRYxLUmUG8xC\nKbAQtvZ9SjeneXaNz86PiH6IjL5fPXPEYf9ehIlqXdFv/lL25xP3ZpsAIGte\nmcTC1g7CjP+nHpXahQ6dYnqbuho5VrgdtNPpWaMTiQNWGZwEjM/UW+s+DXaV\n1pO7jvV+WrrjzTXZyxsj9+eZbSc+Mygzy30iCxKZG01Hh/RY3u9CNFRZIMaS\nJwxyw4FIpr/If/j9iEqqLNLo092ulluFwyKIQcRzPZZqnVU8piqD7lA9yrJX\nHHDcYynS9ozpEO+dhKJeABORk1lm35zW4rOlOKkVjtEybIsyrwfDhP60nO3J\nB3Lw\r\n=/mbc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d9eb105255587de1a51765843b103694841075a3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.1.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.4_1599573066380_0.2565829487488227","host":"s3://npm-registry-packages"}},"1.2.0-feature-576806-kev5jxe7":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-576806-kev5jxe7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-576806-kev5jxe7","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"61b749ab229b3c84565608b7a3d04391f03db734","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-576806-kev5jxe7.tgz","fileCount":618,"integrity":"sha512-QJxOJ2NffThXI3XcXe0J22B5Y8yMWm/1LllWOtGON+whc558WNLer97aSxU/yUZSqZBXE3FwA105A12MpL3A8g==","signatures":[{"sig":"MEUCIQDg/8vbe9X8Vh+Fw9OGERdGsF29QtncemHnNAdlM2gpTgIgFFYWEPUhZ0XJCiwekNdGb44cOKcLKIYnuhdKpYit1ME=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWJm5CRA9TVsSAnZWagAAUk8QAI9S2qt5J3n9bH+YdoAl\nn5QYZNZaMH5y7Tc/Ea9IYRIBXUqyahb7xTTu/2hi22coFLk8qqLTUk/cx7Qe\nk+h2sqWXvjPde1jpVrTUTycNLlSqj2xDMiw5ckUJDmXIGwWNmqeNaqQcDLFC\n7Gp31Mu5O0Xt7Rlb3YfzJF56PGlJ+zN4fZHJcL8cqUut6CKLeXLBxGuUpuEP\nHfcAEt8oaUH04uer/0OCKcKppaUoQeTFGmZ71MvpVJZxkF1fA3vnmu1W1Is4\nT8JF/BmK9NgkuW3BeFIJNfrPZJwxcSaPzteQYlKtPACmzoJvfIx7Nmgiau3P\n+cNZnzhjONQHsCctJ0ndNginPTFHqBzW8BASetEIrRdhhVwh0o5DkLZ+33Eu\ndL90kU/knkW7XprmqmI3I1Aom29jcCDHJSIUDOY3NobKQGAeXEHjoicfIX1S\nd/B2yzHVB6f7wEycJmU2UbhOFfyUGdZoNZDIAb4EzyWWB5h84AFmQRl0T9f5\n0wYdIWGlDH8on1/ydOJLOPr7Cs8l3ltEhGxsNE9jO0UDCS8SxYXjc1pgR8HS\nr1FAuVkwif6FrQlKpiKb3Zk+DCLDnIXH3WqnfLaFP31D7JYHM2S1HGMl5DSD\n2+kqxqih+t/hc5UazVt0aC3Z4q2LZod0iXwehKXXNuKQLD1SEyRHRxwT7Aba\nErmp\r\n=W1g9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"57680666f13602da3bf13395e323d6bcf02116d9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~fix_claim-check_for_empty_lane-name","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-576806-kev5jxe7_1599642040733_0.8045312180678603","host":"s3://npm-registry-packages"}},"1.2.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-beta.1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"99d7ef544f7caca13eafadeb4ca4a91d829d9194","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-beta.1.tgz","fileCount":618,"integrity":"sha512-Ti02HO6dlwsmbk7PfobtWlcGvac1LYLOgTPgq31+gu3Qlho4TGT48sl0wNuX1KT/upZo1cvGuVDLcBlR86MOmg==","signatures":[{"sig":"MEYCIQDjoCPJRHfj0U6+DlfMyzB50eqLa/f7A7k6MGWcAyIfFwIhAMTRXzvyjLAM1QLwc5uJ9mWeHn5uzSZjc5V/b0xOdJAn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWM8iCRA9TVsSAnZWagAAlv8P/2SDA2xegpLLczioAEeH\n9sW/7MNcuyAYOuMFUyZ+b3GJOhvOjbk5iwX662t8w2mw6IU3abXbbO4NcfZH\n4QS8U+MMZzTnm0BN263+y4UCoXq+HJNUGdYo+PKYjuldhq8f4TrWazyNsiQc\nda3yGmKmwbYh+GEKQ6QYfCcHKhQGiqhXTXHQyIOpXu9zFuacOxEDZ9d9J4S/\njUvw6IqZpTZ6kbsrpVtuIYhw1P2vKdyzBk8xRurAXiyf4gMQCQTmPqBpxsG5\nV9qCkbG+uEPOeA3ncU1w1cZsqOoBLg/jRiutodUFpGoFVPth8vpmd7KqbO9d\n7M4Ly2dwStuuZFe743HsfQ8qKv9E5uRDeZl8gvADg1yY1KI7d4sXLwH2Qw7/\nN3nNi6YERj2x9awj9UeGCTEhA430ag1iSoAxq3vx69RVUeT7JpjmmXI/13ga\n94FpoNIlIIlvYFjR2Cregd3ELGzi0BKv7hOs6TY0NNHRtO8s3ammG7ikHIZK\nsEgvh/SYqv/go937hBVkkCSeZQLp2MwSUH4s6axO1YWh2g7+K7OjuOJ5ZLhJ\nvJZBB73vIVHjejBgNzqpjVcPkZH9MTyLGjrtMmTfq6rKWzGiOzSM1hukBVNv\nkdZvpMIQewXITc/BQD12IZyA7wQD7lpfCxEgowuIe+q7jtJBDBqAQ/LHt9jM\ncmny\r\n=iK4D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"49a7816f6ae9000c15ca68539d5628a65b734f0c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-beta.1_1599655713828_0.22743708453829137","host":"s3://npm-registry-packages"}},"1.2.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.5","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f5fe7d6e159d6e4fc466c45f9e23dbefd3be07b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.5.tgz","fileCount":618,"integrity":"sha512-wgXwIOsGEFPj1Oo13ZhxS7txDTPJbuO4XOgPV0Ti3SlYZ1XlaOU0SnaInZgJtLemWBeVN6Dksx4WjvJvD78idQ==","signatures":[{"sig":"MEQCIB5J0vUUstB/8b3apH+qa5lrOnK5A0dX471Dielja+MWAiBTH2ucyS3niWxM1e2UrV/I60/lZzk6P5zZVKWwhARbzA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWM80CRA9TVsSAnZWagAA2hMQAI5xMOfy/ZeTF8No+V0a\n/Yi40KOApv9U3JlOBEZkk2y5qwlYv/vSKUAihJpUHrZaoKOeZVsghheCK/Ty\nqZCmetZyVos7UQpIAdcuue1F9JHPer9EBUZpcdAgDFFjx7WtJzpK9iDP3gcE\nh5LCrYG+YbgUVeLssNf83/3qXUUtJfiBNUzXbq2gpxWd4OPbzR9pqrDyNRzo\neaVPnT0VMhQmFplm03sFT/A5HBtY4Vb8KPfqHEKpIHRcK0jdRdCORpucxJaQ\nPzLbVYD0IlOi4QtziQjeEbVkkLnlShxlAnnB1LkRaKDCM3jqwmJlEEIF+IRr\n/zJ3YQv4E/h/IFd+ajyXviLUEZfL2ZTumVWXXaVZzQVSeY0keEpcAuxN1z74\niTjJXyzjjI8wsF76qPX7WGFVMILonUpmrKWl+hGvn0+IZR7Z34+XyEt5fCkK\n6MmEmUyZ5F/yiCX/CUIL0YeOMYSDq57111sAYZW4mQ5Zw1g5vJ+HSb7eNaVC\nK3+N0btGWcL/IS10r+9BXz5QdAhl4eG1YN7N+rdmeQp8Cl1AyjorrZ6hut+l\nYgifP50qVa96WKcpztrSBbLUPF7tVgmm6D/tQGf3kFb4oyHpTURw1ZC1CkK0\n+GfdgVDhV8QbCtcB1DLFIGfwi5Fr99PVgltXZDsruJZB9UM5r+3b9umSAlNI\nEqfs\r\n=XbFi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb20dd2fecd6b48b04acff58b2cc6677cf1d7f5f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.5_1599655731536_0.35976208677544297","host":"s3://npm-registry-packages"}},"1.2.0-feature-bb4993-kevdxge3":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-bb4993-kevdxge3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-bb4993-kevdxge3","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3983ce5b50d568cfbd0c2024260929cfc312596f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-bb4993-kevdxge3.tgz","fileCount":618,"integrity":"sha512-HxmaEcRngiZ2HnDiDjzP/y7nItf5HAwr3K9YTJ9O9PLXYd7VJL81tyQz9VoewhpOyAMf0I0AGfMm4kNGmW6leg==","signatures":[{"sig":"MEUCIQDxeZifIZe0xXMr6WNvtIh2wvXO5yOCMV3kuqnS+M1a6wIgMJOPY8r/eyIc1VHD9lyMtydQB7ubM91FQkzFOX6L0rA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWNCrCRA9TVsSAnZWagAAgkgP/i6stifmEhbJUakdybKT\noGeHo5Eu+RvnNy9PbWEXcgAAx0GxZYq6I7NXNmOFJMxUiaXQ7+P3IEhFzKac\nhdqDOG8uEbEwaNNA4sU62JHkFf2Z9Spg2IjugD8WLDQIeWBt+vd4huLSasbV\n7K44aC8UXhC2UxbLH/lzSxDkmcynFhXjsXrVWcrSNJh+C+s2XO7G1kW/TP+H\nJVbh6v3QXsWFti+rPYUyaNI0SaD+kbuSq9cGWU9/ZAit8TBYpS03zwwQoMRc\nGXFjkuworqqnpjF8pwGiG5ss7daIIbwSipLASJPmYcX2Cgwl1S7dNJH43CDN\ngWaGt668ZWPgg/KTnKNNdHtXGQDQKIPKE4iJYHl3PUt5Az2o0EPwGh1wmrIB\nljVKwrEVZWMS7CIqWxrAzrSLJ/pZd3mEQnLC4MHFIStKKDiFUl+Onia3l2Nn\n9OT3cy/5LwLewxci4sKj5EkG9tBW6BPGbT6K8Eq6yaE59qigrdtdbAI1ZiyZ\nQvN8jCKOWKN61rD1zWyGvg9fXoPJnDwbA0m3MP+ip066Xh2SSi75GUpO6+jL\nMioXw/4j/beb6YHJ5EFcCvhK6MjAH7XmO359MdVy2Cv1SgiIwSanphnzlPHV\nCCGxLzIbxbU95IEohMbBE6rbgoTn4Io+GLbZRbyQu4uy/MojWoZSB8NxS16L\necFQ\r\n=FR6w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bb49934de40d320ae13413ebb75bf58084188e67","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-bb4993-kevdxge3_1599656106868_0.9075792681063768","host":"s3://npm-registry-packages"}},"1.2.0-feature-51cdf0-kevdz41m":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-51cdf0-kevdz41m","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-51cdf0-kevdz41m","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9bdf28ece2769164d2ce57b1bfbcefb3ccb8f1d8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-51cdf0-kevdz41m.tgz","fileCount":618,"integrity":"sha512-U+yYpO1PPcJusHkUeHn7zRJYX8wpbzKXOWnc+SR+K4mtDMOCDPL02T4aX6n57yzlgaXBeOkwdq0EPuqZq75a4g==","signatures":[{"sig":"MEQCIHR3OmH4R2kqF+q/0qmeB7wjWEJP0+gtUBs78s5eUN77AiB2lTgkpxHfWR96qOvVxoJ1mWIN1IOINuef/ONxesZc+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWND2CRA9TVsSAnZWagAA0aYQAINgbDo4faPqRhUuTj37\n8YU1HfTtJv+/2NSFe/W9SJERtVcsr9aR4vYh3V8yGQeFUFLh6SGCM9VGqfgd\np70k8k0fu35w3baayZTeyqbQ4pTjNTxovOOHm7alCkj2EEG2+E+CStsYWyIl\nM+KwBMuIvwSEYXlwSLxTD0jXpJWutwIKiHti3AxVjUr4zSjOp1IFrD+2F6o2\nAICsoHS/EULLFIQ+izRusi1B93Dm3YEjmw88h14BaOU3KbiSy7owovjbxWvh\nVzTm21A8J3+FInqD3YqR6EprKYEcL+D7quBVcsJFN3BEBFJHkU521QqvTQRm\nOnyQL9NhowD3BqI31eghkW8zmVMOzsGA1CKM1ZAkaDDXLVtn9YSAwWCQkLc/\nj4hK2+xllHflvPKYPORVqBQQD/CL6i7Bg7/clK7/EojLLCGJoMVjq11SVvJU\na+9eSVV76f318yHfCNmlGLbxtaoZHHLCo2VSyAv7BysI0GBghMmtLSd21OMb\nR7MGwSuakwO6FQcWs9jdMtRxg45uwOB5ZhmrN/0YYVZGnUu/7GWJ5A8J4Lmu\nK2TgEe7LJ0k70sDOpmWGSQ3zhe8OfHMc9pqRVZLiDrxRLAmCiHX2TUNhUKMJ\n057XvmJN0CxS/CulYo80pQhHJv8u/NJ+shx2aNCq8BDhLDog1NLHHyYSzRoI\nANTG\r\n=cw7p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"51cdf0de46ea3eb4daa80bbdaf6a22cac05b81bb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-51cdf0-kevdz41m_1599656181950_0.3227781393069702","host":"s3://npm-registry-packages"}},"1.2.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.6","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"30a562a41d14b55ab3f4db97aac14f21223abb95","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.6.tgz","fileCount":618,"integrity":"sha512-2NsE8WrWJRl4y9PPxWOjrNxt+TZVEZw//bsIYa6vGfI782HYMva/2RtKEN2kbYDoC9mStah2hQX49YbFsiWrZw==","signatures":[{"sig":"MEQCIGch4mOvQo9Kw8eZbzy++XOeQIlYcBiFzNps8GO05JqiAiBJmnNT3E2CrB8ecml09hAijBfLzO1+Y3PWJQO5/PJESg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWNEmCRA9TVsSAnZWagAAAyUP/2AIiEXwocnoulkbUX0A\nXkxr42AdHw41st7kKh02W10t61LN24A9HDkz6gdGeEX7toPz6EuFaP9QFBDx\nZVD76DONwuGKymZJp6H/FJXHBWiLOUub35DQV5MFCipWgRy4PaDuleb2BoRa\n7P6f3akmyJBrDmFI2a+RhH+bq+c7kXXLVM6EVsBe5clnoUQ1tagSN7tAO/D/\nDv9eERjN/G2bX+xKi8UllBY0q110zleACASzo9/l4ng7354gNIlJ0+f+NWD/\ntv5MH39tl1YREen6xMoDB+aMVZgFbwhSnP3iyOI+GrzUS4YD7cv95lwp/ena\nmCkGMUIF4DlNUI348kWIHe3Z4QUGDjY7F+j2XZYBTK1n1Dktn8KQy9z+jf7v\nF0oGNftox/GW6x00Z6GBLeAJFa2hq5XPwLMxDyfGMfVmv2JLGpfsDo8vYNcz\n107R9nSOyCU95GEwnTJsM3Ilip1bsWFQuleQ48gGTQ4/UK2amwlq4vHSxnNB\nD6raXfaA2iZ4QEp5pgjm6eZx4kzIWbxq0PvPoETcvyo174nYbEz34MGIKtTn\nSxeao/v7UZjxocJ0UQinUoja+WyAdeDbGHCBVEt8tEU8u9P6iCzXTEbglr2M\n1Yn3hniWxNxxPgpXSpsVTkFYcUXjEqdNFOOh8PPxH2W56uo9CeW50+p0a8sW\now07\r\n=9O/U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"01a280b516a03488609341d148e9d128d95e6665","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.6_1599656230185_0.03003040156218617","host":"s3://npm-registry-packages"}},"1.2.0-feature-01a280-kewntif2":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-01a280-kewntif2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-01a280-kewntif2","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9e2d295aeac36fce518dd03fffba466fc6880fa4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-01a280-kewntif2.tgz","fileCount":618,"integrity":"sha512-szDwrpHqLp0K227cgojJQLCpqiAREcU1RcTrjhuwzaihC65dIXmFNSZdcz4HcxDlmYFlAkJEEwYatEZoxznL3w==","signatures":[{"sig":"MEYCIQCv1cQZLoaLJBsAi3nxXNYA4XvGWLiVwA2a5vdu6qCoagIhAPD8fL56eS2WRRIacCRcxyaFHLfaH0RaZyJQMVLxoLPQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWf3DCRA9TVsSAnZWagAA+CUP/33MUKeZJPkcmD40gKmY\nbzcO8MPIjrgTUFxHZWYFGRPQHPnpETGI57RJ9uHwl8ptZX58IszteojBhPk7\nqn42qQuefb1qhYKJ/iQWBettYjicWMCrI6Jd2MDyCR3rXk++V4NuJrHHrFOd\nkn9rFPanUqVnunvWePj5pS34IY72McxcZah0rtisJ8CaDnFxp5vWG8YpJEnm\nhV44AKvX86StxHJWnLZZYIqbOBAOSRnIZLvfvlYsuTcGl4vDQpgioM8kBcZq\npapfL8+NbHn/olYpX4/GH3YwfughmM+SsnIXyC1lVY1iKgkIQiha9thchK0X\nvjPtSuCqhOdLOjiaWX4+GNwjxNZYXPJuPFXOIbsHBNs+3W4R+Hyf54teZggk\n6q8gnNLpxM+6KK30LDyQ8mVkBXZd0E45AFwBY65VafAK9pqS++319iHenL/Y\nSzjee88Py2BXKh9HJUZZc3xrw5K8x4rQ6Tch6O1TJwcvzRCNqbbXA8bb9SLP\nBYQr9swltTUGRfYbyMe0p5pQkOLLKxNXmy/dPRgy/YzcTWiRkHCIQNRUSlkB\nuPW3E3T+RUF1eJdJikdOD47ojMQt6QEsp5or0rfJ9Nu9gtHR7oTvjDZ9NmaC\nEigghlAxLKI58zSQfCp/LudsVRY16XsGkMpKD5QfYSa0lF1qd+WLPbdE5RPk\nxsli\r\n=L9lH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"01a280b516a03488609341d148e9d128d95e6665","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-01a280-kewntif2_1599733186745_0.847616579184884","host":"s3://npm-registry-packages"}},"1.2.0-feature-fcf59a-kewnttc6":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-fcf59a-kewnttc6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-fcf59a-kewnttc6","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3066da0c49ffc44d8ba0dfc6b16017fd31da00ea","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-fcf59a-kewnttc6.tgz","fileCount":618,"integrity":"sha512-gGi7piXecgMKKWmQ1aV+DEaissB/QL1mc9nfr1OD++sStZZIyc82rLxX77T/JfeEkwC47E8DjkfYPdaNUXLioA==","signatures":[{"sig":"MEYCIQCwgn8BP+pH4TcHSPUCh48NHWsdNjUlllov+W3OqdFoywIhAMTlXPqbkBk7oAkGObtoznOd2ae8TYKftTNEESiTV03l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWf3QCRA9TVsSAnZWagAAuu8P/iVNti4UCHXcFdgSNk+f\ny/DrcK4KFi1B1gqIy1Yne4tr07hyn02KnNYFbCaKOWXXTLAj7Ko27hLVphWZ\nySBHtnKA9f6ZnqEetr4LdTEt4FS9d+3gH/A6Tht8TKs/Kdm0/67ICYZ0auYf\nqWpsBO5oaBfCmH325fqzqs0Mhbmz0t4zq5z6OiDtyS+gkOg9kh2xBIt0bLPP\nT8Ud6sjXv0S+X0iIpZ484CwvtnmxnL8MpNfvE0jYBTZFzHsx8znjzwcoOm51\n4apDy3gdIefMffT9LRA6NkYy9hlCxTI4SAycFhbDu0W1RvR5AShagkbEMVJq\n2I5zsZdNyQvd+8ErVGJvPUhPydJrEkkaPj3XWuDvZD+jmSlgcmh7BUAmBHZW\n5EVH7QbvS3xTqGzu3MgWR8WCt051G6qEbtx8YQs+Wpn7t5zpNa9oCRyUBnqu\noshpCjWaxFe4IrjtsLPf4LWVL6VEk8hmEGFRjHsaWm7WoQ110MjEvGQE95ay\nxLhp4bQW5li4OzsaAye/7yHRasaF69U/YAH3EGP4coNNlpAOumlOUQx2WxzW\n4r1IsYI8IctjQtWek7QIo8j8llXrdgQSY1+9VlxrpPT7hcI+ZV1acv4rv9NG\nEjbk/2NedqcfqeJMlDk1g/J+aq8vGLbgad7+lZWVk9acFPqC/8LkiTa4a2Rv\nS424\r\n=TBwi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fcf59ad424b62927f10d3c65f4c524bfe3c5b4da","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-fcf59a-kewnttc6_1599733199785_0.726575647908005","host":"s3://npm-registry-packages"}},"1.2.0-feature-fcf59a-kewnweu6":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-fcf59a-kewnweu6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-fcf59a-kewnweu6","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"44825d6d6b246764d5d2a0a4ba35a12fd18821cb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-fcf59a-kewnweu6.tgz","fileCount":618,"integrity":"sha512-c+3etVmxfs1IpZ4KSqXmHeiV4UAWCI9s3FtFMEHmG+0NZGfcjxLej+C3BOLprugffObMZk1QCLMuk6ac0XF9QA==","signatures":[{"sig":"MEUCIDz2r3NPp/bPQwH3NLwnJkd8T3zxmXZDXft0zZpcIR55AiEAhQQgvFMHCcu16fcEeVWIqctqVbr3OkKsEv/BEhOZd0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWf5HCRA9TVsSAnZWagAAv38P/RVrbqFQfkkBExr02fyl\nsdhqpPAtmtVt4/9W7Ds1NHRNO0nGHx/5otQmmWotDnRvsNH5clOCS+4KP93H\nutYcakSNfLjlZzacXE9TxMTwP+0OX3XJhTDCqhLzmgmSEGHadMrQbXfGQped\nZUR9qw1RDFK4IWv9GqNHtbtCmjPnl5J8g1kIxCvjm0ml8rILkVM/GNk5tGDt\nuzFkDjQHyNiP3K8eCZyky7433ex5RcsVGpvLpg4egZXy2i7dr1g4qbAlATNZ\nTgWfgZJoX420N8kJvaGcnA4pmeQHzfZPv8oZkXPiNKu44QpfPF39xDVFN8T1\nKASEY41BCcYol1i3ywQg+fFJN1sJyuQA7weWLq4UP3mj5ETgm2LUstjDAzAP\ne85rcOk4wGS3vhC6owm5eWTzFWERwDzo0v93OOyOLKYZMAqmL5RRaFX75JbE\nq/mU0WUGlkO2xIxk1bCStABntPDI8zzU1RR7sVIIgSEpz+lLek3PWON/dzPK\nl/2Brn371ZbZoi+TEJEJDLV9wi1iV1F/aAZ9v6Ua41FP5mBBdNURo/B1lkZo\n2Vj5qlCOHwm8NZ6ajyvMO453VyRqaUolgVa3+cmHidfZCur2lEZEqtL/Nlop\nknZmngv9OTsWCeh+gr/5/e13jz6JqfYmEryllrdHv99iwDx3cAXT6akiwsUD\ni59e\r\n=M+6K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fcf59ad424b62927f10d3c65f4c524bfe3c5b4da","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-fcf59a-kewnweu6_1599733318864_0.3003357282989385","host":"s3://npm-registry-packages"}},"1.2.0-feature-e27d7e-kewnzbc3":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-e27d7e-kewnzbc3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-e27d7e-kewnzbc3","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"44f4140e4b0f757ac09a631f32a69c828951677d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-e27d7e-kewnzbc3.tgz","fileCount":618,"integrity":"sha512-7VIisG4IihlcT+EwAOJy5AnHapUec7Le3ixUj8ZAbol1ty+7DShv/nWVMGnCQYhSElcrgjjaBAVH/K7oWfzpSg==","signatures":[{"sig":"MEYCIQCg6yWb/t7xoMPBo9fguM9rsEUDv8eL10Z5PEBFmPqBjgIhAMuekfE88zp5RmOf0fluNHUu57HUZoIvTjZZ1jiOyFd6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWf7MCRA9TVsSAnZWagAAN5MP/2o3TWPYVXTz1BuTbEr/\nVkYdSXiKusd4586dYYx9v8IB/nmNeqcruWIgk2wXcnuAdw9fJObqVjGZFzWY\n5oQ5u0mSGonmT1jU06ber1pnuX2zQA+Bzli/d0J+RntPzlkt5Tvk3QKJZCy+\nU8VlHtJgMn2/+G6h7D4bfZHGE2wZsCMuXsGJ6zH0AVNXCDTSztDaT+61Uvgl\nSJPP1/tZICHUK3kF6ub1BowtwRyX4Dzi0EPsX04zp9tdxnzdGAlpTI/+vBA6\nmtkSTLGr96Ywm0Zn08ZzZooGZOWDPYgGYQxIe1vLKtM1ryZ9MHqyRTw5Tnxm\nHmhPK+xorDlCRSd5Zn/gG5G3PYziiKgB4YTA0uygs1/gX7NewHhuIscXJueX\n6DkfVhSap2v/SY83H4RJeEDkp0Fo0wSU34Eko6aEdghWr8SC0jAyIAhoGz8y\nnvPdvQd1eIBOpUSK6SXq0NZ0fiomsBd7JaKd7DOc28GZlM1ijeN7l8zyUtuO\n5XPl4WbeGPkZUZVc7gqtaUvPspDjRhVfQuWVBRsKohkBWABW+OG5nnEZq673\nwfpgIaNbs4XAglBr8pt3FXa5lEcUkcxLuvQBDwHwAbrx/gRiC4gxlBEu4v9F\nCfmEZ1oJIhTlpaZ6x5BBIOeoHegfBW3P7+17C0CA6UPXgZqxalvpPJg5n1sN\nSwK9\r\n=FCxX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e27d7e9cd714d7f1572d3a17c91ffbe230f798d9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-e27d7e-kewnzbc3_1599733451694_0.8900604626614408","host":"s3://npm-registry-packages"}},"1.2.0-feature-a1481f-kewwg997":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-a1481f-kewwg997","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-a1481f-kewwg997","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"20ff7afc44ebf65a70b73afcb1515fa8a2add10f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-a1481f-kewwg997.tgz","fileCount":618,"integrity":"sha512-2iNOs1K4qQttnIGodpHeO6fYGH2z7FaALz2qPKfAim85GLSekFkmzQVoOxQwezO23OmY1C5svcV/bULB3P9EEg==","signatures":[{"sig":"MEUCIQD93+ga7UFWKGW407YziBrd8WX6ItO9rx3gzF4YW8Rd8gIgAhRy9wcTKQbsxeVLP7/gpQ3inkkIRfr4IvFAKMC+958=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWjZkCRA9TVsSAnZWagAA1j0QAJ3SHf/7iUznWJCaI84J\nTRm/xf5g+q5DZjCP4YjwzLmdSTuwB+brqRLBECKEcjuF2f+xwOltrEeas4Sx\nS+E4Gn5lU31Lgt0qJ+vY5LOXGNrPgavbn1IXmuQEfMsyylPgy3pk7zF4Irwj\nFpSGvKld9TRqOjcLxZg1vrNUfnEOpgN6h/nejrJS/RMnIIymH+J6Q2DoSpkh\nioBg6PRN36Yb6vNey/spPOyjpFWU9/N23apYjtOh+WsIZ3Q4o6fWL4D4DhuJ\nVa8j+UdawTF7+pMLi411ziuOSB4zhcGbRvQzYQ+YT+LMBK057HOUuRgEHfrQ\n8HrSH2/P7vSRoJScDbaFYBq8AJlja0piMlE2PtkZVWKmwB0npgCduHGjQLoS\nNWcxEJTxIzzS7wjE7vT6RRUcCcWuDkZ39hHReknAXknxUYWdVOe3yvl4YkBz\nHQFWNoEEXnOhDNamiypn/CgWgW3i7VAJhU9/njI/UXceO5xA8ezLnJ57Ri0c\nSxFJftMQurMW8SSdJAUtu5/w64x5FQ9XBub48FhMganoCR9a99W93LQz/UB7\nNL9NBsmY+S4g8xo38YOzwI9pBPARz6VAJjJ2EtZtsQBQ2jQgCiNRjqwHX/n/\nTaF4KWW7fUSslANZcKcMW/1DJY0bLOO5/GHSDIG7EfLEKTb+7VOtymstNKQI\nIuS+\r\n=dvgu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a1481f23e8767c2afada458e1699716a6d81704f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-a1481f-kewwg997_1599747683971_0.1249770892059654","host":"s3://npm-registry-packages"}},"1.2.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.7","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a4bf075b5f5f3608c68f0a086622ab753b754a6f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.7.tgz","fileCount":618,"integrity":"sha512-bAocVCSslAtCYUZL97ItQESzxrCpxk8Bfos4IBt9ynkNRYTANltTLQj2m1KyivggUKAxPo8v+KuuAISVAiH4EA==","signatures":[{"sig":"MEQCIBAjSox0rC/ap8yvy0pakp/RbbY0zL/LZAYCoB6cBDdzAiAL+4GIMvz7JA9P2tMogeqWk72QvHxeeGEENpEK7awmfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYbgbCRA9TVsSAnZWagAA10sP/0uSYKAc9OBBrfGM+bZc\nWWJIJOIn69sTxnqBrxC1LKaLF+DMoaQcZniGUniqqIyhhcsO8i6Ar4dxLpjL\n4WZ1x1/K7zb+pWBmznsPPSFG3Rixrr5uxtbG2HgEEwOY0wSQ9km5kjQcjsJ6\nA3w6iOnI3MfWkOg+l1bkqmB+gyS0fDseT3MHhYeeO6RfaOfXhfYuZGoRTd4N\nTgIuJkGlDFNE2wpisphFqyDhiq6zj+RyiOYItJVeNKeYXBwpguECcJlGli7X\n2Ill4sQuWWHBQ6x40pjzzrVuzRDUhSi7UWTYSidK3m5PLR+kjJSjOlEPITw8\nHdtw7F0fV9udDGRlZs4zuEsVuU2iN13RnqICXtx5zSIvyuF1nt63nsU5sdUl\nIPofJ/VvRms3Ad1Iybz8TdjR9/qYiw/I7Y2mN7pKeV1NJ/Xcg9nihLe1jP3Y\nr7wYj5+AkO/RCWd6I9wJZcQ/FN8Y3SMerKeYIkEomVQZSI6WQqPiIJKiloJV\n3wSgRDk+96WbAcPlQM2hOJmW9vc5NRHXWRw40RG2qiBitaNyM6pXXeR5O9uf\nbcrBWT/2L+hBKWW89kMTd7RSJmEd/1yJW2/Q/7VEHILmibcskzpbYM/yIm1r\nV9VaNLw//mPvuUXjMxfq1SPbRuDRRC44SiLUFU05MK1kkts4/hpV0hWTyiBU\nfWgZ\r\n=hH6g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c648fb64791a11961fa170ffabf8e5d385098bef","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.7_1600239642659_0.8895744270371644","host":"s3://npm-registry-packages"}},"1.2.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-beta.2","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8d728f8a11a03cea72932399ce7a7c58d60103fd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-beta.2.tgz","fileCount":618,"integrity":"sha512-uka7WNm9Ox5zZsgaNEok2/ot+7KGsAaGEGG+MsfBoMNRa6DzKVEAnFpkdUwkGs0FShfGMnQWHmTvl23x7hT7JA==","signatures":[{"sig":"MEQCIE5lPib9Er4lpyUuu7Gb5SOX0wywULIe1eSg+yVkw3LEAiApPVGEjatArJZLKLnoPffd2C3Yp3yLXdCZcqYtKXLPjQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYcuHCRA9TVsSAnZWagAAKNIP/0eKSEubhdbpJKVzAZNU\nGYQjhZxadU7tuI6CHP7tcbMtQoK5mQ5TRzHKee1BTRpeHAhEi/s0AdmydEw1\n/7xGOccStBa9hQME24m61miSalyxpkyRm++MKRjjIsb2lLgdXXnOxEGbwZpQ\nR0X430V1y9b65rxCgFqVzBC8Lsf0Cwja2j9e1+iKPXRY1FCis0KWHqtCb7nf\nm964OI9Yee1I3Cvy2mhe81e29GjQAcyaylZ0fPB9TWpUKBBqHWuavW2T3duH\nttRI73pCz+ijs82VPjiHgp6yEmmvb/PsGKKhCD4vmK77xSmUXk26b5Ri/wSg\nFtx5hlmo3seWIaAejq6TQhsfRJbRY6LZE357KWzsDK0JH30zzTodOhIQlqZP\nnIbPUpqCs91jHGa3TFiIf6hixKoXCeA8pNI9lsplE71RcZrb4jVFeK4IS59a\nF75Mn96LRm+RjtNKM2o2oGM4dO4E/DUpOu2AkJ8eqfesHbPaSypM7Gr3t61a\nVKlO7MNdpRHkkTOJpfxu3Z5UqSfS6zX4TFgigRcagAFALKALmEbS2Fhn/dYa\n1KsaWqynmJPozNWm+sCb+TLxOgHWE68obXsSP8dFgl2ZMKuvMaLjo78HijI8\n5RhzP6KI6RF6FKopU/EwHWUkiVTOf00+kNJD4+SsUcRuO5oFoJNdkN2Gtp9w\nR61T\r\n=ma/m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"83b8f849fa40ebacf253cd1a0fb14379f816d200","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-beta.2_1600244614577_0.697368289601664","host":"s3://npm-registry-packages"}},"1.2.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.8","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ca3eec66dbe1e40bfa1890605158fe3721d6f233","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.8.tgz","fileCount":618,"integrity":"sha512-936aQXbAQKQ3iunxua8ypILG4WkgKbxe/890BGV8hYjECp9EijMpdtlIRPZJYHDgqK//2X7X6HDaXQb05pKpeg==","signatures":[{"sig":"MEUCICocSj5IGCYCwxmItXehNRHrS/VJ/PZ2/pPps+jnW0d9AiEAm0WwZvJb4MbKvcJ6SY8s4+7fznMlEh5C2Pm/00phOOU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYcuOCRA9TVsSAnZWagAA4XoP/2HRPiptUivglJxFVKny\n0gsizHrh5JKTKg5SADCYcyU7NXNoYg/0uxro1tRr4JiFUA4gfVQXkcrm0W3s\nnEEzkcHCBuaERTbtUqEvXEl1wO/kTA/9wx+ckqVYaaStz/0FMTJ7a3EsPk7r\nwG4BhVGCX86UMBqEqWVc/CbCYmejYfkkWcy2Jicl0d7zDKikgOQtKfXP6uXC\nFgtLmfDgSRPT7bmGbcosbw/cwX1bJUnzDS+Ae1u6A6fnsVBJbvgimMaTkVp2\nSrFhYSL5GTlwht5CyUTRJywkBXj8KuHULwSM3oAfo8PB9EwjXWbuPbG0BdyC\nHixlcZ0risUm1KXftVoMbM7bhwOYdkUavKvbALv3Dt1eK9rVmOy7v5CVFzU1\nevsdQkjKFdrRDCWz3SANYxDerrYRN7c7wh3IwWJEow+sRLZv9V9+Sxm4SM4+\n/ET6WmIb38rCfu+ooF+0iunyxtBwpXgKKhiKXgRVwCzSBCmIbxUMiIO29NWQ\ngpjesusafHta1UnRLIgoaCrZaTS2nNN1OSGST6kz2uo3OSsQ4ZXpAQJoe1hN\nJb5f7JYxMQfWUoHKUtZ75OQGukxS/lsgss+/hrKrTXbN4fflv6xWheJ6Kj5z\necDeBBdD9+OXaLAAmcPktu3hAp0NI8nkJlgSLbd7KMk+YzTxg6j7wQnL9385\nLz6n\r\n=DQh9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ed551377b1cf5d493b8ba55787ed4e4920ce1d61","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.8_1600244621989_0.3238461007756994","host":"s3://npm-registry-packages"}},"1.2.0-feature-a86d16-kfgsnrfq":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-a86d16-kfgsnrfq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-a86d16-kfgsnrfq","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0829542c4d1030770529de4aad86b9ddad919251","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-a86d16-kfgsnrfq.tgz","fileCount":618,"integrity":"sha512-A+hEOKSL5aI+OK2Z1oIWAjqr09XCbABIqymxYBnd+omW6uem5Nh2YT3TZtMzUdudQgH8YTGfOiD29pQUB5IluQ==","signatures":[{"sig":"MEYCIQCFSwl0/OxxXqBoLXgczeIaNJT/g2QluZupMWGhDkycgQIhAKmSZ5t7IbKMYpBrmmub+lNlMbfXbGEQCzTiityMT2HG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbJFyCRA9TVsSAnZWagAA7aUP/jXG0SFNHyOHiXAWMGf/\nLTsoSlovXbWzi6IceRlVO6/X4t48aeqcqWi/or7Ygysi0YKR/73XUj/dtjNx\nquD06yYoMsg1rSoSAHJi1yAqUWbocolEwAWe+flDKeOtbHxkKLfSA7mThld5\nSkn48BoAFafvlHc7Ct8Cy+47rXhFgsU9Eo4DtThtfR8wB97UcvNgE8qJnUGq\n4kZYwA2NwQ4cKcmoVBQpT/AdFXg2xOML8Vn8iLJLTDHbSLMIxD9nU/N8ENTf\nP2jg3E3XSrVm+Gyr1/yWtXNU7Y3CAbyhNr69Set2r163nYBKEdpPkn/mcTd1\ndagbSSynPyBcm9432EtJWhW57KzwFgSVY1sbxo/1hiRTthlDS2tEjy8kUDqj\n/WqtbBDGYa4kzKbAVmISTNrK8F9VQvDJ69WZqouR0/BErvSvbEcUWjd0Bros\nr64QyHVGlyzrU6XeafrJDHjT3QLTtoFW3n/u3QykdD4hcPDuEAGp6mKU5hQb\ngxELSmChnwMSmy+UdXrWEoo0rocJcjoQLDo1CV7yvTJkxMg11aJBYmcDgTpJ\nET1bW3nIG1m+HAQH7KUeqyQAyKZvH6gMOvYrBcM41tYtXzGuKycARsqmgUiF\n/hgxYm0QMFAupZYtrGsWUScOi5qUwgXhOaiYPxZ7Le0WhanwtHAAyOrZW7wZ\n51ap\r\n=VhaR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a86d168688434d416ac7ad39993b49b2fefb5449","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~flownode_metadata_access","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-a86d16-kfgsnrfq_1600950641957_0.7933817535387473","host":"s3://npm-registry-packages"}},"1.2.0-feature-632a58-kfgtktcs":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-632a58-kfgtktcs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-632a58-kfgtktcs","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a9bbf8b9a97331a9166574cef3e3b91277010c61","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-632a58-kfgtktcs.tgz","fileCount":618,"integrity":"sha512-MSCWuXg6VEK0GNoT2Kak7HLdMCpQHo8Nir9W07cIx0i1HW9SiHjiUI4hk+4pujoMzMa8w7wQAGG+RfFxXjNnYA==","signatures":[{"sig":"MEQCIEwEFAGEnOoS7Ie3QPwHTyt3VPnMT5HOyOaN9x9ltyK4AiAp9Vm+rcTYmGzDJO6Ke0ivrvtJvxwM+T0HaCbkA8WHbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbJd2CRA9TVsSAnZWagAADewP/3IsYP/6pIaYtdttpHti\neoPHl3Fh9UKir1J7kFFbdOOfgIaxnfqjXpG2vpWRo64AmPUcPVXdjtz5ljAT\nCT7pZHTBIj700TbQbAbbpGp0EfsadwuCSA9HyWcAdFI+8g/ZHZjZEdY7QeHJ\nLk6WJVZpC05TntssbfRz6DD40++5/J3Y4kZolW/hDM5YEMCajUjSz3HlI954\nwWrHilY9bmWj7jIeyREzBUnqKxh0V8SaK+5BabNUmpAAmm7tfs1qtfqgJFN6\nK9e9Q2CtctaguqPuunQxHroZL/SEDrBlajJ2xZF+1xpfoDwDBsSe2lGaNNXC\nYPaGl/rZzO4+JuBGYzcgniMld8Q8WoItYb0tPJ42o26umU9EJHC4gMljIaXQ\nSV4tVCuxhYDAG0es4mc+ByjH5zOpalRchWwXKBm1Jj3wTrAFcff0qtCclBWV\nJsjFOgUU1X+YAYkdaRMYgu7BG7oQgfByJTPHsjdmrk9HLA0k6nHEfL7hM0VH\n3q3fW2CU1ZaVDR6SD30dFxcsZQeC65MWMOzBkmwrhjP2kkkcIi1IYiwQWwqX\nRX2WCpbOT1LswsMdjrQA0tnM5/QO6nam/0o/sb5w0xi6LdF/5KopLTjA21Fp\nfYCRNZPRJL49exURvFa184sXFP3SlKWDi9vAjLw2MKqXoLR24geFw7MzZriI\njZIp\r\n=z6HD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"632a5810366ed613b96e73217c7110e22ba9689c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.3","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-632a58-kfgtktcs_1600952181776_0.17149362524432","host":"s3://npm-registry-packages"}},"1.2.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.9","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8c223c364a00f68f8dcfd7d0f81fc182bf1b1f7b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.9.tgz","fileCount":618,"integrity":"sha512-0AQh1Dol7SC/VsNiHuO7yPsZq+4FwkjARg52uXqwzi3AheNcXRHZGvj3GKwFV8H/vftqcvoX0skuCmvmoV7SeQ==","signatures":[{"sig":"MEYCIQC+Gbg82n7Fhq//G6IXDK+LqM4jmb0x0Y040ch6GmpskwIhAPumlBYkzfgsOKytFjqr7i5jdPKlojSDrmBSIunufUqX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbJg1CRA9TVsSAnZWagAAOp0QAJnpW+BxBpXf8gnxQRR8\nhkY1G7rkyEj3zwsM5PLb/VeQHLeITQeTxGYcJ6zYfwhcvPRbao0aLLAAJZqA\nZUVO8hxd3AgpiMRVJNzF2vNjeo9yLuk39X9B1j8DJPT2fcyTkFz9u1y83HBK\nVE0EC5KOcKFVV7tlM50Uo/EMf45bDNB1oHH52qVGSnGv31QVnTjymHRSTYtV\nF/0K10Tx7MnkaPpEJ5I87jBY/QtDZKWR85hXZj91Vo4ImKxFTmf/OWIKYI5Q\n2E0mIjEL2e/ef2lfGqxuWkWfGXFldDxOLWMlLe9H5vKFmDT3PnElfifqA5Wn\nPLK5PfbT3wpA+G1PdJ7IPBoAUBvj2WFTi9pOlzKTrWRKYgWwOKU4QEh9718z\ni7WWC5ACF+oIhNYkHXPpyDo/sSVIRJN8wC7dGlDCM9XVLAhGGwnyjg955xWi\nisn2skX6QEpJdgyK+VkeNSHqGdBdupqNoLDc1DqZoTeDbT3UJf9uDtPlcj9M\nZzWNubwVO2FZ/MVRwTA1hv2MpxUV+M+gQBna2ulLS9njPp6K08YXsPIqVzgh\nexuB2vTPPfZrE6l5bFSeW4nwfrE4oPJV+vcF1MTfqG+cG5WbujgI/O/1FSgZ\na6fA4kD837kVCeS4KT6tklwn+7Yb1OSdw3kIO5iYWl7MTWbO4qY1rkOjSXYA\nCr3B\r\n=NLm1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bddfb4522b7f4f7f231b239eb9a3e977ed88e7e9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-alpha.3","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.9_1600952372560_0.7697300113460419","host":"s3://npm-registry-packages"}},"1.2.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-beta.3","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1b26ea5f65b509e640481218906b43cd15f984b4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-beta.3.tgz","fileCount":618,"integrity":"sha512-vJwhpZZD4AyNQxnCRx620Iy/pUSjC17UELJXGcQA5+D0q7MnQ+06Hr7joQKYmvNNXMI1kgnnZzDPqSRwcBgsaw==","signatures":[{"sig":"MEYCIQC0pqM5LW7MCOhM/Xg8zEfAHKeG70iivcq6dkikxE6fcgIhAJKPZhW2GMm5yM/Hfs5nR8+ty96mG1QwHDRZt0MtfoEg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbKs4CRA9TVsSAnZWagAA/QIQAJWyplgz4VhE3YvhAe9k\n+UBAvLiMLwHUlxKbc24tLT+o7lP5MA8aEOvsEdO0ALZNr6KfI30OOQzwsXAx\neL9+k+imr0x4nitlpPfKIuiok2PS07n8WIEuM6OlQ55bTVFGOk3bIuGz4COt\nviAgetyAM8XGhHelaFQqKWdAtYtgTyd+fNzvWcuEQ/ZKSw0LKPyCD0yPe1d1\n1N8Rzhbh1r6tx1uKs1JixSB9XCw5rRHehbGvGkyh/ckZp7l21AcRcBTq1tZP\nFjNq+qLa39yAdgMJmb2SHIwFb0LKBrtY403mSaVxoog3z+zYr8TI7ry5dpdk\nCPRV69cnejpqkfhXh0CCor/IS5LQrwgUJmjxAGFQQITcB40Xg3MqscHtZPMV\n9++9kSeY/d9FWGNgAMPraiYpX3PTtW8vWDSsreItv4mosOA1D5+EqfMSovX3\n8rwUxdtKs1hEC6elC48aU3iXKkUCvaUBsMK0Q/X1rokA5pNaQB4urUMXWD1n\nn4M9nNqMdS2Jrik2Er13U4+0G+uX+jUgHOm8s5iwQrHS7uTAU52s93SuQPms\nMRtdj+XtoRu06xjsvWF4bt3eyEPtB1E4mxoplhYpk4IflPd+cidSBvGBkFl/\nmjaxxUVag3wX+7wZqDHVKmHipbr7BZ5yw5/Fc9yjIDNMJWcNz51sCRzUvL4n\n3pAw\r\n=2HyK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a68ad98c9ffe07ea59b73538c0bb1ef6f9ce6427","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-beta.3_1600957239968_0.8977513948279725","host":"s3://npm-registry-packages"}},"1.2.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.10","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d0723305ca7264c0e0a2d81443b4e3f37c4f5120","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.10.tgz","fileCount":618,"integrity":"sha512-m2rrXy3xNhxdrMvlWV3v1+9FMeCLqm4cnTocm0ufzEvvV/zYp6ia+FDiG2guVjPjIIzLacIq2zKZxggFAq8XeQ==","signatures":[{"sig":"MEUCICCXWMzpRh/fWTRQZKDSuHumKpQkc4CC1V0KfwI/2Z3WAiEAtRm43Wa5q6E+TjfOteBLQD8OK35n8r+sh8P2WcQbbHQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbKtLCRA9TVsSAnZWagAA6+0P/RQd0UOzOxycvI6jaBD1\nC8z1P2lYKds30d9h+qFj/MZc3BjFTLmBXwSQJkDAG0fz2BHIcMmFGBIa/C04\n1LDst8Cn5HgabMrBCPEv9eKaCh4oQD+zTJ48vZspUbSCKen/DQLZFhHigoI+\nXcJFhq3/vyGjJPa1LaOsP8ZQfPRqSrFFcGy8/yBkyy2OtbOvZ1UqTijG3Lwa\nIdfZyrNr8PMUPtGm8mRVkgAwrUukx8PRb+r3FcKQycgqd6r/HzvPCvP8RVOb\n5W9mlA19ovsX5WtDbywPTsBPVZSNNzxR95fVAYdL6ihv689AP7cO1DildQ5g\nHSAYRWIri7SYxV6ktZm+oAj4zN/uTwu27rH2Bl2dOZynIOlhTBn43de2POy3\nY68vokImx/mmFDO4hQM8N++HgIgiccc9Ndsff3+YjNjEnVw2ghB0za7U4xtt\nUScXxnz221L3i62iXxjQCWmXfONdag72AC7N3Ef7hOIXGUN86WLJ3knlaK+X\nZk2pZgvTRj7P6QEwPI/Y9m/g95VJlomLcnad36fwEg8SUCnszYjDHdXohKSe\nPMGdXuloMvIi+cjN5UePa5X8xw74ClevRW0rB/RWTde8lk6Jnkebrxd1vjpe\nUgm8YBFrzf270rduGIDylZioV6OXhlCwwWjmmeCTg857MKzKTRp66HKyfj/t\nfWBn\r\n=jfgf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"215c9079ee5c4de8a1dd345b8a41b3a3bf18e7a6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.0.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.10_1600957258779_0.3367193634388981","host":"s3://npm-registry-packages"}},"1.2.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.11","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"83bf3fe99a2dd933d0acb7aa8b9ace354172a04d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.11.tgz","fileCount":618,"integrity":"sha512-rcHYBz3Mq0lSeGmsfO9/nND+kgtbhEDXBYNDSSieRvE4poPbqEvjFWejyuEJq+qUnCd0Z+J8KE8TKoQNWQYiEQ==","signatures":[{"sig":"MEUCIQDLQIF1H05hlYcvKKiZGzhUuo773zvxZIZKqSz1sdMK+QIgS7qFIp16C1OYNkCL8e8Ek7pZVSkiY52xGf4vq9Ehkr4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdYqnCRA9TVsSAnZWagAA/N0P/R+W327kVrRkxjqNcEqO\nXsf46iW4uC5WxibT2yyfjo2/fD96UONqeKSsiqJXb0iJhoQhfDs6PnJ+jTws\nnarsuY+1z9hZBQ5kP/UOrbtphv6hnUEppskYfG33m9w+WjEDSZ4yLhTk+XTU\njwStW4LX57mAD2uhwtrotcENySS9ifQ3l9lO0WEED71j2IHOB0f0hP0ggzdn\npRCBGLUvrcONjzkPAn7kRT0TFcE08HY9si3arrkFy4rvNZJtCr1xfrYDoP3A\nV9KGWWypuU4YVxyFUBg0qtPQqg2fRFOJ8f3Nc5EFdsD/anR+bl7oCGCJxkQ7\nAhAsflQ75PEoFDHPZ1Y8I3hpy/FnnvASNVj3bq6dHNg2mvCeutZPNHaFV4LR\n+fumBheTtpRpfbwNeeKy4un4DqLc2nJDv2XmVcS8Gz/ul2tKzJmORUtNXrGp\nShznIDvEL9RaS+AjG9ssP46EJ6iw8whptap0shIMJIcpqfHdEALz/+qaKJt0\ncLcK5qbhuVUArJSl3Dvmbk+ZeB01akLHEvMbgPu1QlbsgOMOQuNS8qyWfeO7\n03f8ROcQRFwXzzxsmv/eObL5w/LdRWFIbOrfi35PvGg6aLd6ZGtA7oiuVNzI\nNmvIm2BOoEDLvutoh6hQ3g4gkPXhdXNziOBHz37v/DzM8reHySVcSRHLMwu6\nvUXi\r\n=6opa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a473dc31eb914bbf1e3d8cd118d027aaf5725060","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.11_1601538726640_0.08285458073479446","host":"s3://npm-registry-packages"}},"1.2.0-feature-7f0d08-kfqu28m0":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-7f0d08-kfqu28m0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-7f0d08-kfqu28m0","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"386891ece0055e1d8e80ba115c51b5b310f13cc9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-7f0d08-kfqu28m0.tgz","fileCount":618,"integrity":"sha512-ezoIp1uOi0t8+NRllhB9pAfJRr25GqJUYzkEl23BSdSn5nS+HFjoSf3DxNYUhOQnLo3vMWhzdyEY+XKrXSpR7w==","signatures":[{"sig":"MEUCIQC/1rDVprJo2MtZlZSSwMOlUBjbRj/G2F6at4YhWs7AJQIgMSSI2FTpxQ/2ECIFEZuOB1BZIbMdYi+SyoMCT2Y6X+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfddSYCRA9TVsSAnZWagAAoN8P/1v5NKCozAdGf/7JSZby\npTsHFyfhIKJZzq27Rv3bI37n1U3KcbNTZj9Qt2ErzpSzPb3+K9PHYxtWON4w\n7ReX44vB4MNPY+xAYNf69vLK/YXYVrimD3guKBlrvMu5P6tJG0dSoh4AEHm5\nXwcanqqQMqI54Ot3oc1j5q/hZ7ChqI2ZKdgc3p+YLhUVn5wNQsaxU4OTzSIJ\nNPljA2gd9AlgIRUfAgAzHQ+SC3W8i6wY2TVe8BC6pvFTyVLVCLytAIUJGGJD\npuZ3lZwDv5fKEr4tqxIxyW1O+iUgkaghQ8/YkQeQReNRns5t6OcCEEDZwOnd\nsQlKTCSRaTQCPY/v26iDJDzOpjqhB+GMtOjEdobYVqc1Ka8RijX4XGhMmC3s\nw+HLLRoV1CcsO+6R0YZ0HYda9vjFR/hPKVJcGwy/T3c78Q8AUif6i903lKxI\nejCpKs6cb3sqUoA8gXxIrWgueM0ZpQDr44jZh8JbMh14YCMr/7jt9wpIGO6d\nyiRjx5h5ri29cv4RG742lA8qbGu0P5yDmU3ifB8+KVpKbfLEmqLEOpJFhaoO\nWu2fN+2aMEUiQivnYSa2q8l0wuWhOjjRcVaq49khoytz/KSVt180wXPPE0be\nsU6ZypqSGV2O4eyGihaU9xyngu8c3u5kVL2v1T+o3dgJe/OQcxS+VCduKzwx\nkLBL\r\n=ZbcU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7f0d081da6f6ccabe1c95987bde698f4154ec65b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-7f0d08-kfqu28m0_1601557656172_0.6310953649926343","host":"s3://npm-registry-packages"}},"1.2.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.12","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"62db72918e37b38d3c363f28b32275ca82c2a885","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.12.tgz","fileCount":618,"integrity":"sha512-PvlbCGPhYepFTqZVoAVjkxbGCn4ODHP0XUb4tXPdfLICeV9hXyeJHY+fPm45ftuXWHMdNxfsQk1wizNmpmyq5Q==","signatures":[{"sig":"MEQCIDQV5Omh6zAjDc6pLNGYraQRqYFSRJh2tSjk7hQUrlh7AiAzEVubLlZyicZ/bFLUwImxrbj5Ie72B/B3HmS7Iiz+ig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfddcnCRA9TVsSAnZWagAAmfIQAKIh9H6ahQXphVXqNiDJ\n+xsoddn2dy+LaoSLC4X6wsVerXGey5D/5BCjChpU6EgOpsGGQMW18Vczz/fL\njZb3qQXeSTTGKfLdcb6qyqZzJQBk5l5AJ8wA+ElJe9qLIe+XGwRxE+6oIIp+\n0RTJwnbwSVmoLSVh38kYNpQGvzP20XlQSjksEOMeObNH+wENg8/l9twj0/ia\nd96uZ0uYzSpeWzgn3xYXeNCwtozuDNsPigJaP0ry0l7dhiZSFWbgtzXu8hiS\n2+cOIeTHWQp6BsDR4hoqdkL3Dl+0YwIApcrtn6zJzjKkUdyc2ryjZzK7JExh\nBZN+CKDedLm6tSWHl31Fbd9MQf7HJaLxDYmL4cAhcXbwyiWwr+RCH6bpSLo/\nXcjHXSFgfle7gN4j9Vwy3t8Igh7s70H0dTSVCOyKH9igUiweBLuNWvLjbMWF\nd92JBXvIucoX1j9fWMahIYrOjFlWmpahJ4ZzuMILvp34CPg/bjMHdBrux7No\nwwCFGVhgGE+Lv5j5nJctlb2+epqPCktBwLuDWUAQD6INT+ms9mtswbZjvL2h\nc6svr7x/afOHKJKXwKgu60Ek7cMkheGlHxkmpIkQdCB65/NURceLGChf9WeV\nGwVviUxm6ltBMH1oS7ER9edxXn0+YkZ8nPk+v+EOyERqOIPsCXCE4viQLVlg\nvh41\r\n=IZfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e5e75d10c43a5e0c92fc225cdf55e20e28800cb5","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.12_1601558310981_0.030864609728329384","host":"s3://npm-registry-packages"}},"1.2.0-feature-f45df3-kfxqjojm":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-f45df3-kfxqjojm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-f45df3-kfxqjojm","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"33424ae97667342cadc927f18a8d005090c7e6e0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-f45df3-kfxqjojm.tgz","fileCount":618,"integrity":"sha512-HM29fvOWQ12h6DRhLYQaBG2sa/t7OMAV0SqDmT++9WS/dP0YqI/PtCFrx0ipcUe3TD6P60tpLQB3hCb8r3fu1A==","signatures":[{"sig":"MEQCIB7agmwvr9R+sX+hN9gGGd5882nvdZhjxMrQQqia1HBwAiBEI0Cz9PalTnVcE3LdKSKduVMbIokod/6+y+9sAWuHxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffDLnCRA9TVsSAnZWagAA1FsP/1ZLMWHR4Fox1kPI03jI\n+6RqVEucdJ1goFtuPTBV3k0mP+3RlTm4veCF17+AothBX1J0105SZuawuSOA\ngJp21KOcBFyFaWYo0/JY+hYWvvGx0kSJBh/rrxFcn3y8WNIdXE3+m+WIvo6X\nTox/GelZXXl6m0FqndlfKv7/geIdLNO45AkRYRymGF2IJjc9al2n4YSIxYjb\nEjusV4WkOOasWR4ClShWquTL2VfzQG9LcN6JYhjs+YdoNyKUjSQEtU26kM3B\nUYLy5O2Sb4RvoOrCtGVLWVwJwSGtL6vlAWn4rvl1PPyMjAMezhNVeis+agrG\n+uCVv4MifnMRwOm2nf75GmMso6SXf90VQyCgsCWxOzPxUkS9qx2dwqE55GzT\n8YYmDNMytnd+I3KyVgP5aJMl2YngDmUnLxJgPD4hKgt64BqU12MCWQXtvs+o\njy8sS+HGeAg9N3ZmGqPSZhSFe8www/k9tXnKQe9hBsgtBsCPRWSeA5q/0FS9\n3TfkC8+AiBn3lBQvMRc8k18cm7ViN35+KoEKM5xkuXZrXyvzrXSQrOvbwMAC\nk6+twthoHjvSlWmIEPMj3Dc9RlK8xbdhjfZrg2PBV4i8Sbhu8qrW1fCwUCIt\nmODCUpfAsuSuQPVFuq7chpM8TP0Qt2Ii8K7tDzMOQGOFH0epDHwFnpL3VGDl\nWXHZ\r\n=OzRa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f45df3bd85a10b5b43025fbdc4f699a0ac030562","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-f45df3-kfxqjojm_1601975014151_0.1531931818883343","host":"s3://npm-registry-packages"}},"1.2.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.13","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"373f05e1775af06d3bac54389b70600acb046c74","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.13.tgz","fileCount":618,"integrity":"sha512-Qy7ggwLyIJjpTn3ktkijmWjeR6vnwNiHLPnGk6X0oACis5wJQ/LFR+GmygeXNLwGxVQ1HSH1NKo3MQ5YqqSzYw==","signatures":[{"sig":"MEYCIQDfL51MQ/ayacn+LIbCwmFK7vCvqNGpD5fr1ml5IPtySAIhAJzsyaW1Xl3V3+kzqF4HKyVMPQQhdp8y0YZnEHadEhHH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffFcjCRA9TVsSAnZWagAAq3sP/3LiYngYQYWaPoaLx7vE\nrT0esrpNKq7cZfFRSM0MYtcjVgN+3vZ42tt87ybixQrcM8LblvDyqgHbvezV\n0EEpYzMRefOAH1hhdd3cPjA0jKbMfDXR6SGgHaT5pz5auj8C7izXnEdUsR48\nUBP0W2VJ6ViC5xw82kQvztOCqqoDbSHyS3cvUStnM3ulaK4BHI7hx8mL4rQw\nkGPOep3Lp0RPW3A/OV3oVtTg3GT4YvgeCw7MP2eJSZjk1fMxTAA8QC9EIlUp\n68FWv2344ehmKFTuWRjaCOcJUQSH/9qL7iFpSMDhIsikMRnXqMGMVZ1/mLsd\nMpx7uTDlmvbcJYX30PzpxCZMRIC5PDsZNHBcxEgal/HdYPf4L5j76ZLDFTcQ\nLR/z4kd53qpjZCypQaEkbZm7QJZ3emqCtpF6xiBisHzsiR1Jxzibk2bxKfRx\ns8hrN8gPT819ojq5c6rhrFZE+laUU2nr9RoF4RpKQHWGfFb+OqyOy+oVkeZl\niGwtT7+vZWyJo00qJyW6/0rfDWYgeVk1/Pz/YsUJRuECcTOmO1y3w8LkqVAh\n3xn1jy0YC/gWVNHxxz/EkaSDs0QuHeW7kMccucJIC7eusNp+o3VLuwqZkGsQ\nyTmaeSPRw+BqerQgxfbUYWMW0Tc1HRLArHNt/TvB12LKBZ6YzBw2HA/pQOTm\n/3vm\r\n=cZLk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b089ed6a5cf12f09da1fa116f7b39fbce0341bd","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.13_1601984291284_0.9718478098539343","host":"s3://npm-registry-packages"}},"1.2.0-feature-8b089e-kfz69r71":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-8b089e-kfz69r71","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-8b089e-kfz69r71","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3308b7fd18ea6ce000440ce5187cc299cef3778d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-8b089e-kfz69r71.tgz","fileCount":618,"integrity":"sha512-wxGE7KLiGZA0sHJK2KTtQa4A0Af40+l8HlpZrDILjU08prkUOeraVj35N73+WKcrk0GOMjovQVwRGLrXZyJwPQ==","signatures":[{"sig":"MEQCIFJkuBNMs7tGdbEpMnwhlP3veHTRv/mFIqiG0fCzCHmCAiA7tu7mpbBt/VcP/WGSaMy6EGVHfkMTmcAEZ7gbgeSuHA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffYZACRA9TVsSAnZWagAAZFQP/RS+dlMA/i+TSizW2MGO\nUR3kCCoPo9mxkbZy1cDg+S8CoYNsUkLyS5nCQ+MS+BA1En0QtB3ngBuHLAdA\n0BnDfsHvdecxozUKUH+4DKBoXITQe2GEIrjILYdidsVYzaQoTMYB3k0JlIka\n6b+nvKUj2ANL7Aa79ZtR0vyEqXcO5KzFs1FmnsDs9PwcITkVH/qAZKvN56eC\nhvpp7Y2ixXFQYVTGrA3xgyfYcr/vB2oxgzD+gW7pk/5M/YAUlRg3NMDnbBoa\nXF+liIoa6TMyPcCpBZ5INwrJ7ighShN9XB/C46jP8AX7NLsFs34bNZYOX18a\nD10o/R588ZCENjvj+xNvCeXOAv9qX0xxwCmP9bZwU2MDzI596dohWUe3UW5w\n1+SC2/2oVT23spxiPi+q5kVPl5/L71wFKSifp7nw5kfiw5AVlssNNydht+7I\nXJDCZhoF0S4nhxTqVEd9jYC3TT6uhmISthgMp3PZa9stcYBR29ukMzDkn75h\nCRv7GCuBiZ6DNC6oyn2Is7bT8ExyiPpvKHqzVTjRrbWgGXFsGFYjBcKvc673\nEAZ6i4dKd2fNOhq54SYUciEWGT6rmkZLMjqGU+q6t1eslXShYAp60DVXG5g4\nwEDoxR0+kBSSk2wpMCMMdsy/qoR5zqOSTlmPzonT2lAGwV4qGXUF9lpFlkHc\nwrQK\r\n=J/ek\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b089ed6a5cf12f09da1fa116f7b39fbce0341bd","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-8b089e-kfz69r71_1602061888074_0.41835742943861676","host":"s3://npm-registry-packages"}},"1.2.0-feature-2727f1-kfz7qtg9":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-2727f1-kfz7qtg9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-2727f1-kfz7qtg9","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"73e1a07b77e3b3f0edcc84939ccb500aebab026f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-2727f1-kfz7qtg9.tgz","fileCount":618,"integrity":"sha512-5D8dR3r+61j16kUebMBGKUg7vg+E+v71u8l92FTza9ZK4iUslu1qkBRf7Aa0N4Qi5RhtqtGsUMg7B2kESq0+jw==","signatures":[{"sig":"MEQCIFwCvsEdq4Fs5uWli7NthLg/bNw6faAxAlOUL1ln98X5AiBUefe//A81TDjDiH/wLK7iKSoZJVISPjbiaFihF1jV7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffY/vCRA9TVsSAnZWagAAEEUP/RP+DDPLaFIM1zjBlkEc\n4PxisTNL+EBRDxkXiRK9gOBQ8LGaF5EhwdaT8f6Tl9dCSQWvPyRcOkTbvs7k\nJq3KvAYNmMZf7w9pUIgKM1bylcfPJ8suY3Ii5GVB38oxrZjnSE+hOLAvQLP7\nfwquTVTDCZ+L8EThahELXkS4kOz0iQAHjA59tkovZXw2oHOXT3zIo4FpEiEl\nA93uA6hHbH950qaG7EV0KEKlhZ4a5ArpwifMcmqIVWvRARloxrKId4EYfdmb\nxwdmk5MeUVV0adacu5rscFne5JJ9/KewB2qstmzeGPzII9ACTbtwvr15jto7\nu9tC+NexxHl8PYQa/B7Q6Db3XHk5J8rpUBTWRF5tc4WrikreEvQ076taNJfs\nwGTJg8sg65q/aRhFvxonzO3dMp1Z9NQFAENSt+s+7k3QrtAu5Pzr5GWGMmgy\nJRgElHad6PhpGwnmRlKltSwnbh2XvAl7+z5UtuER+E5arp4sJeIT3jfFqAgw\nsVzQfoWWsHDpgNMKdfMrlLgWL3egb+VwO11oMyUyT11nkQT8jEUVxG5V8caD\nTQeVjfOto2iwX0Jz408FgsMHcEdUltdnJLPs+jylaixKRqU7Nx2wf0N+hcQg\nfyhvZXBQwmaQfG0UNt8iRqB/9LpfogbMP56Lk+rRgqvOimS63H7/Y7Lf0mzZ\nLfjr\r\n=a75d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2727f10febb7bf2e5b87110055b142f2b5e51d2f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-2727f1-kfz7qtg9_1602064367165_0.08433178338548242","host":"s3://npm-registry-packages"}},"1.2.0-feature-cfe293-kfz86ib4":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-cfe293-kfz86ib4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-cfe293-kfz86ib4","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cc18f74b086758cc2c33243d6eff678602c5422f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-cfe293-kfz86ib4.tgz","fileCount":618,"integrity":"sha512-2vpmeCubzlmMqgUekkT/kMJUUt8ds3i43PgXUH9evUS9eTR6mm011VOuUh4KDGpbkAgaJbHI6eeWd7eoc8MHUw==","signatures":[{"sig":"MEUCIQCUd61gORFbW6EodZNE8pbNwafUpcTOf8mSfd3ksrbHkgIgIkVGzjbcWEfD/diSO2mKDV+MjNVXAEXJOzn7v6jEWtc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffZLKCRA9TVsSAnZWagAAkIMQAJL6ldT64fD31zSKfwQM\nl1wrT3YFsCooMvgAgj6UwVjTPNyeswQQz7YgxjkJcLhwcypHJngQH96WG31P\nFhO6FtNFC91mZeAHUAveTrlapOQn6HD64Bb4oyVJXW8hz4VZJ1IeG14dUOAD\nRizlBAvN0iG0I+1OpW5AP935wmgNQKUV4hblweKYiemhUjExnMCexK0Ct0DC\nLA4Vkc4xzZ0+sav+bsUHP6tj1kR34FbFmZ1QstrO14gSMfxSBm5ardRSSIsX\no5GomlFdnFcj1f3HZikswAt8NU/WOEABS2dOQVXHxWLjyq6HZ+HKR+8sUNy0\nvyQVZcLjLBfmFebrwNca4mQ85L7p/AU2t3U7+/RppoC0nd9A3ThjlGRwS+es\nd72bhxiEB0m3QzEKFSjzN7Hjtplfl70Egwf3Z3eNRIk6XAU4YEfoHpUTJXEj\n3r+3e4OOOHJScjwXx3kDjhwM0G9d7/XSCjxwKH2xBfQUEW/jdVyBUMmiIp+B\nCtg/O/ymMqD0f0ycyTZjasqbD2ajFHLWITi3Z9gtKKcY2ef/Bm9WaNX3q2nx\n22pB1WxOdVKBE4Ui7XleL0zH1NYgVn1+BRDHuKrmSTFfF1MFsASLCrhJXQp9\nd/+HtKyMmVKCC9jbvXO/A5bHNGmXWnsD6k18zgwia6KM7uRIB16zZQyPZdSv\niBcn\r\n=h+iv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cfe2934d102e9bb1c1e0c0a2fa3e400eac5164ec","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"1.2.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-cfe293-kfz86ib4_1602065097951_0.8226716041975632","host":"s3://npm-registry-packages"}},"2.0.0-feature-edc40d-kfz8wd0x":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-edc40d-kfz8wd0x","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-edc40d-kfz8wd0x","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"221fa622c04497cf05a2a10e50ff72af64823d6b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-edc40d-kfz8wd0x.tgz","fileCount":618,"integrity":"sha512-xg4UPd1CKxtpRIHJxFoZaxZb1BLA6DfF9NMa13A2hhnO5yAiPJK7UdLtk4gyI5rFHZiKx1eq8U+1wpE3KtWz3w==","signatures":[{"sig":"MEUCIQCVcNIQpo/MQACIlKfTt5HgBsvdNfJnWgbV+9rLBZQLJQIgTga/yiwhX2UaPezW211AbMj404RBfJk1NiBArIYQ6VI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffZeBCRA9TVsSAnZWagAAalQQAIem+NY7prorAm4VD/W4\nLsH5FJm9pOBPIROgeivH1dfaVzShd0k/aCyPqesOddW5EkAJ10iaYGx8zS48\n6su8sv013FYJqXqBoO0Y8bUV/nE9fTBmu62XwlErprWu5qlJ72q6PPFvUfyA\nICk2F7gzI2624QQh4KwW+2Fkg6y6cZZgf5gzAGaui8boaReYzvCsKTf3Q684\nYJaZFl0KDYObJSZq7A+ntoJueJ+c31sJ2mAlJ85FACR8AMHh4rpKAa4cJA/7\nZn03HTCNtYYW7SEH9TgZPxErj8d3MfJ2H+MUJucStkJhwgl1euU9bk7c1JNj\np5P0XgYVHjoGD0sZlaehB/Rv2pigySREiw3LLJ1f0ItKaaL9hR/KDWmbhkHj\nzSJG0NetS5lCAdrBiYkBacaqb1NTOc+YaMhpVr7R6JhhAEl1rWt0b1iCBXSn\ny4fxE0RqQm/ytBliR6PwZp0Wr5kaojQQ96+c/BCtBN25nLMOo4huKdHHdjZ2\neDKEaG62M1PaR3h9twuwRtQaiGyZxTs6EZuOrXtPT1WCGd39TL0xaPxgj1V9\npCLTB/DA2lNGL94y8duhWVzNU6SkCNKlMYkkbh1yqxgUBhkmGD1Tcz2TQP8p\nWjEVVz2SZkxZeNQRVMlMBiHwFqOdeYXDAbXbZoi9rsLnZNjMtxIUAPmlnAN4\nedr4\r\n=KPqa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"edc40d9811d540f6bb190ce8e8c089f96dd530b8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~remove_deprecated_functionality","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-edc40d-kfz8wd0x_1602066304510_0.7149792694006885","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a5a2b558f4681d41f992f4f87cca4c6f30e9b159","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0.tgz","fileCount":618,"integrity":"sha512-qJeT8J5v4XW28UcIQcVUbmvR+AjAgz2r7xTRWm+dzE3xf9mci0icaS1G/zTMI1qajBUI/hZZQz5Iz46MDc6EsA==","signatures":[{"sig":"MEUCIAmKV0wNwo9hW9TDcGiKh3vmNNEZmytEPHHvHhgG5vu8AiEAiI3gHfXwH6CKI5U0ASq1IHszzh9q+4NImbxCYZbybVQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffag8CRA9TVsSAnZWagAAwIcP/3EyvbrUyV6J6ZxMSocj\n3XUaCh9yU4hnE6VGIgUK0fu+aM3ES66nV+bwMwJ+9mFMH00X8eFC/MIfd1tY\nZM6uh5lftG85ynCpZEsFJcqRuHTl6iPx06vdbvcORpKVfRvMwoWeBoChxV7l\n+WK30HQkad+TGzo5sfQ9x0KJdBF5gbqjS3h/kDBrMo5YLBVK7ShMCmxfDKF7\n7bUNVHotWS3dxg71zi6nkwaDaFnA7Dtg2c56hSgXM59x/EmM4rbr3aqS1wgL\nz65DRd3o5ohctTkLkeKaz2ITMPkrim+n3nEtd0KpWYKW7jYfyw4lGwOut6ko\nyNq56ZX5zbs6UnD6DQ5lWntvhJvyjwr1Lk0jKqeIG0+GhbwqL4ZynUkFd2GY\nFw08Wi8p/pEEp7glSd+uYBNxOo5eGuSO52A5YNahG7v/P7gDPoj8ByqNmVA1\neDMyZaIHJ57ctaU5RVDoasrmJmy6NUFwPgNw0CsmfWl5RAIg+F9njkfaQ9lJ\n2wqzjq9NTlWpUg5vxRqTpia4vkPMu/Ar9HXZE4fXderx2N5yRoy0mZBprXMW\nETd13I/VfGvJvIE38Dce8sGfeuD7nqElTTMU4M4/cQU9Ciw5lNSrVDhR2gsw\nv48C6e0J38B5426wppIqykR7nn6Hm41pp9h16eJ681iRYZBaPHvdJ23KtH1c\ndO2d\r\n=XVXe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"a1208f3e7e17d412e3896f22344da35a3bcc45a3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0_1602070588256_0.9080563689700059","host":"s3://npm-registry-packages"}},"1.2.0-alpha.14":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.14","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3bf7429bea972ccff2aa8463b6bdea0c58de1d66","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.14.tgz","fileCount":618,"integrity":"sha512-V9Ntf5TvZn/7d0Sqdm4ExFYAMTyOhchXcdZtK/ieB7Kdzd7oStJQ0ZfkTCGDGAJc0als9D3Cnt2IXXEMOvU+GA==","signatures":[{"sig":"MEUCIQCQ1iD4yTGQfCVa0yZFK0y58xTHAaTfskgBCD1oxJG0oAIgXjzDfglLxO2YMWJtHHusODiFyQRh74Av+8TtQdyQ+28=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffai5CRA9TVsSAnZWagAAQy4QAJK4yqzVADlIyv0nSIZy\ntVr44Lz1GgNzewjIKOQfRTxMoLUkF5RGCQFPP95hywJ/M4ox/s2U7gCYwCWw\neLCu+w/VheE7kTts38xJaUsrGAAFywxfXQDCZQl0y2pIIzTky85SqTTnNEu9\nuSvTpcrU6Rn0VBOs59eT0R3XdbWtBsuzyg3XtsGyXJkZYqy7ELfkxG+yMHz6\n47xyhNRcwQxiZB4kiboE9jn1lw5VaVjeYiDp3Zpo931HN5MVg1ei3LETKJb7\n+PityQ0Oe/ZnEawvvTCmp3amP0ljXSOhvyDF7KmG+z5pUA4jOXLH5Fyqnt3d\nLwMCeftPYTH7u0utHR/FnHSjRgZatnlBK2+Y0ke4buggWljKWr5xe+QooJCV\nK4skermtmHwXvovX3WFcpyLHqkMP75yzgQgdw/X94FOwk739JUyctIIzXbyv\nl7oz3mfmAzfCJgwSbj2c175NMSr8SfV9ZSAvWF7POJuvx7h6WF4TieUuuDJN\nZDevTu9X6mwxULm43dqnFaxjYjl9+mnBgGD3DfJK0PxS7M20r5A5ADwxSqz9\nq+JGPJwUdVUpw3SCvkxxuNg3jQHOFeR6l3NBDP/dCh7adBoTUjR8Gk2zznbb\nxmf50fI3Gbnf6/tr6feLeCTnLXWvyhLvgpIyddK9Cq+JumGbyMmxw8BDwAhw\nGgJB\r\n=TKsB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e9ec707bc70c720fefcfaef01fcc63f467bddf52","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.14_1602070713057_0.41669895765427367","host":"s3://npm-registry-packages"}},"1.2.0-feature-e9ec70-kfzbr7gf":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-e9ec70-kfzbr7gf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-e9ec70-kfzbr7gf","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27ea8c629f753d3c0955ed322113161aba68789a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-e9ec70-kfzbr7gf.tgz","fileCount":618,"integrity":"sha512-mNLxGHMMzv1wSzQgKiJ3Iw9MOT+CqrAiEqf/V/eRMuuNHk0i9KdyO/6DQjnxhgRrfLRrft/CRMPyTpaIbMPx1w==","signatures":[{"sig":"MEUCIQC824XCyaZ7M56lpLWzjjBHPPN1GD2AqU2juCwQzST8mAIgRExERFiLihgMyCBafsPDFKtOCjeD2LXecw9XgTglgR8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":639579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffapECRA9TVsSAnZWagAAGtUP/R3qVegqr8vGPv4YjxND\nsj84XxG3MKmTin3j1foz8Cq2j3pAHKr8L39bK6su9FWAShAgelVQ3h229AcO\nBeblXcKdZxiOzjGqVfhS7YIIgV0dDTLhuIf866v0thxHX5cculGMqcD2P1OS\ncThR/2QmGwPOHWBX6HW73jGpPCBCDfQQq1wQdtUxZiN1Mgiau42/Fo3Boab0\nhZNH6+5za3szw47wZHD782CkmBd65Hx71GpqWJr2x3rywpEgHKYtJTsnmoq2\nnvPwXNVsA5RzwjHTZofPV1pPmln8b+r0UIkroMBnizw+4aONb556/VRbil84\nLal8Bmi1MIOVY8LJdzop7Eblv4BSaOBjNsgGp8MvojsFHFtu3P7usIcJ9W/4\nzbvm/XHXyuMODybLT/f5LTxFkMb/5U3D9jD80TunSt4BZS60uo6+QimDrtR4\nu2LfhTC5B2iHN4BZbqMMXqJ0fN+qj6IZGPIwiey+VIxXHIRdz1RkSP+ptqPb\nfli+FHeepZAiSM4e8G/VSPgOn1N4f7HQFKD2lymvF0+XWZgsR2Qj/sAPSym9\nU2wDDcJWMwK1NGShPBOgdFw9is+hsf0PmUeEFYWyoJEILzZzp68ploX8/uMW\nYAAxMLKbI7gDBdSGXwx0sPanPlSCX3njdaGi8ebBrI/erADqQvOj8F7cMNvP\n22OB\r\n=dIEc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e9ec707bc70c720fefcfaef01fcc63f467bddf52","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-e9ec70-kfzbr7gf_1602071107664_0.7891528471103153","host":"s3://npm-registry-packages"}},"1.2.0-feature-db3ab4-kfzeuhkr":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-db3ab4-kfzeuhkr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-db3ab4-kfzeuhkr","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5472807109552cb288063a394a86a322fdb1180e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-db3ab4-kfzeuhkr.tgz","fileCount":618,"integrity":"sha512-JPAM0TF1t+N1HLfAGCLUUgebBTgTvN+UhsXnbwouRMOkqObcpBRKfNWqWw7JF9cBfZu80b9NoIiTN9snkSZraw==","signatures":[{"sig":"MEYCIQC5CyZBt1y0zKunypXQkrvgS7YOZT8TYBUHFOArWU/SEgIhANgmqD5w4WwaQmVmsrALLWGt9RvijwM0Z3AZa9MJr5C0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffb6HCRA9TVsSAnZWagAAX9YQAIaMhf9D0JmkGv4jEjBv\npj3RPQqkaeRFXbexKyH/GcH0KcEtnkJE31X9SVMhHmVShQWojLI7Axr9ez7/\nYBMuAwwrJRFxjV750EojeQVGHNUKzX82zQoqeRLpFd9Ds2DpWcYmz/7ZIPwp\n83hLZLiKp+wzLMMVJg3EixZhKk4oPvI8ZiTZdHCy21PshvSwzd2fHXs8Azcf\nm8JBJFXFOPaNBZ+mCMwDaGWxN7PEsT564hx0RuLGJ84ob3SbK0n4Bi+cEOeE\nLeQncg803Ey4cJqQlCYkSpGTKekDW0lo7r8+F4XxOtBd/s4tbL2O5PDM/1rk\nJhGt/VMaDEx9kWmLwthg05kHz7hiEJgsHIkrT9GUAYt7ocKBdllLdD1wFGlF\neQgnXdD7m5zYLfO2Dfaou5x1aH9Jr7FvZdC7GDfH4UQuBwxdiLke9dcFIlvd\ngaqDkIQBf1xQSd/rzmxyEBEeH1dyTrprMp4VloMY1qGQLIPrdooDUEFLOT9L\npIGPNFbCpEG2ROm5n5PNKYcG+vIVwODaKf8B3zvcW9fEYKx0ejkPKa5PWutM\noiH/i0Pn/fV1KB7BdNKFHT8Qv5yMdSL0JR8ildrI9GqrftriT9ONJeTY3eR2\n4cb+eipnHhvtgwwCF1MEKQsalEAEsnNmTPdmGXNsF4R0KprtOKBHfo2wRYEX\n3Bp6\r\n=i/FA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"db3ab482d5a0f663146b115a19144c0916866d59","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-db3ab4-kfzeuhkr_1602076295347_0.4493257511807365","host":"s3://npm-registry-packages"}},"1.2.0-feature-c3f1ab-kfzjunlw":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-c3f1ab-kfzjunlw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-c3f1ab-kfzjunlw","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"eba8ef7c9156442e56f3d12a05ec1c3868eec04c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-c3f1ab-kfzjunlw.tgz","fileCount":618,"integrity":"sha512-f8JDi2RkiAqhPrj9D8e3wPfVoDExq+FEq5ScXeStSZZx2RPXxl+TmYjlzn5Gc2f6Wpe87OmRGzp29ybSBucxhQ==","signatures":[{"sig":"MEQCIBB2Kt1hrEyJJMMymouLPhC8bdiy6H9ybGN//Q+xMqw+AiAlA03IXguCXhrRZKLvzvZStJDG2rVJD6/GruGeSIkBLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffd9eCRA9TVsSAnZWagAAliwP/jxn/EaTdl8S5iQWcchb\nXTKDkxZVtBzeWo0lG7hIOQkGaD/5A8N8s6FuXdSVce2ISou/ZxHn1ZyTM2mQ\nSfWFf1P630FdezIMvDz+pvO7sfxzUVLgxMw/iC5dMXFtDxCDLzNMLk0iVl0i\njMrHeDmj55c+TDIYn4C+9Y7O8PzrYwaOkWwnFk93e3c96fAzd9jCjwxLeDet\nCPwwEdXJ1XkTzlJcqRPBBGP+MkOBTKi5jNrWgWnfw7V/goLgb2suzrGBk4Wi\nEL66y227zUksbfTFkzG4hDbH8dBZ7UA1l3gceeVxUVBD3Td0gQALtqEoZryO\nt7Cs4w2ea0WYUtDpRTAeVmdLQUKRY5P0XsM8dAwHHU/TY26Vq/5ZlmbzAjx+\ni/cJx0YZsC9LVadh3dgJR76SGmyeE/qlK0sAlqm7+eRjmQ7rWDHwQYc5JsYu\nB1t3WXqau2tvpsDot4cLyvWyrMjXRFgethG5wr5RCD8YSHJcHEOloDIDk71P\noRNhxxwgQZHrrYGaQysQcQul8IXhQsBhbQwavkPGUe/Wn14P5N4gAgkr19Lt\n4IHpZDs81yv4F7CtSa/GzKWY39MzRi5Rkm6Nl53bq8r8pTcGdqcgmC4ljhFh\nUUwqBE6yf+noX7Hl5KbRlYsMtO/AWqugm3rkudO+sYPX0+rkha0NCDwws6T+\n9F46\r\n=kXg9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c3f1ab6e0f920bac0554ad84156ec7c654cd0d7a","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-c3f1ab-kfzjunlw_1602084702289_0.3949059534840238","host":"s3://npm-registry-packages"}},"2.0.0-feature-02c2b6-kg0o4k00":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-02c2b6-kg0o4k00","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-02c2b6-kg0o4k00","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"217907de72f0d5dc05a5825eae06cf373b152ec4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-02c2b6-kg0o4k00.tgz","fileCount":618,"integrity":"sha512-olevZ9+Fr4BB2PBaqFWFnjxMMM7/ONB0MI5kb0gfvwm9LNiAKihzgBHIMmqoPmau0cR+ihhP/ZMbePkLha0Cqw==","signatures":[{"sig":"MEQCIFx2CljDlkw6cjYfAr6oURfp5C5Pp9yH4b59i4ROuFwSAiB8+ddmM8kNYyFD/wA/0lMDCOtVNBkzPoQ2Myl6facSpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffuedCRA9TVsSAnZWagAAaGoP/As84ExUWN5r72maXe7N\n49nwGAQPmdYZqFixt3kXcWtIfXZdxNczfpOg/+78bcB00+6+hScehGi9fMw9\nkXvaoPP/TH+Cfw892229X9e239aLeBPKUFusAxSFlYNqzqDPypET3UTmHBVj\np31oFDokW3CjOWtRUxsyK7Cw9TCH0oJrf94lPByr0Iolp99NCAxePQ1fKJMh\nxcBkgjyfJlpHVlfpZtiZO3wvIbEaN09ABJdW2cJS3UYXYbjHI1dC7ik06vdr\nmQo3LIP5gVxPuv4TXEmLnby6S0C3ykC53R/F01acDnmnG7CP5qZcAphngAB5\nVuEBEXqvfbyhi1rLqBxL1heh5QBOo8XtKG5LzHK/wAR94jSj6Ot6BOpl+Lpy\nqsmMctFTQnbtWXGi2hHNdFIB7TYu48XyUa1dRhAS50cQa1yrfvVOywak4ZPb\nC522cTo/SpsFgQk7v7M5WzuLL3QIQws+OoquYGYj+cV4oWXVh3FhL33lVRig\nsjRbou6Jqp0PWQWtP27+ixr78Uus6cH0eFMa6aOXHytzTXW+6jnXH80TFivt\nMA71+gNAvPTZHiJwgsfImyEBNTvx8PdJihlP7/0ZlkSO58v1DZ9lvjWKLmaF\ny8Mo8ZdPn+/o9vU+huOusYNuPYUVm7l8JYPxVWYbguMIHH97qdYJ+VQb/I4e\no6ka\r\n=cHH6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"02c2b6f4bfdb3e14c908f5da304db536cc0ac656","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~remove_deprecated_functionality","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-02c2b6-kg0o4k00_1602152348887_0.5968432496515277","host":"s3://npm-registry-packages"}},"2.0.0-feature-2b0f71-kg0o9dic":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-2b0f71-kg0o9dic","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-2b0f71-kg0o9dic","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ac2341d69ab54258a99eec06b61519c259d5d1b8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-2b0f71-kg0o9dic.tgz","fileCount":618,"integrity":"sha512-ax8ZZTXJUR4ZTq4iyYwiXg8VVc6uppKO4D+IZ/bTTGs10SGMhXFjXoj2hxl1V4SQOGIhBHG/btNQ+1QJQhcu8w==","signatures":[{"sig":"MEYCIQDbh/LdlMO/9IBWk7u7b9NQCkjKjOL9AscIRNfKT++vWgIhALIF0CVifDe5W/McRBnEiBr9t1vLXjE8iQyMvo8yH0UQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffuh8CRA9TVsSAnZWagAAkbYP/A6skIqh3vtkr1vmFH/q\nldvj2y1LB654KR+45Me5szRBC4jHl5PcKUjF4T9v1zYWkfpU/XvheSvYc+ck\nQcF86l8dpfESFVvzx6P+ovliteyWSsZr8dUCEXIR55/5b3KVfGm678kW8Wu7\n4cDBaZ67hxNsG/XS/+dFczoRHbvLws/Qo0XhbzcTN3aiPbxDoRwsHLdc7m0q\nI/PBCKY13Kgzzj8Fy7WdXL8USlv7pcCi+CnbP0k+u3e3bxD5VX6OFrZFhY5Z\nLeRcz4ioRT39BWMjXkfmSoN+ctZguAncp9t3SIJyha9HoIkZ7cXhK1OTdDA0\n+q8jlAQmc/BdQy2px+thCUcKVpvd5f0XN2DQqjfjMILdVpn08HZkI1VrRzvi\nWS0IKXOLUercotarfqxQNE0iJ3ijHikSLDh4X9rwZaTZa6mhqgXgwjeAR5sQ\nsabjH9QLJkZoms9gPDLMCjx6Alnc3V3N5hj9cHYKk2WrVf+G0bX+PRS5yHKc\n2WMSGm7JgI1wq8F391HiLBYatUlehIl5pTKXzbQXyMygI2rDb69TWxYKdjJM\nWBu02Q/PDvJEEi+UPILMmaEbRCjONcsrUAaue1j+/obww7qfz16rP2h3445h\n5KJ/Wr+2XbS6nR49RawmRr3n28ALCAP8WjYuWZNO2Qx4ZhkE914vTM5xtNL1\n0Fw3\r\n=G4sy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2b0f719cac2c7af81e5f3154bbce1f7dd17bc8ee","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"feature~remove_deprecated_functionality","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-2b0f71-kg0o9dic_1602152572191_0.8845002352482971","host":"s3://npm-registry-packages"}},"1.2.0-feature-f37701-kg0wxv3j":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-feature-f37701-kg0wxv3j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-feature-f37701-kg0wxv3j","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"777a0bb56e611d4b53366e1a8c839ff4c5caeeb3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-feature-f37701-kg0wxv3j.tgz","fileCount":618,"integrity":"sha512-IT9bqyeRP9fn1kgbNikK7bRWEjPEdyhxuopk4hDksg4XAWBU4yOjfJU2KL/LvL5hp4Rto7W2+RH6zcKlYztF0w==","signatures":[{"sig":"MEYCIQCB/sDw5g0m9L9dNYD9TR7/s0oC5cUyPDa5PEROWvk7XwIhAL5psfpOpI2ajyoWmqryFkxoHCzEKUf4g6TyRt9Nk1sW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffyFxCRA9TVsSAnZWagAAPCsP/3R2NFyKKlbf9nyb612s\n4qh+qysKZNaaiywc5d5klrCAGfkHUfyUS236R2gYK60H5cmy7fyLe3qu9lEM\nXtea9Lp20/uZVWJt9Em5dXCosAZKNkTY2PiepucBD3MExBV70n/J5/+u1DHL\nWPzRCGmOx8qQSMP6It6St1MPdMjUDjNQT7os0XiABboPueqjiwG8M9OcBYEx\nu9zdbBMsALaRltsB2YmB4mkiwiCjJ78nVpGWsWIgcj2MzURx9pd8LUUo4CFz\nj3BgKsz5fLYmmJEO/s5riPXqFVU+JEgyEYBvUgAo8fbvk/NSTLdWZkBZQv24\nkuOjh7r2J4Vn68z0xRsHo5Au7+GLyKC4kXX++PntngEsgFrz7JHCRTCfmgQm\nGsmVrgaN8TtXQ316QGM6tCtryHRzRGeXDXtiTWbwlAIjN9MjtTQ3acio3/N9\njLtj2KgYSKV6octK80Y5X6T2IEoVqUPyn2N5iUyAExs44uSbAPFH3z9jR8b5\nKb58sfDYIRzAZrE9Zz+E4BglFWl86lKKIetogMy4xBHWwznnJsDOPB/A1ht3\nX5py6zzpwHdxKTd4YVTYNp6tkzAeAVRLkNfiC9AmaB+Thd8uIABGGHnUm8+Q\nqBhqGCD9nZOOtsNDNYUod8j0LoL9WkHSr3h1MYLJhvsnjxWj4uUsZ4v4kHqG\nP2SG\r\n=xIW4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f3770118c99467d79352c5ed17de697c93c5f414","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-feature-f37701-kg0wxv3j_1602167152840_0.8612005470441961","host":"s3://npm-registry-packages"}},"1.2.0-alpha.15":{"name":"@atlas-engine/atlas_engine_client","version":"1.2.0-alpha.15","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@1.2.0-alpha.15","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e7f4a65f01c72c1c1cc5e37baceaa582cffa8067","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-1.2.0-alpha.15.tgz","fileCount":618,"integrity":"sha512-j0dT0uk4QSe89KLqklCMunj7aN8MG79SDfbbKu1TL4dlxbg05IDaUQzrA0CxdvPLSTr19tsyILWcY2lni9BkZQ==","signatures":[{"sig":"MEUCIQD+txhwY20JvnCS8/XvrK0QDz5CW3z5RsL/Kmm13qaEhwIgHFJnvD0qUIbkyjqoH6TCAvJ/5AosHqnoPsb31NU1EHA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffzE1CRA9TVsSAnZWagAAsEcQAJ+HYRRWcJ/B/8ADvINI\n9lSRikCtIZDJv3Sn8NlLRmcVZztZGI3I8xTxkVFCgLHjU2kVhoY7yfnZ2YkU\nDlRPmNOeG6dkd+yyR4Y7UNRi2aS81N8yYfzWMZcRBOEtZVcaDNEn8aWcC5gw\nj0lkLv1JbTErbcSagQ1yRdGsFcCTIjr8ISsRSIbAkZo2cMZD8AXGVtBgLo68\nPKkdQSW43uuJsKeMGNeJLBtqBNAMx/uakoe2SIZIYT3kjob24nuDC8T38Fem\nlcdzPSflcEVIzxE9RH5ws6JzFahDd6tHI8nEmy+pbEbIDG9AYmSQY1ZQl9N4\nIFibsg5AvF5c3Jfwz+njg55w6L59+imhKxfZCD3t2RKW0DvmBydcyWaHH9hb\nveot9rZy2lgh0xgyXnahTaJ+42teQAg66Iqb5izJFtNprpbPWtk0LOlpcaU0\nOEGqxjUPe7tQ5nmer0nymYgS97ka3OZpzOPQytsP7QG14x/CCS/JsGPcO01z\n3bONWugLX1cM6XJJ1nM3nBk4W52+midAdTd8QyvXs4LxVMDl8hW5VfY3Nglx\n79d+hNNedQFg3z08WIWYq1ksICHIiBL1T09nfVWxBJlrY+upvkd9x3qhPS73\nWRGIZabTs5dPuNxAdJj2Po8yhizGj+uKbqCTSY6f+j7sSPqjUufBBGc6S5m8\n8wxv\r\n=yhwi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"720372662601cd6b5372d9aa55bc870e8ddea513","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_1.2.0-alpha.15_1602171188544_0.7340457301035275","host":"s3://npm-registry-packages"}},"2.0.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f76756a1687884a21a6fd0d8f7f25c0fb3a5553a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.1.tgz","fileCount":618,"integrity":"sha512-X/tHLBvYo41Jf4+NnGGG+38wPekqmVN/Khr1ywkRPKESe1ZKszHuWqxuP2ZhTAODJV/4akntdMcfMZGE4hn9kQ==","signatures":[{"sig":"MEUCIE/h5o+SJF51AzonnH5saJbCpkB25XFIuCW0MszCs9aFAiEAvJWx1yn4yVvOmj2Lf2Vy/n9tuZUv4s6NPDXzA9Pu73Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffzNqCRA9TVsSAnZWagAALX0P/RB0zNzgP1Xm/FcIgyCJ\nEw+6b2coA5Pq9i3AUut1rmKNQri9RKwq2nktIfWmlhCSYk3IRLGsVBNIR+Y8\nnFLp9f3TADIFl7BDbKunJ8xbkEXxcV8duOEstOiNZYlUBLCkptLfJhaoxEY0\nq1swkPvWBp72QazZJ4Xi0Du4nAzRZW1JPjgvG83Ig08nAfd3BPM6qJvVi9SJ\nhyNOqpc5UDKliXQuA95E3XmT3EZvd+fNzwX4CGacLjqhesMNgeVaFiNG5T/V\n+4cZ0gNg8ugUxnoaX6zAMn8zJPSs1kyfMJPen9l+ZLOlaTqIChoixaKMEHVs\nKLnrtEtMKF36oecjEzCj57mJxOjLZmS5rCBqYkBefL5zdMelaoXlczjNmrcj\n2aFQG0Fsfa8mw6FKYo6ya2mu/FxviIZ+01m53esUjI3gBcKvUdtGDccVmrti\noZjc+4ZIzjWDOx/DREfj+/fPcVZqoDqx6b52F1zfAtflC70c/hRkIQSbDr/P\nhUsBd5Y2lDxeuVTRsd9ORf7+rzll+EepC37GLxZKhRAhSgQ1SXSk86VAzWKQ\nbv4vcivg3USyj1ZZHkPT3vKzXNQ9da0fKSRV5gN7b0kHi5efxXetXM0YeG7b\nIkS7iESDvVDOmvl/WUH3tkA+Pf9wW64awD008fPmTv0lW3a6leQ+AZYhAWAU\n4LJE\r\n=4A0u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f67ea291bd84739e24676c006a2cb03ca472651f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.1_1602171753895_0.3635446888478271","host":"s3://npm-registry-packages"}},"2.0.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.2","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"db488e210caf8e94bd7be04bf9e2b94954addcba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.2.tgz","fileCount":618,"integrity":"sha512-JTNeOoktdfsTT0PGSekjFAkboBkKbc6GE3nKalG8bwOxSOenmp4dwJktbxmjCSXqBZKenDzJbH26Eda3i6gvRA==","signatures":[{"sig":"MEUCIHcNFGAycGTMAHE5HRgYrVU21HO++cqLI76C9pANBlydAiEAruXvDCkaaPn6iagfCEzzDnYz6VrnDi8CjFrC5dcUc+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffzcpCRA9TVsSAnZWagAA6VMQAIXoHmDPGwCFPFQd3054\n19GVXkUxSz/MoLkoGtv9tVqMLg5qW1VgiqudNrxee3NS2rMP48CgRevA6aeg\nHVSXsov+sFmlXg2A6KnwjM9n9yLduRGmuLzGqltofsC+uPeqTl0tqTochKt2\nOVd/4+J3hKeREoJCyWSK8VG6cU7CTCGcNBGZKrL2WxjH+vqh37nj/+z5nHR4\npFw0ma5EGlLSMbTndiLhTYe9k6C29k9IK7WUvbp//cFPMbJUDgF+8F4E+RKI\nPQ66X0GYdc7FIFAWyUsfAW9RtNcYdg+tzC3ZzNAXeljh53vOx5opeMli2cZL\nHht6pPci/syhwkmTTHEMsRrK6IuTZriwgKTJdemh3D7r3VCAQorNdyPtpsx+\nbFAEiYE/DrO+lEvYArHEqjcEVIuNcW9KeBsru+EC2n9E6v+UDpYe5zSs0bhw\njyUPX28RrpH0eYxAgP1b5L2PDjd7zne8nR2v2Jbja0CSubZ/wu85JsPfsHDL\n4ZTKImt6Io453w/9IrY2IzAb1x0WNLpo4zjfA4/YJVUU3QjljWB9dGmQSwDT\nX/4RkIAze8mEPoK/d0STJw8Ueo1677jbqBEWJaHH0YISdgHQy4N70dPBosRu\nJtKFShCIpSWrhBfI9fum45V7Jbhvk0UM7ydmQaapitTtb43rZpk9tT2PXMG/\nq/Yy\r\n=Nh7r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e65aa1eff90d5a7e69e2614387ef261860bd2a64","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.2_1602172712656_0.3978914640651159","host":"s3://npm-registry-packages"}},"2.0.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.3","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0cc07ab99177fda821bcf5e1fc8d83cdd091eba9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.3.tgz","fileCount":618,"integrity":"sha512-quwE1F/GVRap+2bS8QAyi74yBZEx4BhHtlPlYADJCHOhSnaPaMRxoML7HCwk6O2Z8xf4bC/rgx+85+s/n3Y70A==","signatures":[{"sig":"MEYCIQC9pNtq1udQdcsJYl+H0XlE9r+MVphVj8bA+LRUqhFurQIhAOYxZVua/+TbeKQXPff+W9EVW8g/w3uRo20GhmW/xPRY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":654095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffzsjCRA9TVsSAnZWagAAw8wP/0DlFOufe5l+UJmpkHPa\nqSysoNpDwTeYWFuWALOFmvqwymPlnjSYjdmtOap1BFIIyox3m1rk+JmwvKom\nbQuOs4XjMeUQolEmrZifV8TcOOmKr4ZUeQXkLMznuvXQ35XJ1tmJLpIkvuk2\ngbdEMwqRBXnpirx8cenN8xmu1EYbhiDIFMLTIxwJ6hRrHOrVfFaaed1XxX6c\ntOYRHcUjs5jTtJt1ScHyyLRrB+Y4VfLWXv2XeZjgbJJDoQQ8krZg3O/FkeO3\nSjpqwc6dTr4C+echrvFibgWAEy/bnE9vRDqsI4Ek5ErKJssgJUucFTiupZqV\n6bqGTefVEb93ZjfdlYTXCqX7ibBv9FrZlqaoxehXQCs4rhV0o8YNBLNtexDu\nXyjJllNap7QbK1smjAplYG/KD9mOVYtVSM1/n31tJESceK381UYmEuyxbpak\n2MocmQT4j8vf/o91T6BEatcNanq1QMMQSOr9RXtlKm3JYYSShsILOv5+x+f9\n9neRtnr769/vlDx7EPyzDG/G/kf4xK3s95LEz0SOxPoJBQmCr3BEyE5VQTq8\ndkHm1Y6b/51zEdbkqdRw7wMllKbWKBbhgylKavPt3F/Lg5b2yhV9GX5Q69ms\n8yCyIy20w5TkpPJHXHmELsDWZ3KykGPWFS/5CjPxDf5nuep8MYS3g0NhIs0s\ntHvN\r\n=HOUD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cabc81a19c15f76ce782a9b61abb7c14e0133c4f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"^1.2.0","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.3_1602173731092_0.24706869708884316","host":"s3://npm-registry-packages"}},"2.0.0-feature-3aa0f1-kg21mz84":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-3aa0f1-kg21mz84","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-3aa0f1-kg21mz84","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8a5342f154bb6b3979ef913d6f5030d56efe341c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-3aa0f1-kg21mz84.tgz","fileCount":618,"integrity":"sha512-5zmsqGSyBPU2nQBCCkV0Q7gNuzkGhtiuUm7eu5o7yu2gSzyzpDZd93L0In4miGtPAK4znYnOrDyIshCsPrsHZA==","signatures":[{"sig":"MEUCIC2k0kj/isQCMDb0M4Kyo1GfoQPofndPA9JjYvk2I2YwAiEA4YD6x3adzGpG/FgNv8BNETZBoK/xjn2Ru4fWXBmJrrE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":637518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgCx1CRA9TVsSAnZWagAArtYP/0/GfVZEusB4jlwLOxoC\nD+YShlFPkI0N/mwttsb3XDCXWmlGfKmtWdsJYud20apEmje8S2jr+GEiA63o\nH0oE69w3ePDya6wW3MQ1iqAJFX70WU58SxgYaGnDZWh1RsBFWCnBmGjbr33C\nVvRwQh7xjgTwyNLGa6xJctHpz36M749LI2RbhJ9GOxa1SIojfVB3X2H2VuGK\nzkI56vIYWkjFIcTgg+3io9R4a4nDLOf743sncyN90sTUhMxQEUVSZK8/GjMO\nIG78CbMZZQlvM8Db1d34p9Wj01qcgkDaXluHi1Af83ojvxV6rJ78+rQzmVpe\nL+2A5ap1V2T0u/xOmSoF/F7xLOsBvC2h5m/vwWC88iBNpqUNJ6Gdo0YSFhPl\nvK8ZVWfF0xfW4BwHmk5ZkJWLQVUo4BR73s8xBQFOGmtDvhHvg2N493s8Etch\nLmZzRP9jDmCLXAXsM0PAYhN8LQYTlvY+jtntjIld1I73Cm2M+aT2IoIHlu/6\nKrmx2UOLa6FUQouU6qbdblG2x8utHY5EvUo5BuQ2DAEb3LjxYNUYRLjq6p8B\n2xsYMF65EMyhYIbUY4OEicOcIcajdZjQ37TEEHmf9hfL9N4CAiWlRwnDhViR\n3RdEvsnIddzeFCTbfu+yBb1UlHk7yu/k6c2YCPz9alruonUbBIBXMN2Dto+3\neZfl\r\n=jDRp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3aa0f1e37de8c2435e532174a13de549d9ddaed7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"8.3.0","clone":"2.1.2","moment":"2.27.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.0","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"6.8.0","express":"4.17.1","typescript":"3.9.7","@types/node":"12.12.36","@types/express":"4.17.6","@types/socket.io":"2.1.11","@types/socket.io-client":"1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-3aa0f1-kg21mz84_1602235508480_0.6426091937614036","host":"s3://npm-registry-packages"}},"2.0.0-feature-7f6a25-kg21tzrx":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-7f6a25-kg21tzrx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-7f6a25-kg21tzrx","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"888708e7c6080952f01fe001afe2afabd1a119b6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-7f6a25-kg21tzrx.tgz","fileCount":618,"integrity":"sha512-wcbZJV8FFOoWp+O/jo2QTHnfK/2iijT6RO4X+q/OgWGLquY459HuoZtVdln02x+he1ggWXOJ2qv4lXI822dmLw==","signatures":[{"sig":"MEUCIQD1SP5bpyURKOmvxKZI0um4EU7+F3D4AA5GzJwXW9Wx1AIgAniPZQYqhsZYKyBTHaUK0CVs1FbXRDd5YDLueC0/t1g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgC27CRA9TVsSAnZWagAAeD0P/j+nkAvakKVEKCPNcDOb\nihRLKMxViX11i8xkN46hfREoey8N2ruIjS3OpdsrfYD9bkChfthT2zZJbpkc\n4BRJ483G4QlCdtou/Okf2QdQ+RnMSYezP0sq7OL1stxkMv2sP8WYa3c8W1kg\n17Aa5gThcmdpABEPeufyLz4wkyfnPQeYjfqS0N6I3koj+R1S/QoYrgNHtWco\nRPGnBmuRwMDKtYsg+oPwpMzq24KAB8YKaRyYm4AOSnGORVbhE+A0J0DolY0M\nkG+0i+vtj6FObIiJt0/69V495upt0SoQUPyKU4EVCfVrIT4rHzasFGo0apun\n6/b9HaXYWijm6BR/peQCfeT5VPBp3DQnRBVSNkhCE+HIka80jgY4lU97XGvp\nGV9SDREKOpS7sQvGMl/cQEx32Y1NsSncDvm64FGa6OTiYnzVNSPVV5W9g1qH\nDXL7SX7ch7ZQBunht/2mfF/zHKCPL2VywHe3V2b9Q8Df1fo3w6kPI46+jin7\n3SS8QYJp3nON0Cl376GntDzOKKQ0O/IyGOnj3/OcpAxovzKT9T5G6nopf0Ng\n7eBI5BlKozYh67AUuxhRkWXy6015mqrZ7CG8/dlH4ScaJW3ylCISn7/V4DZu\n5JrVH2y1KbKTPbYd11CNfdZxiTh4OmWRy5pkbpd+zmYgUxkVvZmETV21mSfn\niPFk\r\n=tTUF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7f6a255253507356731fbef5f0f8f238860ca386","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-7f6a25-kg21tzrx_1602235834750_0.4300320992321549","host":"s3://npm-registry-packages"}},"2.0.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.4","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"133334edf42fbb6bf605e81cf22a2404a38e0472","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.4.tgz","fileCount":618,"integrity":"sha512-hfG3RAcYjMaBeF+OlTLXpwfrsgGzV2v3Z9Bpqj+IqGeZoTUqa82kxoDkUnBWL7dntIj6i8A5lfRMLlT+H8G9cw==","signatures":[{"sig":"MEQCIARfl5gPkYgtX0gLEFaLYbRXcgWUPX0wXqU3ryBjJ4mEAiALHnMoHbjeNAr22biM0dl3zBxDWp8O7pJQ8cnlWbDJ4A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgC8+CRA9TVsSAnZWagAAwa4P/1sM66vQSSloG2BSTAMS\nvD3z7ne8vwpe32qNQmb/N0x4JVT7AHIzxe22/v7cu6wnRzgAKj8Dl5zHjrRm\ns27yxB1fDHZ9glAoibfZeHoA380XG2jfa0XLQZTpgU1FMJo/uyW+dDboJthR\nVWFZcwAQitDzZkOcQyzlWsvtL74YbEZxsj1B2rZQPK40S5ZO1tYUy0HjSLGZ\nULdf6fYnxm1shKgpr3SZBoEmZtXWYK6e4XOLV9duvIV+QH6ZN3BqV40+O6/S\n7wRRCIUp5iHl3+QCe/34rNu6KVYJCLrhyowDiQJZ+ImL1Z3N9dqzibB7H689\nRmUC1njVoof+eQDL7sQLtGmauPoPws7gAqa9nqAgCmEjZj1+f9i8AljSVD61\nFfiSVnAIG4a8oEi5uJJKJcyP02BP72MrBGXGCTa2cYd++EczuGFTTl7NdDZw\n+LWMN7cTZFbLW0/7f7n2RZ6vSxhoOWdS1Yz+P6bdDCd9CipFY3QbE9uWOQi/\nQHliC2Znye1RtOwSvImpxq8/vL/ZfuqUkZFX6oMZLJQx23zvig9G3PAPrVKq\nwEn9vdFdEVcZ1QvN8cHeERvcJhrgXMIM6F0ERFtIYUo8CzuIZ2X1tHsRlHi9\nMj7qePM+OCouCTlmeJwg1IvP6E+Rw/Zhofa+B6YR4hW3dA0UZmUC2FC8ySxG\n3ydP\r\n=1Ygm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"732f3e674b3514493ec34cceec3d755f83ef020f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.4_1602236222345_0.6127658023781504","host":"s3://npm-registry-packages"}},"2.0.0-feature-51316e-kg24k7xr":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-51316e-kg24k7xr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-51316e-kg24k7xr","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"69727f8d04406385abdcdcc9ac0148b25ab42106","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-51316e-kg24k7xr.tgz","fileCount":618,"integrity":"sha512-oln+JYPqkSZaFIgZXdIXfR8moxOnbsZ+0aXPrZn57aOzds6SA1553jSePJoMQ1sqfatJzX4wRxws3riiKlQkuw==","signatures":[{"sig":"MEQCIFISJN3K8x5W2rMO2P0vqXS1seMH3H4lgfUVd1o93PJmAiBuMhtRqITfjq0BmyP1F+ypXBICqOVVpECnlcBAR33Ipw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":651884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgD+hCRA9TVsSAnZWagAAEvYP/Ruv3iXr+lZdrKIKVHnM\nLANbE5bG1HzwIzAPcirrnSSpBD0kSx5KbYu0CB0z0PPYiF3o6djIQ4WYb0wQ\n8Vs3h8lAtzdjkJ6rql1Fb/mRR4y7TR11h1ih8uNXqD+X1qQwydZBbT1P5G1N\nQF7a5lXOhnwATOCsljx2dtF8kxNFN+RG4O+Cic/4DQFI5wAAbEBRrkHh+K0K\nHOnZZ6/xlwaqaO3G1t9uGQbjtnGszIj0tHGAzmHiZQy2mGoV+tdLh4dJSzr0\nAdUYXBJSRVuA5IJCDxpnuZExoL2qUeF3dctp67HLGOvz88CevNmSAafSSPeD\n2OQOlaSy2ljSEinqS456TY/0TfsXK4bSLUhxcthzSthc6FBSQsRPm3fXlaK9\nEJUa3Y2/08JG/GUc2GErGSLmpi31Wqx7aPcOGY45f685Lli4XGUkghwx+wSk\n1SROy6HmuxhiXrlaxKCcYGDkGo0fFYcZ3sk7tbkFf1+MEMQf5z0BRCRDjqAB\nAzRm6tiKSd8R5/rN4ykfdFIbuvHN0BALIzkMQEvNczoBpzg6KOZGXbACiztg\n9vFBfzrFmDDT9Cg3ptfvPcCrPJ/49NFnJm8JAYOIML2EFarSbV2I0tCjxXyG\n5wijkCX+ls67Ak1+9QiumbaabJ7ssF0VND6wr1Fjb6ptcvxyqUWsGPMOo9yn\nP0vb\r\n=ALqZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"51316ed6000fab306af93a44d3efcb5064c3de96","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.6","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-alpha.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"feature~remove_event_aggregator_from_ioc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.1.0","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-51316e-kg24k7xr_1602240416918_0.541299404588305","host":"s3://npm-registry-packages"}},"2.0.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-beta.1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fef2ce379bdf7ee16eb0600cd69f4f0edfa00c58","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-beta.1.tgz","fileCount":618,"integrity":"sha512-ze4HBORrVPLUalWEU7wJYj5vF3fQ3ZIFKQOmxqQZ3dZDnnr7Hvtmco14vmbPKJJSNL6sBneHTKfSiEXCImjyMA==","signatures":[{"sig":"MEYCIQCjUZHtQzDxhTYYfAle2tBRuLYKIpAotLhOBd1/tnld0AIhAKkrko94hxrH3DziL5PTYN4SehY1JYP6pQonn5tDGa1d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhtKhCRA9TVsSAnZWagAAN+cP/04XlWS/iT/iOCnI1WLc\nzDdGLlQH1q3gxfGPakQ3xe1VRpOhts83n2Ut5PXBKLAVcZ3vM0de9kwpKwyQ\nh4XWKrM1RkVZwgmsjZQNquu4sfu34nGGSk3I+p+8xBQQ8TQbWvqe/yhIWc54\npYZz2t/jASbTYQ6OmsZL3WPOlezRYfsJqUcdWzWuGSGg9iS4ySalstdGTArj\noqkD54/O80dXI+mfcFUXwrxbq1UqXR1W533OXWDpe+2CtVyLuqx1F5X7LazD\nV0OrBEgviZucC43dB2u/0gyvN40Cd+8n5aJznb/mxwc+UsTE50DJ0i/TZN5O\ntLHvcQNo4/AG4tL4dwDbeUPAby3SGSdnju6GIlcPghkXFQS1Qas/yBuACHp7\nu6uFyFRL6CfWadE20u6A157f/uPg1/6HCUQyKb3BNgwE7kl7cN4dLPR+HWy8\nDw2S274xy5e9eZsjiY1NqNZEfZN45bIjSFOrLPEfPqsCf0SP8pDiI3weTR+P\nv5ZPOpWEuCpsg6DEzxGI8tCAR9oIlPbsJofokZ80Sbzdmjdv3t/UBc5gDpJK\nwENg5cJ/333DkoEOopGVA2rJTCSRtU7zDeSaoRIOe/W+uoYaQ0I2IOejDZFF\nkM+nly3ek7ODoIRmP7PWt5pBFnWZE2mX7PuwrWp6G3tvPldoa/X4FZ6YNg8K\nKvnw\r\n=GUfF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4a027044f13b42a7299607197e3b98f531793c3c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-beta.1_1602671264747_0.544206720956925","host":"s3://npm-registry-packages"}},"2.0.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.5","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c364c3882b8f1910665da0548d6234c6dad6b8bd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.5.tgz","fileCount":618,"integrity":"sha512-Dvkn3SJPTTJYn8rMsYRM9RTXgW+PkF6vOQS7ZBZ1xeb7ZLPxV/81PAproGoA+MDkF0fcfzWsZBgqVVFnFFOMUg==","signatures":[{"sig":"MEUCIGS+zpq37mwZX3ZpBXrTeV04an8t+kzbNIyuAJcr61X/AiEA3xFmtUln0NQFxM96A+DofMP/iDnH/nmkeb/YBALJhlM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhtLxCRA9TVsSAnZWagAA0ioP/iw54qns/xfbyW/qIuJW\nUZmBR4PzPosm46QfHm6+55hzSyjPTfe077pySIyIWb690p7TK0U6nZk+6Aar\nQwnU4H+7E/sGz09BaCGXv28IyZT0o9Gbcj5Ds4RmqrFCLXgg3ktKUGJQDIey\nORnp74DCoe3BMfXYrwjsZFGYBayr+tSLwKyPSr1zFUE5xN6vF93+W1w4LT+7\nVxE5/rFwjOA7yZV5APT0I5YDvPBQlKaz0EH0uqJXrQ0F7AcS11Qbc8G+r+yo\n597b1Ym936//xwa4dfZdZL05hUsq02rmg2tGaFB1yFOpFJ6WZPNu2AZyiYvA\nA0h0aJqCjnmKfY3TyBKczDl1BVdNbhFdxoomaHgJ4uwajdlCgVX/aX+q32mU\nNjVqQoMUqNxV0h9lxuGKE0tofHuamQ07WDf9i2DqVyhIyxeKCyzpIiKSqML4\nmVXHPNlHSuh3rDPft8ju3eyu0p58TXxG1+VSO8GYRVMGOvChtrbLGgDKTig9\nh0i1r8mUnhd1t5EGI/+0IVEiNwi3gqnmxbWsv3Q8+nxEUkaT8s6Duvu4tYCu\njhJNmT0GuR5pfnbn40GnR3cfyKHDhbTxtUbbgQLQr5tQGUHwRosKrZrcOfib\n1bviy8lioIVjBHibWgg/2QDtlZZsCDBAw1TQ20YyzzXdS/rbuexqmbgz+1oi\nyyEK\r\n=wq4z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b1ed9dcc96729cbeb2735e537755e1b3e013a4f7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.5_1602671344632_0.373149666015828","host":"s3://npm-registry-packages"}},"2.0.0-feature-1240a0-kgc15zg2":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-1240a0-kgc15zg2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-1240a0-kgc15zg2","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2cf0c8fa5e62ac9e20aff8a1b0f515417f107dba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-1240a0-kgc15zg2.tgz","fileCount":618,"integrity":"sha512-hVOhvs6ywHsDwRPxlsmFAWyRcs6Z9Yj/3LMzWYMavAErBuX9AqVst2ar7Y2F9MDpyvELjj6fYqVPDRq0SlCi4Q==","signatures":[{"sig":"MEYCIQCNUnINfKKFhkGX1dhYbbpHAXCgESE4og8ma04gRXhf9gIhAJNjFaXpHn/cb0VvhN/ccwBO5Yu8zoyWq5XtKZvOo12q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":651845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiWNSCRA9TVsSAnZWagAAlWgP/jnEznc3uB/6uvH/uO3y\nBIUYSbb7Bp9U0lSQuchuHaCGcpzKluNJs5mi/btt/gOPZJvqZZzojF5oOLmy\nFYWixVELg4czMLCsilMh2nbULwTvrYUv6sVhLwf0Nc9O/oiyINiSNbv6kqT2\n/GymcjHTuCElfgHgKa7ZyxfTbWL9Jpufac1JizF8KaM+ctYyC8h9tlaKWnVI\n/nuudLkHN3HF6PWbzXUxAYtwXxwTNvGGcc7ehu3F9Aml4552sxaTFbWJxY7L\nhuRmz1joutFiRWj9iEM9GbQbpJ3ieTIk0/TL7FVXrtoGmUkd0kGOcaiyDVh3\nObbTy2vtj/xKkgtTjEj3TYRE6iYOLAKR07cKPz2Of/YllNTUmAypXgPJgICH\noK+tXJtMFDQVsoYSYvXG5f9yX6sXM3y/F0zSSCro+r29/HG/arf7+QNuRzzx\nhe2U0bP55cJ5eG7wrdD6UB146fFutTt/sWToN1ClPx0sI5MAnvxh5L9jyc3H\nKljFZaXvBxeIeIvhYhJaLEGJGgrO//6xElyWeRwGnDLAP6SKfRrs7abRHZs0\nnBro5w6qs0a0NIogVWihBvHvI2qQV8FJTIXMjq/DUvVab6q9B/Z/VrAqqnSl\nLbxT+zwODTULDlM3uBIcb9a5vYpNnrx3K20zZ3CKu+yqKA1+K2t31UnotUom\nFrjj\r\n=Fueg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1240a01985851940bc9f77aa7ab32097609f7365","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-1240a0-kgc15zg2_1602839378436_0.20021416580596996","host":"s3://npm-registry-packages"}},"2.0.0-feature-625201-kgcdtz6w":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-625201-kgcdtz6w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-625201-kgcdtz6w","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dd1077c23d8edb290332d4f687375c6bc2776005","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-625201-kgcdtz6w.tgz","fileCount":618,"integrity":"sha512-MYiDwOoZIx3TRjpPm59l2f+yguABLa/V7NnsbxbdqkVT6CU1IRMwQCBShAqrpOPYqniRkXqhFnGCV4nveN5fgw==","signatures":[{"sig":"MEYCIQColWflHAWxLkfUcmv9Uk5lem03yGRrSHx426iJOWo6TwIhAOauVoC+Gx5v5FbXcq83DbDt/vLvcyj4i1oIda4krDNS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":678386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfibZtCRA9TVsSAnZWagAAWywP/0V0gvpo+A244UzjCWbs\nJKiMPizhKu4C9PcIeCe/tkFifgZDEiaN7srN4UnYmeNiXt4bwGyL/JC6ai0w\noMmmsAA/gLIToyovbhBIVaoHhaWnTjQxtALfFa4D6w22RtbyWVURuHBP8at4\nZIiGQkzClKEj0j+C8pTfhaczYtOOBwHjQmiVaGqBP4LoKawWsVFCTluiHzsE\nKSLxGqtlbdItL7XvcbSStGda4+8kY1/aXKx4UzTpN8d9qdKGyVL+YHIKSIFc\nASXN72+XYG7K+GF3tcdmAxV5X932KN5cGVeoaNUnpVSSBB99YpxhgRVlCfHD\nPOkskydzoOUtWFF8TJSUjxIudyVBAz4YpAcTfo/qcbA0vBGlxZT0gQm2tr1z\nMtAajaX/4cgQ4CZA0PvNwCCFtfJrp5DE4RXeR7RyM+6v6mQwqUbu8F+j0uF3\n6Z66XkZEYWgE20lqo8RckIc3jAjbTaCpZDk6O2BSlOYW8lH8un5K+ej//jg8\nqLgB8ie45UtSN9S7n8Cup9suAwO5H5LbgiJRcwlvmjs8HAJLy5L18pjVR/mf\ntISL1jmp320rS41wL6dzb7rszoK4+8qnQcz75ucile40p7zMXp+6npErqu/P\nkpHpkg5aE9fzFlbQ7J+GpNu2AOEAlXF6sBGhLjKHThDbF1hLzE2IgwfeH/zB\naxos\r\n=xMCv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"625201eaec818fc5419ea1e3524574a038aa16bb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-625201-kgcdtz6w_1602860652611_0.4410119080393271","host":"s3://npm-registry-packages"}},"2.0.0-feature-725d71-kgkufpsg":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-725d71-kgkufpsg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-725d71-kgkufpsg","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ef929e1ecbc94c323bf249dcde424976885259e1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-725d71-kgkufpsg.tgz","fileCount":618,"integrity":"sha512-ul4YJ4VsHsp6Zqm+bU28lxV0WX1VnKhNkBQaVshhZK2jyTGBpxK2cfIB24RfcaWaRuybC8cKRXlRGpzbYFtzZQ==","signatures":[{"sig":"MEUCIHB4USVyDPHGNWKgEt6zS1Vt1eMMoXVZK6a/31bvcLfzAiEAgPd8cO933XPwYot5nf1qBdkxxv0lrMNRAdO5pjTHD/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":651889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkYTsCRA9TVsSAnZWagAA7j0P/3ZK8GsfWvIW1+Sp51Si\n2OrXWCTwdlmFaRy3tpEjNMWS8OvO9KjlwDRJpZdeh4QKev1GstT9CDVS0cf8\nRnk8JwTnnDYWLa4g0EsDOAsD7qIHBkolZJNM7a/CF8fNconaxaJIEIEnuuFi\n4m16CL/ROnrErbp05xN61YEzLs5dovR7Pw86U1h1mv2owDJONXuA7lf6QGuE\nj2ahEDU0hoJx/4VBMacEvJJXsJGlCpoqf6Cpkq4LnSmgtJ582b+UPgVX6jmx\n8cyjmlcak3v1b9wtoUZhXK0/dFBKPw4hMB8kqEFuSbDjj8qYMzfa1tvrcV5O\nXGkI5faZ5RKjLjQJfSNL4ffGZhv00tkECldAy8tTCQCloVQ4sGRaHwFx34qB\ncAzG4v67nWisJnNfNOJxXsCMYmKLXfuIxVPbz+wr2A6ouO316ebKp5pbz4OX\nsej6qpZZ+K1qLHiWey4vBNwb9VDyKPJ6UHpdp5yIMlAdO/9BhLbomnXSHlG/\nMkT8yUk/7DXOuqOHuFd5qFtoEw/TtHwn3MhOV2UND/RfP3u4OK4NlJLzX12h\n1cLypJCGbR2fuQFV1sSSxoG2CfneM3zsU4291M/RrqZ8I7FOyh2mYMqQR5eH\nK9zjs/bdqVCQi59FmdEzwFkEcKPBBNWiRojklbERlyEOKWuYlGqnjw0s0WpA\nKAK8\r\n=umgT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"725d719297ebe7faf41255a8a465dac3456e1a20","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"feature~remove_event_aggregator_from_ioc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-725d71-kgkufpsg_1603372268204_0.2545170790814737","host":"s3://npm-registry-packages"}},"2.0.0-feature-6ef479-kgkwhmp1":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-6ef479-kgkwhmp1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-6ef479-kgkwhmp1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"46170bae35980865cecc16c47eb3b42764d10460","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-6ef479-kgkwhmp1.tgz","fileCount":618,"integrity":"sha512-YWTYgtI3ktdOc2kNKmFyozUaI7yYhAajW31oh2x1O2bNDO0OtYtDFMtQD4wxOgFfqYoQPJiUkA7E9QOGRhc9zA==","signatures":[{"sig":"MEUCIAooKgO04edOHR9/QfgFNdlDW1WHPsv4bV0v4uj4/4oXAiEAjpIcgwOn610u2wpXOdKRvwFi3q76UQEIMSf5HDAmyVI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkZJoCRA9TVsSAnZWagAAJ4UP/jYtPpuM7682DsFczuuw\nLhOBhcRgTTz4AjsAujPKj7UP3UQwaGbv4usZVWC/Mi3o3tUmi/8QjdqB0O4m\noAxjFzaiI3HwzKmZ5/dy/zMrAh4IUOOd5gDv2r0cIbSZpsMakFuHondPmUKO\nFeu0kd86MTczd5UYyGBFVMqx5KiWoFRhjcN56lZMFvohrqb5zALhAVZIDp45\n+xODNluaUR2IL70wItMYTDS2SL7LffK5YYDkd0tRWdEuYltbqRPL+wKzkPwn\nfckhqzSpJ7RdBjZ5ecPZVSoEFGB8/xkOg20NBwkj+uFx6Ws2/nqZYX47XHHR\nEmEhxpDiCyjt6+Zar4dScrkh1YAhkqWHbpJLBSMVdzW2P5Xx9l88ce00qg0y\nyaumrU0AA3v8AQdYEbgdRGV6f4GRn1foMSXNfaIC6khotpzAZhbB1B06x+jE\nKNG7vFvFcWnY7D/G6pdpA6QqbdeCuGs2W7f33VRevXGcD0gakkxfewSgckAV\nkPnzgtOvi/Jb0JX41MFXuvKpNjlswtWHYdQku9s+tKrlY6H4XTbdyawfLZoO\n2aPjGQMXMEq3JJECDSGCsmhy5xWuBWLZ/yhCm07Ax5NBxKYLcAh5UI+n4DDt\n6yaf8/oMbX9f8voEP9bHcn4S83rwTRyxf1d5uAoR23/axGC8FqNh6ItGRCjb\no9sL\r\n=O3WR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6ef479184da56a4c13aa8957e309af8cd2f07ea9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-6ef479-kgkwhmp1_1603375719368_0.49858390892531435","host":"s3://npm-registry-packages"}},"2.0.0-feature-5dd74e-kglx8hkk":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-5dd74e-kglx8hkk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-5dd74e-kglx8hkk","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"19ac638cd854e2e69aec5cbae07f7591a718af80","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-5dd74e-kglx8hkk.tgz","fileCount":618,"integrity":"sha512-qyT3UuS009IbPCn0Bcr0mXF69bT4fWbL1Fi/2bnlJK6hipbf0DoUPWlvKGimkkQR4AB+SsMf2V7vHaM2woI32g==","signatures":[{"sig":"MEQCIFZDXe6pQt5oSBEl7WCfofCTA9biHnoj1ZD+ntS9vKoMAiBCJFupWres94YZfdEJGLTpzcMGAuCbo/Y6BiDncd83Yg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkoN8CRA9TVsSAnZWagAAQjAP/1ZsOK91aYlh5JoAA5gt\nW++Qe9ZMSEVNXYFGv+ThdmUmrwT45l3P5J49Y+DgLqv/kN4V/KIx+AYdtybN\nt+FW4KSSyjOaOLM9C1ekYzS8/FQhGqVaFJblbChBY8Bd0S2PUgBT0GPLBHwK\nWBkMb8mBx6JL1UwW3tiq/dN6Bd5WcNGrTWmoewHdULhgBGEsKY2df6pgOcSp\n29Yoe13YHOZzrF3seh92KfS0u+z27fTBSnz16PVG16L6eX88+hF3dd+BIAgD\nSd3nI+wp8DxIvM5AGsSBzw4xA8qrwl690WqXZGLQAPaC/OOyUkf++cSXMoCg\nX8wVyWxdvrh//9kFOwhZUQW28DoKo4ucS92mVxEfWa/MnFgiuU7fn+2Je8D/\nL/351JPB1o1oSxFKQ5pvcIOOBWx5GYW3e5bU9KP/+f/f0g8AvfFc+y2P9kdI\nnvmD5bD7H0HTtWrVqUxkPFaA02p38cg4Mgz8m9toZz45RcPhOTsjxJcp+6nU\nBh09o8j5nNJKcRoTB9b8abtbTIsUO+tLpMi5kgj7kSvQUpU89TpEiRJrIEF3\n76TaL9LyzhYpnCcDxlHr2GwUAZG/bY300l0AEM4Mt6wNGdke60FeH5ybYhnz\nLGxeEVixy2IEvqdmQHC4oMR2GD7M2iThqnTOTZLGMEeuZ8LAG+4XPZc0JImA\nJltB\r\n=sOe0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5dd74ef19fae45d76a9c1f7b8a5e40c09199cb23","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-5dd74e-kglx8hkk_1603437435601_0.9965093528176616","host":"s3://npm-registry-packages"}},"2.0.0-feature-9ac89d-kglyw8zw":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-9ac89d-kglyw8zw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-9ac89d-kglyw8zw","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9fd0571803f53f66784a7fd0dc03d6dbf67b084b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-9ac89d-kglyw8zw.tgz","fileCount":618,"integrity":"sha512-MvEV3yJQ6cSANXeeomowIj4HQcqXUPVf26Om/31THEg9k5Zmck6rPay4APM1rnzSlSUeGCAZe76YDQlbZaiQFg==","signatures":[{"sig":"MEQCIFk1N5YDQSkPFxh3t1FZG/rVaXKc+1ENM3NPIQm6cjBSAiBO1h0CwdSDYLkWjSe7LFjpzY/38phVeZGbtmq/6z/TQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfko5iCRA9TVsSAnZWagAA2xUP/2miI3OJbfT4aVh79dxx\n+P/2rMbx5mfGZjvE5svpFlUXWftjgY3V0N/36H20RVubEqGAqIkDoMBhJJIa\n5SkrqvrFqd+GiMdI260dlU6e93e6KSvgR9zhF24dRr0JKZG+9yVGXG5X3Zkq\n5h2hbfHpJ9y+y1rCCCYyYW4H+/GiF7EhyybW5Pcor4Stdh5YJd0qzQniVfgU\n558V5BZ/q4tvWsZHXgHLjI9zze3+TveJoQuNKkox0CpEJzo0KiONOwVwlhJ9\nbsE4rfgqJgqSBuuhYHugtyHZx5xXioaK1TWA2Un56919DU9NfGRdnmjxmmFB\nWXmknxYzvVDzUQtpP3fYpt+DKAqVdIUlSXqeuR1zXkR6SeJipOjOP9yx7mlU\ncat5gTQ1FPoxQMBgpGbsm3n/a/fqiW4CHiGUVbcan1uJIN+xYR30z6jLlVQc\nPhneeag/mh9kJPS3nzs4FPY6jvzdw2LdZaHQkoIUxS2o6srxHe2o4KoryfA2\nwK90yZzpTBlkjWc4sz4bNc0vQwehY/lryil85psB1Tk1OEfubfzFvhLjZh1t\nJZAOI+4qptiConhXIU7cN7pCvDsDK00tw8gpx7IvtdmBPUEHkl9QW+muLMNC\nvda61DEIXIs6sKVniLb3KdRZoPbAqP2oaujj3XTY7A6R1+jmytFa26748ooi\nG8Vf\r\n=mD2N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9ac89de087b5eb52ec8ffdc9c16e517a91c887a2","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-9ac89d-kglyw8zw_1603440225511_0.7839597622023753","host":"s3://npm-registry-packages"}},"2.0.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.6","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cdb0ad27f69355c49ce463655578f8848845a2d7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.6.tgz","fileCount":618,"integrity":"sha512-GEPyMZza/9uz72wuOEIs1diKeyr0/dd4dlGb7ZMLX/rt+CKpIIfLZZXJNgIy1hl5Zd7ZFnhmtMTkxyTFVx8BCw==","signatures":[{"sig":"MEUCIQDWGqUyceEJ/c46j020fSJ5LkQUCYksj1//lPtG+QTCnAIgZQsmQk0ef/X7/IzdiSlCUj+y3jd3qk4kJlIemxY1PV8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfko7rCRA9TVsSAnZWagAALTgP/14ab0mzPcVbWDQbDXP2\ng+V8DItNE4EHUPn1qLP7j18LHN0MP9VW4a2H297FW3bLnhzOA2uE9PKXo3Lr\nuN7yLpauotLM6OM0HkP/+WcjHYZDIkFG+uQfDIiuobctq8CFFLcy/DkYbnW/\nzGcA9HU1pMnAgGQjJlNBHN2oPAevqjqBBdZhsVNGB7f9btdFGs3KW6iSQnWd\ngkRSpUnxd0UGaCzC527Utt0r8tqETJibY6e+Nd6iKQ+5SLjrx2EAwmlVnqac\n4V4xag/vjppEzvaGaoBBi/mKF5K0H3ZDIoKrEHdIOyIpIvMf8byPw7bazvd4\nKnM3uKN6Am4ni62VjiO9py1rrKvg2YPmEH6RSPktqY6TnTPteB2a0drdTKMz\nnUvEXwiL36QM6osVPQNZb/T1mLOmxU+9f36IX/sfir47OLZ5Q803zjnQ65Xq\nmpplBek6FerdRQnK1uqlex6Gn8TvtnoWbkD7uh3Z/SnKmDt6NSenbIAjoGvS\npYilktvu6gHBR9A8UT8Ce+fv/RZUbbjsFk+yt9nQS34HLwGYN3klaf2qEAlF\nQTDK9hKswHIUP79GbJRbk8a1FyZzzerXEddSUSBHA2U8ESqbD2zM3S1gz8kW\n/O0UWsgnIzOM1RkzbW1yf+EeSd7etFD4gHvMzw7jf8xkz5+xRadJiqYR831F\njMVX\r\n=SIxo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"447e279b5d0b69163bd5557d17555f5a795ab37c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.6_1603440363309_0.8163510065040946","host":"s3://npm-registry-packages"}},"2.0.0-feature-f65e64-kglz1c6e":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-f65e64-kglz1c6e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-f65e64-kglz1c6e","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1bb84e44b7db9447fa2996cd0e8b47ac380da337","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-f65e64-kglz1c6e.tgz","fileCount":618,"integrity":"sha512-uRG12k+xQHG3yP9KX1DbiCItGKL1ARgfe0AbI499CCBhbOURClJX6AtDU2Tzs12+y48co/kGrVRXcuqJuq1fNg==","signatures":[{"sig":"MEYCIQDbAiaKLWPD/PCXXsJ8KvEhDn62lJAyXdxJI6DJj8hfFwIhALrcSK1zE4d4DvYAQED2Hp00VnauR32MJIGr5FuxASzw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfko9RCRA9TVsSAnZWagAAq7IP/1ZTCT9YuE6no93qjcqr\nIrcjfALRBSuftmhWo41uLeQCgGn9+pXyfTqr2aAREOVUvV39dWs1CZoFYM05\nRNPsVErorPUGDkzW6e8LKZWJ9iQQfv4YIiYuGYp6K4GQECvE58Ik2oAwKztI\n8mQwbgyqdPKoQ2gpHvl9AMV1IcDCZE0vzxkRJvKCBsJ+Tilmrcg/REKUAlI5\nVnDeLGdasDfSR+QsctTVGW0x2vAxKJ7UlZApOB76B+8KNpfS0LiCZ77ycIMH\nTKwXSyoSF5UoPJdMX5gmfxTc5P4E8Y7d5FQaUrH4jFMxwMPl+1hV/7HwQs7b\nQRLqmsjMEgXk2z+wA3VsuElgf+8GJ7dAC6+X8G2uoZ31ELcdfZ0Om9K9oIhN\nrX+edyEOOSflOCgTZ/1IYAqiyXEZf9e0kWIGi7rJSQE+fwvchTavBdxEDH9V\nsRcDKhCfNBusDWRSPzXEmgMQ3Rccn851qmbAVGMTbRNjwm+181Fs4TuMv9R5\n6Fbf2o3R22/8v++rcv/cmHtmjj1JT7JfcdnGFA8ahs2JpAtZBZrmNFAIa7sP\nGPlVSvJIPEEmoaVOhbCIjtv4lfD5q/b9ytoZ6RRowg5U+TJkWNlv3QEjeCvS\ncLBFlsMZ6koPIwlzlXdI40zdzxmOOR2LOPObDC13KDBOFl172kbm3xSuCkeW\nVxHa\r\n=ud7F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f65e6442c706147801519c36de4107667af6dbd7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-f65e64-kglz1c6e_1603440464567_0.15753389453198174","host":"s3://npm-registry-packages"}},"2.0.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.7","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1390040edeca5c4e8401e85580d0abc965e1ae57","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.7.tgz","fileCount":618,"integrity":"sha512-6jqzlfOjBNLeLSVncFtLdm0eaVDqvSkeWxnUHbZaJpTn3dFLSPopY9V/HwostWQJ71XBr62MLEQzGLpcH/uxyA==","signatures":[{"sig":"MEYCIQDyuXVHuVn4iQT9utfNS1cAt9Pk/A4geTskWGeQx2XTQQIhAPmxKVZjLuaXKjXPH6biynaZ3NIMDE32/ATT1Pv7N9Bh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfko/kCRA9TVsSAnZWagAAcnoP/Rr/ICcDXsVCX4p79Osq\n8eKw729UwMPer+t7OZ4HVXJutd0Qq5bfXtTCSzjF+cAeqT3ILQpNUjmDub4d\ncHt5MzXVIPLfrUxzGMCFTjT1xH8HtCyCqEq5hGBBtxorBJbua2nvy0qIAyRo\nK+JHBfGW5Jr4fTywWmqT/pDpICNtM3GqwL3Uvaewu+FvxSksEoloiPsEkZ1r\nKqZVbuJh3LZdmLdLiuSAJrH66aInZLihbInoJhNVcOyIkz5nab50aOF9Q8xc\n8NwXL0w6r9drwYDyAjyHUZUF6bTlNnp+ZjSYGvBmCrqrvF7ckVk1YXB36Dg6\ndZj5C0lPSRrSrytUmaJbg6z+saKtNJqUgiAZx55vyMweJam7TLu0Alpq8S1B\nfgNev9u01BMRZSw7C7wKmx2HoZ60fT3HiWDyTY+YwrNvAYllk3wNcvsNASFU\nNA255kuJqUV5dJlwiEfj+zf0u7d9n5mY3zpM9TVZzta+e6WbOId2kSnRrcH5\nuYZI/EIv1IHPbnXGXQAzVZ3qQYopDZLBgWMZK1CAwE9Eryo2Zd72DijJM7g/\nSDaEvDq66xuaNdf5UFDmeQCj4onZ/YEHc+FbUjEZmPmmeZNh27jcTFDpPaor\nkAdhZbHaIj+DAw3P/F9TyoQTKGNW/QDQxSea6B60aFkNXS6vn4gPouBU3faB\nQBuj\r\n=p7na\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"eeb86fda60826f42c7900fb53adc1ac73589cb1c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.7_1603440611601_0.8056000796636642","host":"s3://npm-registry-packages"}},"2.0.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.8","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8a13d2c7f973a2bc56b655359b61ffe75b2bdcc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.8.tgz","fileCount":618,"integrity":"sha512-6uaQszNmwISqr3b4zRd1ygkK0VekHQq12eITtMZAVP3X1rgghHOGn7YmrHagpdWPsuGixfPwErvH1FI8IQWg+A==","signatures":[{"sig":"MEUCIQC62tHNmIQ2xsJexhfipfm7qmtRjmI+K4JG1rBxjXM89QIgD2u1Ys2iZZkQ59TTcWMhlZr62SgTny6JsgqHWIX4djM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkt70CRA9TVsSAnZWagAACl0QAIMsJ4bHLAba7gYc0S/k\nsVrnha2X9XOPk9PZ+mKOhL1YLHSgpxXIRdagQYoHYumgigtuugRFB+ypov6b\nplpN0MAwYJNzAmF3eANWbXN2eb6uocd3srUP+dStcD4+jOtE+5DdrjWxnyyK\nTtVeRhNucKhnm66rnAdE9uJouME/9cKOjukLNfyhDeumEMBTsurZJ7Yp2fax\naiyuJ13JLeOmOlhJnDHUv/OXn8T0PPB2ZN1AG90wuaC8f57bU7fDjIg86PQJ\n1ncZasIDfEfO1UxAnRGmkwkJOzWEUsv7msUZv3gzKwQZsdtN43UFsnhfpIAk\n3VWIC3MMAJ/LnK2R7t6PuZzVTeF4VLCF3vUEmaP+kA3o78QTR0M6LyM3l5y6\n7OyNDyfgqQI72Y9LH4X3+hSnJXFfT88TDj9CH7NDeaTeEcfvG7GzCSNi1Zh7\nb3SnKSGhTQvmzuIXkg2EmnOuQwJozyajBfJ3HRNi+ilVji1wSI/fKbMyVKTE\nmuplQsEo9ZsW0wkuDObhX8d8fU8KdcNy3EgVGW6qHEfPF3pZFVWDZ1y7aqDL\n3mPXMmikTsmco3FCKzoKSpC6xd+cGs+bjc7OCEisetCUZQejxHsJEDXNK/N5\nSmN/cz10krDdatsmN8QEs4JhBtN9BAB1A0S+4LXxXjfMeoVsfI7B76thT/LD\nMTNB\r\n=z5O9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6b336c62afde575892828e642aedaefe375c64de","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.8_1603460852407_0.006796685508976719","host":"s3://npm-registry-packages"}},"2.0.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.9","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74ba22fad856cf03515d181cafd98e9e9827b093","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.9.tgz","fileCount":618,"integrity":"sha512-sx7VtdP7YIJb5S8EqtJ+uTKTY3DCSrswqOFU3iVFBuRU78kwRu8RXKadBjQpw0lCKElTZqS+BkmIQXsSH2ytgg==","signatures":[{"sig":"MEUCIAjX1drEOf1EsXQ4arAKJvr6xmqxTeBpLq6KlB75aJTVAiEA6kfRI5ur5OnYVoeabkWuh5Fh/sqdEz7q4VkwPnnDeWQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkuUBCRA9TVsSAnZWagAAepEP/06oAoVgQPVEber1Y8K6\nSlruf+wa5MIsNNnR0Ez9KstHDnfIZd7rPEF3cGbQ3webzVrCmfy+QnjEZ9+p\nkOx81nleSMMzhdl+luhvq4EyXNvjQzE9GsgDG6//KOGOL5d419wyc//voupS\nI7J9f62IBFZ5fcoa6MVRd61Dw5fFAQh8ygJdT2wHGsNJt59s/cr70js/a2l3\nejdllidurKpLM10TlFETsI7mDyyr8OWU11M5dHJR+33owsWykhlsJiSyaccm\nDE3BfC6PNGaPOlSkgBtzpXuB28rRIuP4kSbS4HXh2hKTWOlKArwipSpR8w3W\nFGTzxyd5EBgD4Ti10NgvhTfoJIcquz9dWQWweA5rbrvatQIkdJkQv1NVq7uM\nU4+Z3lbpG6y88ybH8bNBYsTVq53BMr9/UGs8aiCQlryQ5FczJcUvtTWoB5mb\nH2ghNDgbxIXQkbWkvXP4iHkW8K0Dk/sQ+JGWg4w6uDKWtcf01dC3CH0IVe7/\n5OKV575bVe7Y+eF3dO9lnjIRz1rh4cj+6wnJltWMm0EEnNJi3ea5PtCN3lkB\nbKkBH46zPPy8rq23cAqeXDz+wJIbxMPm8mGMnD7wgqAlF2CVC8Bice/VjTAk\nxZyh13ZZb1kAEYYydmu72TgvLzT5/2LqIaQnzCUOsHp9Y/vCMQHh2X5G1uke\ndA2O\r\n=DAjb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"18a2f584528cba2d075c82db2985b16d61f7d4a7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.9_1603462401454_0.641846358292884","host":"s3://npm-registry-packages"}},"2.0.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-beta.2","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"073d80162dc8e0e6529b5a1f173fd3af3d85ca6d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-beta.2.tgz","fileCount":618,"integrity":"sha512-/lTcHaFwpY6SCZSEzfTRFo53SIJXT3ke5MywDH92W5DpUtmEMWbyGe1q+1vLgWLRX27S2l/nmoXcUuwq0kQ3zA==","signatures":[{"sig":"MEUCIDbfzIVdX+SD1VSVC7ABE1GB9Vfcxi1TQTNRuhkjvaesAiEAuUYaijOJyVMDQzjLZnf+ZEIwQkValQ+r6T1Pk308kgc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmUfYCRA9TVsSAnZWagAAr10P/jU/sKADeFglmIP8J7xH\nh+AFeVLyhSLcMMVpgRCgHCeno6D1GLTuJe/NQ8BxqgJHI8mK77f+Y3/NTXov\nIpNFobPv1XxpJ0nqdPxqbumnAAhx+2XYdFoanz/BLRzwYKt8Gl9bX9XZvzPH\nH9CHU/aVd2QWJP349X62XmeGWy6v/Wek3vfOn+MfY5SqFhgdg9g0xuQ7PG6R\nEvY2bHw/y8TRf0f2q6fQHOTiGBHtKEos5fjaN6sLYiNGiDNZgu270hMHKXl9\n85PSyVmXbK1Ffa8gIhsSxEyJvyl/Si+U2BYssgTfOeTLx4JQP+ffx7WuoIh8\nwQGzGeU1OhWdW/GYvXx7z1hGToW6sCjuvJ7dmqbsgNco0j0EUbYdBVeITkFu\nJZ8x9NzrPhjOnkD4brKRcrXSHSUPKENJohd8d7gKQ1nRp0ZXH/u1D/ZqhP0A\nDyOkxJvvN725ppHeEn4OtPMsr8DYD1V0fMJ0W831qjttqrfUMOCH3o7pTmaB\nc2r6qI+vl/3vkcMfMbpMYglFoYo1IihWX0wzy4VcnXEQPjbdkZjU+4GcAdrV\nTd3lkpWoNfP9CLJ/WOkH6zg+KAgzwa+WW7gF9WhvcH5/hEuWlh/CaG0NbYtk\nyAQWsORkuksESQSas6NyM5pPUZieLBZ4uiFQckPqIrNufjmonWqctpHZnL+l\nfU12\r\n=Dj4j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9f53a9bce6ffa0328f30f7d9bce708de52319555","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-beta.2_1603880919888_0.821906174862143","host":"s3://npm-registry-packages"}},"2.0.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.10","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d60e9b118134103d121976a9e6e4c8819611d862","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.10.tgz","fileCount":618,"integrity":"sha512-JowpkDRcUXQ9Y+oxxTHH6GfY/zRTU+I7YD5gZaWKChJA2AQ8x+6ezuK2jqG6eNZjgiUZW7z6F8lqF4YzvMZYNg==","signatures":[{"sig":"MEYCIQD6Dzv6vbv81Yzc8Gi0pfObVExthH4991WM7+Obf27cXQIhALd/diHI4XEneN45TDsmrbs09c7mkXJ0RVHkm0BD/DVk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmUhsCRA9TVsSAnZWagAACqEP/1IpMOU+crx3YZ1HWQMK\naVuRT/OswPpEyGCmg1HMvV8vNCw2GBayBJGv7MIVAceYeKymCYsIwM+HpCId\nlsIASEBdyzj/4m+NhvCJ+LeS5nn9QrFdIC0CHgKrpUM4CcvTmJKg+3V21x0u\n8O4M4mS4iIOSRT56929rQ6scVizZxJIzDUTWEpj14TuWxh0mOfJHmobka72G\nFOA1pJ1S4LZFTwCjqvq3bb+e5wJEVA8cPYneYrvOqt5DoIOV9qb4XD3dJ10o\noxTASrofKelI0E5zxm25dohkEiM9Gs3lA5IhQemSJSVmJuFK2j0CT5bWS3Rx\nhiRkBBC4+PvbShWXd+rtumiHm9HkZbc0ttw9EKCUuo1eLpERSKmEPgPGD1AR\nlIEXahndwxSj72xoJVHdF22gHKTrtYK7fKie5PLpSL2JPv4JjgN2GHkUHhi7\nK6eH26I4wBAzNQQGEI1TDtkIuizlAH7UbjfT/Y3vTnS2LlMTKF/TtqlERDP+\nZ6vKp0FFXyKX/Bjn/B/jf0Z+WRKz/xKTsGhbSOHrc7YCrKcOYG4p8MtcL1P2\nNYHRvuFQVL+yvoz5MmFwVYPPGPpLCR+VtiYaNHPoz0xy4rQFygrXwf2BDKhl\nxAg4GTjvY2pZX8krxgGSzfN/XwXYRMgIED+aZY2htfOinglqw3GTRHnaOktK\nVmyP\r\n=YHDi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d65ffe5fb31869edfab17ed526e988e00ee58dee","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.10_1603881068142_0.18178376462209322","host":"s3://npm-registry-packages"}},"2.0.0-feature-93211a-kgt9hvj9":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-93211a-kgt9hvj9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-93211a-kgt9hvj9","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"867d7fc7f494bf266faf1845cc5bfa67529080e5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-93211a-kgt9hvj9.tgz","fileCount":618,"integrity":"sha512-lQe7Zrg36DnHW9lDnQkWSJrKnnMTCWY5GyPgJAZ/kOeOgs0GNg35nvscpEQWU791N6JEiSWsJ8KPgAlB4H0VKw==","signatures":[{"sig":"MEUCIAfnxaQLgrbjO0XRil/2SNc5U/2H5IqEKmODYpo4mPXkAiEAscesKXuDNMqnx465/K4i5bFcaH7fqv7p/KJMCDm2018=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":652784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmUlPCRA9TVsSAnZWagAAOWkP/1vx03xLxi4h1iso7OtJ\n2jnOueLCxxQfnDwrsDfwC9YM5h2a8uZ/NCpZ+xglrXLwmbvKSvIeBFieV8Qz\nPEeM4fICrU+LSgdffP6o+YOikjaLX4vib/31kaiu93fdOwisS5ODpyxrC517\nnCRfEHgPypnX90SurF+XhDvDk2jzviffK8y2LujPPyhRTUAgOGaGPiAAPdgZ\nukdGdjHa4w4S8VX65Au7/yf3Wv8KUYGUPd5YbTFWmjZEbytq51SoD9aB+wCe\ncQ7uZy7r1UltIMRlHjw1+eRvgb98aDZ3Ud9ny5b11FQaCIkm2rzANBaS1qXP\nCRSF6YCRuBXmMGoto7i1wFBDlW/urhEDDS4+4ev7PaEJG59OWC+pq/tfV6RM\n/kuAIzAWkWz95D8sZ5FM8J319tNGLBKjVvSmLojxb3vdxkbsGuN17GEuMwzw\nVPzxUyz1Ew+Wq8EvYH/6I82FstvnQkP2BMVV21bQALUuY/w7lhJPjVWxCQud\nRKR/KzBAsGaMJ97mwo95gKA1eM04y2OHhb6anP1ivo0weTprqPMOXcSBS8bt\nyHx5gDs2wFFrcWFP4KtonjXswpz8UZ7MISWyYxaOAyn15INHDvu5Vy3erzbn\n09xP6clGsBzMdsrMlJ9+ONhLStsDRq0GPJvMwmZng26F8M8bzHUCdl7Kso2G\nym0k\r\n=RkQy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"93211aa810285b6c624ea2eff0eb2a17f1f26b34","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"feature~remove_event_aggregator_from_ioc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-93211a-kgt9hvj9_1603881295002_0.12031653128460951","host":"s3://npm-registry-packages"}},"2.0.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-beta.3","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b050bdf5d03db5a1d586325109556da27ceccfce","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-beta.3.tgz","fileCount":618,"integrity":"sha512-+8g4+E3Eyb35c5aF2cB7P8lzgIjFTyq0mCBn2If1tQE5KDhp9jfIx3huYvOel5GQ20JAzv6MC5FD9D2HUFbEeQ==","signatures":[{"sig":"MEUCIFXAuqEemCuMNwRQ43Ikyo0khKH+/L/lQ8AmBCPla9+9AiEA8lU7AiG4zIKAg/0ID8HgpJ6bjx/i12Zz08yveBRyJnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmY6eCRA9TVsSAnZWagAALrQP/1sybN0ssK7by3P6ZJQI\nvTmqw+2/lXlnUjjsw8j2WsQthK2ePa/5O4W0jsek+vKgUNL30HQVnzL82NP2\n2y7Jw9SWu8XEN1okcK0u+ALzX6mm8YnewLzIsGSYcMousPTxXV1BPGL9ibc4\nWjvJBCjwymNci1noMgtXnQLDnAMTUuSILOjC28Y1v0Nk5lUHE+TesKasN4Eo\nyr3BPdm16AT+N/fz2c2sKVTXpirRTKdc6220dkXhm6r8cmr9FWSlLaeYzqSU\nuWL74eCNjDBBxaAQEkT1jxpZW7ZskCOZbMN4u+acmMWkNpXrJ/2I36rD3Qz9\n5Gsv7mFO/eF4WWY2T4NmiLk5OYN35su+XfKEct/aw3kfW5RGLtsofBk97Pqu\nPhHaBwGUh1ZoFqxr6VAVlJChWSSLRxFLuytnUq4f4yu9PSI2v3tVcsl07UhL\nn+rt0LHWrVNCzVpzjqYEv+D8LMWOk4rDUzQhr4DQgJD2qqLOsZQiz+vaghSo\ntKfBWvtKh/T9tdkMmAC1RooZCVURpqMb78wZpZ8iopZmNmc6diTEUmpKiBLC\nlT7ths5rUA8irWZDoUSlLl46GgkdKdarzLBYuwqY3RFFPVwTCTGCOlw3nha4\nYzeo1tYwaIx/nkMI4zh/BMMFqnTHUHjFpdRZKPFlWt4uQlPvtoNtpnDjNEON\n23wq\r\n=0nSx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"88391afe89353954058b49149ace1fa843d985e3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-beta.3_1603899038249_0.6890696422831559","host":"s3://npm-registry-packages"}},"2.0.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.11","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0ef3254e047acca06810230c69e91c26b6737760","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.11.tgz","fileCount":618,"integrity":"sha512-SAFpubw5K6zhLacCj4AeO9ll+UKwtTfUahgjxX7C+HVkdbml9aqj6WwEr4XZewwjL4Tj5E/9PKL/kkF4uLvAeA==","signatures":[{"sig":"MEUCIEepJ3VOQHvgkno+QZA/RmjWJ7yW7NFZIG+xXZecMbqYAiEA6qzfYLRv5uEgnEPWg4x5CZcDn/P+QgyI8Zud3jfOGpI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmY9JCRA9TVsSAnZWagAAka0P/3pVvYubKePjKN7209Li\nCYFnEJruXjGXp9UJZvNyfO+1Mopd2JYYn2qjk+UJ13+Rii8C9Hgk+o8qKXdY\n2hKQZYWznbVTv7ZgzVxf7Lm4P7SwWKDCqWP5ntAodwNjlxziiLvMJChIR4fI\nTX2vm2Tq2cdirqwYgo8qMBc+92FouePyJh47Cnwr5ar7BfZLpJfp5h/N5rWX\nTxdb29e+6K946272zRDCMVDRGY+rsprEu+uh9GVUBXhMqwgnZp7G89xNj7Iz\niyn3UoKj+FXJMjzlXvqQgDlefIf+m4g49K8ggylNTlaHO9k4T1aYaYnsqdYh\nI3P5ca4oUgBoFQNvuKSwo7qoPloxSwFM9bUHJY/QF2ck/by6lXibXxdmeeMO\nBghiKNIHK9fKqGjCnCPfHODTQAFAhyMcQoYCZMcj45D1hXMtuBBC30XIH1rc\nsLqeBk4Ts+Ivy+HEoxCb5GKEu89AWbd4gpVMO3CRkYP79pnLYSFTzDZOQX42\nIN8Lafz33UAYkYSle11YZM8sh8Sz+u9Yb7QUHgfzZkblXrfi9SUIZaEQidxb\nW4B83xBwfWjWuKlOvpfiWU8w1FUIL7sj6bHyXObVF++fad4mhD2F5Fc5QYXt\nbqU0WAF2/oMVXxmKmwbTyudT9qc0HtB9itNOHlElRow875q9MzeNLm0p7K+3\nCkAV\r\n=1jUg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1bd99cbe2d998cdf5748d268b9a6f0c877b2e809","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.11_1603899208533_0.7800686349645154","host":"s3://npm-registry-packages"}},"2.0.0-feature-c54d9d-kguyc6vx":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-c54d9d-kguyc6vx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-c54d9d-kguyc6vx","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"54139f40196c1f729d906e39d4619923ee542f99","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-c54d9d-kguyc6vx.tgz","fileCount":618,"integrity":"sha512-p/UGeuxUR//qn1DtaqrLgCQ466PuMYefKdun9FdyhTc1aVm/7wU2vm+/pQRhkqOG6DDNxMWxSxxNKXCiMgZo2Q==","signatures":[{"sig":"MEQCIGZmIpyLIPfIIeHAOIiyYtSlJs+5praHmO1AOu1EN359AiAr5/43/qYMX2QTeCBCmRW+GW51QNfYy4FmA2wVe+Bwmw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmth+CRA9TVsSAnZWagAA+hMP/3dxCkU9uu9Jm1m91+p6\nW8K7UaPkyylxDKwOuSTI26kr4Nx3hVmLuophbtjMM0FZH62Ub6Airti9YJN/\nqwV0zRoMqw/6YOXUaf0pNYK8S7yRZHU8+SRFN9TdmpYgJADtVCA6g8NXsAAF\nlBmATl6w3BwKmyVf/SUcBCkcRm4TNhG4yLybeJCTWUPvk2irZ30D/PoD0hqY\nPNb68ol2G8iGr3i3GwNdAFMUzYWLUIp2SYyTlLC6t1U1BSgbRMs3DV1DbCsz\nvxSibAMuD1V5J4mW/aEK5qYDi1Kr7crw1nhT+YYzX4faNOURi+6+YeSt6YeR\nZS2Uym4J4BMuRBA0tasJe6mL0vA9upIrHr6on72jdFr5dCkjd2JTPV3G7Cgg\nFFO6Ja8FdK5k3i8pG96TrOLlvbrwx3w/D0FXBBP73MwibcOjKgeick3uiP+6\nRvRzFbAroaK98DUenzEkSfBEV2+euVtuY/eSsqg5N/2UM4WRqFkgZqUoWiwE\nQyKFXimhvsSOpSLTqlx2RnljDbBEuAmHHRIRz6jyXqGEQNp6OuVKNhkSdpoi\nVFUBaoIONSCaDiyhvXr5k74T31M0MFDZJHZkh/4CEa1ag8i2n+6fPnEFMNrb\nyuMNZ8HZo901k0rPmKuR+pNjkvdeFF774T2QlZXSm2LNH8/tTX7v7i9SOf28\nzI7i\r\n=lyxG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c54d9d8abbe7c6f8c4f92738afbd2f71201c85df","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-c54d9d-kguyc6vx_1603983485636_0.27634463869093073","host":"s3://npm-registry-packages"}},"2.0.0-feature-ae0416-kgw48tnt":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-ae0416-kgw48tnt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-ae0416-kgw48tnt","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"888979de8dd43a4a226ad54552eff82babc67c05","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-ae0416-kgw48tnt.tgz","fileCount":618,"integrity":"sha512-5/v28XA3C/lm4xLI8a98xPpKyKJQO0d4OrsOh+HFD61k9HuW9Tr+PuTMJG0oy2NaDvOFYih0VQ2qdM0UKJ7wYQ==","signatures":[{"sig":"MEYCIQCtS+NIi7EdiALhqYnnsg5EpfSNwhtzzinu5/X0ocSz9AIhAJ2JJ0HXbbH15KLSFwLSoIPaE2ccr9Sz5dJtPxtNOqRU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":651621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm+ttCRA9TVsSAnZWagAABIgP/1FLl66DReFEPvxQeIvW\nKMt74r87Jpmj/HYPJMxDh1C9LGan5VjRK2EckWdIfoQBa6W/IDzkZxdrK+xg\nwB757hEjDLfmXHRO0FTjvpuA4EsYCagg7qqW1mE0GT35R0GQr42htDmlHAca\noPdPratWMWcL4Bmw4D7fPOD9Ya8TQeNqS9p0yFiURlMZfmmJNq/rY4OLdPot\n/CHEFs/tHsQJ8WFvGIY7m9ID4T7F7zPUvYpAbGzP8/Y7MzmmZJjC5OiyynkS\nrZ2WzpuXNIs4hILtFfgGVCTlaqpvGV/+FpUl6dN88gNOaLZ18cT48K09vx+p\nfCvuXvGK8zq0lUFfrVbnFFUtr3Is5oD7SuMLgzB4k5BVS65abfVP4VJwnS1v\nNQmb7BjO82TU7K8ZnnL768Xkds69QFv6RGHE9/903SOpL9fVFhKsDrNIIopS\n5N/jJ9BjXUEIo97dMVPtorXFpTWgGXPMirc4ADj28nb0uysBW24RX3Vt/RI7\nXDw/t3TSIbEmiWGgBGkYrNNbFe44ensg669z4DoIJASRnS6QUlunX8zA57hF\nTOh1suXy3RZOUAeRifk/ajlsSIAaWqtkenn0sl3RW5ZPbyIByuX5mX35gsaO\n0FD4mpu7i7Bd/wXrHYLkvIYxkcIhNp664RoBG0akpfLhJ5/BRSHJDpfWbqG1\niCVQ\r\n=VCQp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ae041689acff77dd715ad4016be76374c0113b9c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-ae0416-kgw48tnt_1604053869295_0.7932741498033269","host":"s3://npm-registry-packages"}},"2.0.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.12","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f3d6d3ca442f1333243532468a7da797ce19ddd6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.12.tgz","fileCount":618,"integrity":"sha512-xbgAmwmHVCpaAx3RMIcJYTGt1OsOHhKCKnqQMj1f5o5Wu9YaYg5jGrBZ2u7OZRzZFkR+2elzvGB8NkYCSdrUZA==","signatures":[{"sig":"MEUCIHeCSE61wi3GNfvwLBdfmQ2gpXkTPtmkpfSnWToqtJEHAiEApJJCq8SgPXHu7VxNZMKKC0yzGTDQ0IJBW2GUEekwLnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":651606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn822CRA9TVsSAnZWagAAxE4P/1f0aliRgw4fNCDRysK+\ngJxveyykJH83nL1P4t2SU1S9KFI6MScp6jyOHqj9/uKtg1gPsaerCO9PE2C/\nnfQTedPEpjQ5ENVdhED5SmsYOxTmOxF7+YZrYAKGNCioY5fe7Xv8FjYE/yfJ\n9LXloC2908RTiuVQ0pxMeq8CREgpoxocRdu5vmQ/iJxFUlmpcNjFi3PQTgRU\nrF8I3x0u/CAOFdfjlx/A66d5TSQtNWl3NcR6/fwzIbTJtWk3VPMsUmlB87FU\noZhjPZH+01vpz1OGeyTy4ysbneWLIbnhzyRO6x0DMFwabCNa6n/4/Bcvc6/W\n6pGBaTVfAO6JobgVfVWlw3637mkqfrf5s+yPiU6H7OoQjPsGYRE+S5vg+UbC\nDU8GhLDqHay81qS7mu/IFlB1YoJwwqWSAZyI+B5Sdxq5x+te/aagg+07UOLj\ngpgVttb5wiOM7cWRXuGONyaWzPJgf/70srJflQf5rQotd8EtVL1NV7FogZDW\nMipssigk80IvNcMETW5UdHHyxoIdbnyl5tcq5DUYVymZoherF1WU4Gfkt9Jo\n/415TSIt9z+ZJaRX3sBPggP2HfoN+rXSiPRKN4qljBtrdnMnEGaAERPHFH4N\nIdASbY0jyvwsIT+Agbzc/2ujeDQG97YnLwWNd/guoMKKax4LNDFTWcWMPszi\n6QIx\r\n=DTfZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e5b1ec302e69067024c7c0434152ede230df216b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.12_1604308406393_0.21678836402156554","host":"s3://npm-registry-packages"}},"2.0.0-feature-fb9b44-kh1tnhji":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-fb9b44-kh1tnhji","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-fb9b44-kh1tnhji","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8f856c32b42ab56b46cb8e3f2b7b08e882e60332","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-fb9b44-kh1tnhji.tgz","fileCount":618,"integrity":"sha512-4dbuVFrQPVE/4oC95Yt6s8NXX6Riwyn28p60CKURrtordoumCUdiUX9aTagihd0e8JBnETghyGgIYDTXxNqnqw==","signatures":[{"sig":"MEYCIQCoDrqZoIAfPwjTlGMtCDePwwD0XkNz31JPFDGmvANsvgIhAMAjoF6oQ1eHuhELbzqqNmnrFaxHT9pSzZ9zLQ7kuiTP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":673632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoS8dCRA9TVsSAnZWagAAeNQP/11xhKpyu+HyiKAbkeIg\nx3QF4avI6Hv+Q/HBKkSApw5KmAvdIDvjhuWxEoo7kwBb4aJqHAa2FtgJDNAL\n8OdZUQf1Ny2pJ5QHsowTrC+wSAMtLnoU3RfaM7wrJGhTGUeRH/iUbSX77PTN\nXhFxiNfTKZy39rxO12/zFBsXt9M8pVfeT8U3591FlNjZiYUju8a2QY8c934s\n7kGY98UxdXz8XFOkTDZF2T1YC58aX0rAe6NvoUYyPeJvpWwE+kTt77xJSRAh\nFkGf3I79ZchQqQWIoYCTwVzQlaKiRrISr+MyP3KzjKc+YwSMW/LveEvnChWS\nTsraoAryY3dHDEYOvU2kJswtLUl5ONagMOjx8SfmXaW30fK1/xKiDBw9xT+4\nBez6szmXtv3jg9BGzY9sYPG4AcpH5sbDoPJkfZZUimySMUCGYUZ/ztwoyuN5\nAW9XmBgj/ARZJ5XALkovyCEyEyCXo5WA4lCBlDIK/B7hUS+bW5yg9pVUt+u0\nhMvdkE5WYmbuj/tLsclHrMplkfhN+agQPky3F/rNKIpw4NBOPm3mxxmPSpfY\nzPw1y9KAg+i09hpHppGPSiiXlLElMGu2jjkIwcfOjcVT0BFSnPlxu8dgSeXy\nPKUFvaFEUTQsDTRvIG/FIAelVRuhvDdGQg3KOliWwONgwpnyM0juRFiod+IZ\nRDEp\r\n=rLZA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb9b447f3f6970f519bbd0ccaeffcc78c6e1758c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.1","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.1","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-fb9b44-kh1tnhji_1604398876757_0.8018366703179405","host":"s3://npm-registry-packages"}},"2.0.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.13","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"109b47f539a4a2bab98e04bd692e0af4a9f728b8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.13.tgz","fileCount":618,"integrity":"sha512-Rxvkz8Z/3NMWZlF8xAA0naa39onKdHhJxrg0TtW0QCxLb0gRr72O6JhZm2hkCH0bhZHW+shr3rAR2n93O9e/qg==","signatures":[{"sig":"MEUCIEaUClaoEfq7brqhEjLhHjRvVbC9IImvS4crc2VypDgcAiEAqvsGCwHXyD9VRdEX2mV8adyRXn16UZCkdxcze8wFKIg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoYPYCRA9TVsSAnZWagAAXO4QAJcZiz3hy41sKA8OSXcb\nj5A01i4ZMCKclUic7VAwk1MgP6Ouf6z/cRss8kYLhfnFFXiZ2JqRJ4stYt7m\nxZBmd2baluTHTE1T7+JVss0MOedBgLQ8KhMDLH71At4qAa1IZyL4ABYegcJ4\niwrQDWmSy8gkz0wjKDKG/mGSmGo8VUqZQhLW4DRyt6xkNqd/LBqFPIUgK2E5\nlcPQ+zeirTcil4D/ZdyM3ieAj4XbGCMwYF+6pTtlmqNP9Pq2sRF4Emc7Oasp\nXQGBknGHSv1aU6+r5zA9hl0JkAbSVuGw14SP0C8byKpe0nH6xxSbAj/7J39H\naljzakH4BQnX2XqLMV+p5MqJRqbQ/Wqr7L8EhAWQn1xDzXGsbD5wYrDxp74E\nVOUUqdkE/mTg6q+6vOJUJIdQoOF8r4tv53YDKTEWXJh5VLX2Pn5NBrCVdBpG\nCaSBFTMwlkqLRn9MUKv8Fg62dgMCbWgbGQpoGhN+Po8YP/VLE9owZPTQ9/o8\nAd5zU+wCP4B2j4GZ4bSBk4/urMQs2R12sftcMVQjIsh1vQ7vTNSg5bGEs6F2\nHCxNToxXEH42cn+ULCLIk+PSP/+CKSLhDmUyxqgoYJ6FqzOUVssdB9wmkM1E\nFdZuu8PPkNl9AEXsygiMw8VYirBCoaqBRjvTCLDeMTZxyYsREX/moqIRZ8rY\npIRj\r\n=pqHj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"641963d42cc7b65de50c39220979e4a8e9ab819d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator_contracts":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.13_1604420567464_0.9957470680800622","host":"s3://npm-registry-packages"}},"2.0.0-feature-1981fb-kh27krsi":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-1981fb-kh27krsi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-1981fb-kh27krsi","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"69f2011ad1dbeb4ac6f3c22e6beb8320882c09bb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-1981fb-kh27krsi.tgz","fileCount":618,"integrity":"sha512-4Fpjwluf6V8GmALb/JtOtXKmy/dyuvYiVhAu8NoxJc8EGcRykHA8Odu3WFtaOVpBAI1HnXVP2M6HPcokTLTwdA==","signatures":[{"sig":"MEQCIHc6hHLquvbifdOehYfFqV2Y66qe1iAvAHDndGRWs4RDAiA8kMnQCSD6mMm27CYuIlzdDXWwfCW0K2uK1W/x+7eKrQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoYp8CRA9TVsSAnZWagAAr+YP+wQ2s4hNCVPonQ7Qg7sw\n+lI0jp3Om4F7g5Ht+MI17gdriPM143khjfqiqKfky1NmVGaL4d5kzD5lFgHA\nIuv4EGFmFBdKYkvUjFcXMvSaTebXnCurI1ZjMBXFyYq/9zQb5LpNzB7e5Wj1\n5v4QO0NG6RMM/mnaAEazjGefy/MfL1+Mfo37Z0zxDgDCDMn/kt6YRcotiAve\nmn8s03l3EOSeTx9+QrBuEqEKVa+6DQyfrVlwboJxgBD80eMDaMBhNv3XwhJU\nr4aMF4lClgGSYgyaWy9Es/161nnET9qeNU0fuDUtXae0MQYLp0+nTcaHwpMg\ngiHw/15axDuClcOmk+mr6eFBOR0fUoQbIF0y5vvDrH1ESE1i6UeTLliM8oE5\nv9SjqH24vS4d/0uQe8zeWQCtOFqDPLAzf7yIsvFrYW0NE7SYscUlN+3NKy6e\nFj8uwm4KZa9b0t5L2Nk1AzzI++Fpe58Ge0Iwz16xEr7cuPAoU4p4Bv6okTb4\nEAJf+vwpPWq9onjdsxvQrN1JR0FdOqTVtq0NmsiPiUzNjdnC0fzRni6ixXKX\nvMuBp6DySVQt77uJrW9Bibfvc54uySFY/9FVOI8sMZ94GQxtk6zVS7Twds6y\nzZyag7Eb/5Qlv7pmLF/TEdns7miaYBMmsJJyJ3SDAXINLcCAro78/QYkyHsi\nMRb7\r\n=lBga\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1981fb273b7f7fea115a7a7cb631fdf0fe29a56f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"feature~remove_event_aggregator_from_ioc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-1981fb-kh27krsi_1604422268146_0.09604327520177036","host":"s3://npm-registry-packages"}},"2.0.0-feature-287111-kh2fxshz":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-287111-kh2fxshz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-287111-kh2fxshz","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2258abdf4117c488846a80a2cec668bce241d912","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-287111-kh2fxshz.tgz","fileCount":618,"integrity":"sha512-0CRC5JZbv+SaGYTXYIFRYeMeqF7QQIEI7Lkl/cKclHEvsx/J+JbLfqjT5BaexHPGbUQNW1ROEnsmgTKKA4AfnQ==","signatures":[{"sig":"MEUCIQCHHeLCCtERmBDbvwjYObCgKUAzRLgYQw2AjBStIo83BgIge+GkF6jqHW8/vwds3IgMjvPCcXd5qzVYJwLcuUqZ2Bo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfocFWCRA9TVsSAnZWagAA9V0P/3JgCSZS1m/zanZJK9sK\nc3kF9uSzB+jRACNXAC10q8dn2HfHuswC+pHYpwiwiiN8e65g0rUQrLYGgd1t\nsPP8LEx/C1n/T7bGAJ1AEt9lQkc1MATMRBGof1guncK3TPcThnO9Akm4Ol9g\nGSOBA1M9fdkkHL3txKUpc7WtnxjbanaL7kvZqtk9s73oK/LUYSXvS2SI2E58\nzNjc46uSEBsCBBykKbRQk12rbqjMnvnPtBKAW6OPGF82hkfPztSDi0Su5JN0\n0rYN9jKjuPpZ37YSzInf/gbPyfsOdaA3lJPo7hbV5QO2O5gcZYBbqiReqnwn\nJ7XZgKrqCSbSdRQZcedxaMTXseYNZWN7EpuBv46AUn+K/HK/AuPIwu9zG+3d\nDlY5B8AQQxAmco3YLk7YPUy0wuFquptWXQxrmtsVgHc6P5LF0ePimZ7gEei5\nT6Dhmr5RbTTW+VBA3DxiNVSE3Fqv4TXfFlF+dz7fogRkrMxARvKsaeqPxdu5\n5DulY126hMy1C1fkhzs9BzXJ8o4GRNiCKd0+ngWf/AlZAJrGt6vocyxsZVXy\nUEIQkHEPVtSr3AlJJbKbuz46z6nfCfWjd675EDNvf6gfTW7wg4XIfbVdDJSv\n3AmjjLJmp2QUlhbz/R3YHDURE/D9eRwJkG9qPD6q8zFEX7YHXUiDmR8vd249\nMY5q\r\n=FVPT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"287111e2ecaf1b49a06cadf7782b3703e382d6bc","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-287111-kh2fxshz_1604436309621_0.6283602772910175","host":"s3://npm-registry-packages"}},"2.0.0-alpha.14":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.14","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"93876660c21214d44404bf72baff531cbd4578d8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.14.tgz","fileCount":618,"integrity":"sha512-sxZFrL5csgX0s2flRA4CCegGTLhWiMH+qpNQ4xrhyKSzoc8bK54oWBRP93edQn/uUhoJxmiDC6W/dlHWAoCCZQ==","signatures":[{"sig":"MEUCIE7gXLYaXawMmPpYnXqEZEG7579LhQiz5BHDUE37cOXbAiEAyUGubPSF1NV37M8cEgaupOzykaRsd9DeYLBzR9hEnG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfocHECRA9TVsSAnZWagAABf0P/2ZcMrtLsT23CMh1dqHh\neXCEF5sH3jJUpk/KG8NZY3ty8Ci9DAeVz6MfTlpgCCiZVucSVq+ZpfJhJ/Qp\n9Phd3LV6hluGHuGeIRcOI+gyt9IYRBhDZ3o1K8GvtcEo8SgGoVO+fQOlBza7\n5xsmnXgbYAdY3dZLsUp746TkmBhzkp6KdHghJwuC99vctRdKGi5kfs4Yc9nP\n5e5WxIDK0YFeqkB0fBFDhGBHqFVGdfgzHhZsu2RVkci5Af/aOajCCD0tJBFg\nxDJwEnr7gCrY8NswQtrfaI2cPfQKCODa3LotjlhGAYNi4kzhnsQAcg7bk+iM\ndW6qpqCw+1sEa6ox68dchNMx0A18c50wQ/zrxhYYM/z8YT2PTLcDHtF2Fg52\nfdjw4FYSZsE6enYkkL2vHkk1wFSy0x3OvqjAkEZBEnQbLoeX+Qu4DM8ujybY\nZZzXhFC2+QCJE3LD20noWFBt83rneiByOMx3EnvfX/++HdI3ChE4JfDdCPN9\nfh70B39ODITWLI6kP47ocxc7iOED545w+/Y2h48+0QPMz89DwE4bGy3F6vC9\np8SBRgh6QbTxOrexbHyXWAHHU5Y3jYE6oR8of2rFEK4hV5xEdHpfGFAzQXgu\n9Th4tz/xIQklxlQMml6iVv/5wmG1Ttvw13HX7wFqwLUU1joLqqvRw4NikxW0\nESln\r\n=kpvY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fbfd22618d2a401ae49051bf6538312d0c63563f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.14_1604436419808_0.6780675481194676","host":"s3://npm-registry-packages"}},"2.0.0-feature-012698-kh38b8zn":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-012698-kh38b8zn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-012698-kh38b8zn","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dc59bd238116971f4f8f7d2a6227ca59d9ed1ce2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-012698-kh38b8zn.tgz","fileCount":618,"integrity":"sha512-KRk9rGASKGMc6JWHTgGdbJ0yIRL7ZaFlNc0gm08jvQ8TKVT+NAOKnxm/SqRT2N2rICE6pUwOHHLJD2tDN3uafQ==","signatures":[{"sig":"MEUCIQDUSC3/4XexEgLpEq06VqcwIQQ7yL09f2krYt8vI1SFzQIgNKOh1wz8zQ/x+S+/DkbKKIGVCY/TVu8mqxZ4tXU7Vgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":679282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfont+CRA9TVsSAnZWagAAGH8P/jp99okAfrPNQbbs/ViA\nfRo/e33yfKpsO6MdGFIOIVtVv5QRR6e52IRKPdgt6u/97aPuHKtFEb1JX2jP\nEUqlN/AHVahvUcpMfaQ7L8r7PQgCw5vSIUQ6hK5hOh0GZIDT4Xi25D5J49aP\ndAe+fM3SRlPJlHzJ+bRkPRicb1IQFtHsjpfMYZAne3yBNU3hQh+sTlm6tAzK\ns2Dn3hK1EvRuE3Z1mdqglnL8DHQUGZUH1yjuaXl3q+D4LAocJEL/lR0bRyvC\n+fdpL15q+tpBxNQugJmDne8ElcUM5MD6gSJZAbQAb56954X1aT/o53F5h44e\nM1Cl9JFLdyE/wNmveJqmp9+LbQCNevO7Ae3lvO+6D+JSY5cS5R1sy8ThbHPv\n2LUkum4qo5SpxaXskS0lOrMQxRy9x+cXDmHPf63mjKUMH5lzrgmwzJo5bexr\n48ULXA/EnDzB56ATCd2BnR6XRve5igooA3CtGzXR+IgoiHwHKr70hW1HPaCh\nY1J92dJVhwrAfShruYuU1MAS83p1gcvO89rfYHJUcD6b8VjOQK6IqA4WwFDp\nNuBBEtg0ZyJ+NN2+SUo6GnT1Tnlc06hkP50hw/y5i3h5iMV6Vwt+lPeablXX\nuN38xVgWERg8/9XLqJXEkdotTfk8A9TL45f7e8xTejLnSr7Bgo/G+qQdtH+f\niBxv\r\n=Uf3w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"012698230a577aa6c95a98da78b3913bba79d31f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-012698-kh38b8zn_1604483966241_0.5724049055859608","host":"s3://npm-registry-packages"}},"2.0.0-feature-916f68-kh3fxb0r":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-916f68-kh3fxb0r","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-916f68-kh3fxb0r","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c7a1a705b7a809561b029691d160d92e3f28e4b9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-916f68-kh3fxb0r.tgz","fileCount":618,"integrity":"sha512-3O4g0vkK04BpVI5omRtkgozTcERgKf/98Gh9Cu+wvteiPJ4/9/9lInEM4lPsHrC5QAjOMOAnu1hZrRlZe9ts6w==","signatures":[{"sig":"MEUCIQCLfcVnCswSOr3OMbPR9pNgxHpd8zLWnCZSHCHI1yHOzgIgCfgAeI/03wy5YBEohVYsGp4TCM289/gxaEwdd+10j4c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":679997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoq1xCRA9TVsSAnZWagAAV0cP+gOaAVta65XsfMjWigMZ\nGTG3sGDfLJSrFzCEzLA7JLZG8ZV+27U/MRNkjN6X7JOWpYa4dOTZZblroMxl\ncZPswr3rN9WAgwkSFcIPbsZ0tnYU99cZeF4TSHxERpe6YxkapqkHLJULJYmb\nMqMvq812Nu+1vBu/7kS7dBrOj08EG+n5ehy89uCK8AQND2eYDu+9E1ymy3sV\npJkYJSpt40Kwm/ZLPKWjks1uyG9Wh124v+NwS4bK1C5PxkWC4ENe69rjvDA8\nY7eRD9jRHPj0MUH6mjfrWGpZwukWmh8nPf2QWm80fygXY+iWUCNYVFmo6HOa\njqIzNLx90CO3iIFu1IewPWAYz5wuYvOimiV60uBAO+GY9WdAHSgCePUlTNC5\n7/3YyLCUFMT3uF8ZZiQTJZkBR8hTKrYN4+Xxxu/zBISu6MxClQMANGOFerkQ\nqiyf3SfXlgDSfbPdD7Mmo1rvyUulairrvfqjv5VKLPDcrUbNXWpp90s4unQv\nDAWHUh2WbgKsa1Eqqlj5scMbjOXwpa2qSyGB7GyGMutbPrAj/DIHRnygXYck\nxyM5ildeMZbs9vQL2fBoykbFNmK+EeX3gIr2n+NbeZZrwyhZ3y1yyuCIRknL\n0dQX271Zbe5BJ9SBOmJ09sq2L48u1FXfsCO1V4THk2HApR6IQwYEf/CIpxMO\nPNAD\r\n=jr8S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"916f688b2428d3084c25ca57108f82af455dc55b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-916f68-kh3fxb0r_1604496753387_0.686743222307135","host":"s3://npm-registry-packages"}},"2.0.0-feature-1de19b-kh3ijkox":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-1de19b-kh3ijkox","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-1de19b-kh3ijkox","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"998a5e23b538a70f5c75a69ea31921f10923d9e4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-1de19b-kh3ijkox.tgz","fileCount":618,"integrity":"sha512-weIRQXNKJ4vemP2llxxAvvHnoKR+AZZd/qdZktBYM6oYZ5kBG7TliJcr0RwEI6k1C2I1FxN5awmS1pl9GOk0EQ==","signatures":[{"sig":"MEUCIBCRm11dEuQMHOmTGJeEdwXxeTL4Rq3n3+6ItYgv9TTfAiEA1ZDGkGwCCVNqq/RBOLHh2I9c30wIlHTIyiYHdpSg1A8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfor6kCRA9TVsSAnZWagAA/70QAI2RdrGOt+DS8xKENQTb\nabcqBg+kes/CtagVEV4t6gP/jZ3SoDP9nJ0ebc3nAf9XK2rEwfcJ4gaVKACK\n5wVp7pMYZvMFVlxb9ZTtCHFhe+/WFF5ENixyHBBcKX9/iN4KOWrS08VZJlBM\nO2d8nczbGLBvJC9ov0jQtQkhhJvuw9Fu7vZCz+FMln1hvyLXw0DAu/Fzd6Dx\ngy5hso3i3ZPkd8pmakxl42C5EdOMwXVLm+ekk1Jp5TPXPBKrbAcsKD3eExcC\naUvwIjKdVfi6m7/FjXwdziirgA5kcxRIPL9zQpv0PI9ad5A1ETQHpee+umAt\nWasvAMNj9i0iM71w2ah/BcJcRxfweVojVt5lFhn7LEuzWqsDTb9HnVZJymk9\nfCVgz+HWJSdPCWdK9QEa0tBwhb+gIZKIpi5CNOUjs85DMqlrD4WpZOkNZtJ2\nuxqnea9r5Y/iz2Piq+dBNgRywzS/Oee0CR1NfB1I15TRx9BSgYrPkas2NL3k\nHqIWUPC90O7tFwgaI3L0yCC5j9NeEPj8m03+gmz4gEmXW5n6tDjfgndbDrgA\nCvGkZ8s1OfylN+t0tmq610LJMHRh+yjOu0MxNLq85AHDmC1mJgJSOgv5mTt9\nMT634/bgMysHKI6zDdSonXcufEJVaxHFVGi8gX09VgYjiOQsKa3sxy9hf+V6\nFFHv\r\n=P3oB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1de19bea2aadf0c1a054822455cf9060fa72c281","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-1de19b-kh3ijkox_1604501156213_0.727320673013689","host":"s3://npm-registry-packages"}},"2.0.0-feature-51071f-kh3ilwvy":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-51071f-kh3ilwvy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-51071f-kh3ilwvy","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c0f3d27005b690f9e343058f7310dec35752083a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-51071f-kh3ilwvy.tgz","fileCount":618,"integrity":"sha512-kYnXxgrlVq0z/MQ5zoiNrJRs4J9rz5sVHWrEmx4kEmHRoNsO+dw662bqSYQgo+hEgrJo+rXYlQi7yz2t9jrHAQ==","signatures":[{"sig":"MEYCIQDBvwhpJl7Jzec/hzhpjjl14EhAFIYosZTZPrkpPBZ85wIhAIbs2uI/B8g8OpDxrkxZfFxKD4sm+O1sct5zoID5bW8D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfor8NCRA9TVsSAnZWagAAV7cP/A8DeKrRKQgnBnCFeIEd\n7cowEYcMmQ7YoiQ5qi3zi0aMmql+YBA6DILw5PzW+XLtNXHixQGPGTA/KcEo\nT2rAu4GqrL2V9g8USrpLkEjd5XHmsetq+EJH5kJCVjM8jBgTrVZCRYlojDby\nVYo3z3CxY9VhEz3WnSQU209LsgoJVe9T0luM2udNertJkMA32I1b3VpdHpem\nJM29kSwdx1Y3lt1zpMsV2K43QSvqt8gQOVc3eDGne0K5SZE5ltHyfsxAarWN\nk3VhAka6LLjbyjqM/GiU4wGcdwVbreBzrlxLMHJuFutftW6g0s4Dtv3M0s7i\nMZmIcmdbxpi6kph9fN/EOaiM/GyIaRkZwsYo8e/RL5SIaAztnUxD1aDVVnl5\nsSd8hmsb/aa4pWqMdl/hU5fZ9ZTJ0Cz244Tnp/dX7/vc7CjZrIhTG5oRT5m+\n0IH5kUAuwGUlayG8ip40FV8LRswuMbuvsyQaesuF5tWRWGMgBhuHGcsZflq/\n3GYLx6qG9Xa/2X3DiK2dSIyA+5s2acMmr/UE56vRGHBKn0oFUs3dvP9uMIKr\nCQSjgXfNOU486S/xKkvc78s0z5phcszvmKGJpA2AVarmo/CDWmkUYIDXXlDv\noluHFT/LAtQhqS0Rv1kaTlpT2yWhdtedi9YGvIEdHHpi/mupb7rbtsxUE5GW\nLJpS\r\n=vfyI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"51071fa416d8680cec6dcb1dd6a7966b427fcfee","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-51071f-kh3ilwvy_1604501260891_0.9374463976303935","host":"s3://npm-registry-packages"}},"2.0.0-alpha.15":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.15","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.15","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d799d7bbb9f9d8a1e8bd0e6fe8e15a237ef33572","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.15.tgz","fileCount":618,"integrity":"sha512-egI2m8LoF3isfIAgvtOzV07F5NJyJiH90UyehAjkLO925F+asL6+UUw8kpKUjQumYzPuHeMBm+3w18JmAHqAPg==","signatures":[{"sig":"MEQCIEHIyc5pEUsKPsZopisQsBHe9GOAUMaK8Rhi5gWp8DxaAiBifliuGLOPdQYU3tACnT5TVDn7LuLsi7JeDVZrRo/JUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":679267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfor/PCRA9TVsSAnZWagAAa/wP/29v9wKUPlBHxS66Gsh6\ng//UFNFKE35h7kqzTd1XaMpTeezopOSMaU8jKrSDS0530xYWkH2B5vJuRcJK\nrPWSp66cUSwe3K+nLHKMVzeaRepLWu6AMw5IM+1xeGvYbfsn3MQXStSE4dff\nrQ6aOSp076pC069uwrp1PrhLnvaXdO/QPxbGBJtFhle9E4FNEwypWe4tyDSz\n/SVyua5+nSMAeDiU2I35wWg9DAtkKxE12miku8bpBcwj57ChjLV4PgHudMRO\ngH5qKBmvr1Z7QkKbQR8xpIv6jYGDXJxuY+1bu/7JDpZpFRMiigWxRSPan/+E\natHBHaWvKJmSnhvCcKa6cH1xFev1PQmR7hg6hiazrk8kh/kheg1ytN/SpXtZ\nLnp5A4c0Cme3lXNVeYVxPaOIlRpFgG4Cb2QvP6kR+uF/Gf9J9zDU50hHrqjM\nGDefOhBWc1FvltkVpiTjEIuHCZdLu2AxOa72X3wTErKhamzsp25qvbAsCcu3\nP2/GCB3JK7757Zz1zAz+vpFGe2qMbBdOgdk3l0O1TZ80TA8J+O3Gkvrj4n4E\nS1yI3ZxKn90dHk0oPlfK+71OVE0vuCWqHidPdleycbbAbpA78b/g/gs3LWUa\n+scCjrY5q+iB3lH3KRGf/VvvGWalGodA3Vl0QZ/wC53p9DlAKz/dN34JkxuP\nlMfM\r\n=o0ok\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"27084604fd99c8222037ef2f48ba46c70a96df2f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.15_1604501455348_0.8081580483548485","host":"s3://npm-registry-packages"}},"2.0.0-feature-67813f-kh3keapy":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-67813f-kh3keapy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-67813f-kh3keapy","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f0ea58a22b44ada62166830cf6c5d04e0ae26e66","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-67813f-kh3keapy.tgz","fileCount":618,"integrity":"sha512-djDBU1+MuVQYewqmjjD8DFu75Ae3tWirOz8ZSrs7pTj8JNI/++s0uCH8fgchLsAQoMLRxYk8VahUn7EJPBfqFg==","signatures":[{"sig":"MEUCIEbHEHXThHhjP86cIICIjT6Efmzn50dun+CyEDYtYAIEAiEAtQW0Akus1SjCISGuHxJwlj3GVuYO+uVvyck6UON1ITQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":676593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfosrICRA9TVsSAnZWagAAiXoQAIFuBJJ2wgvLBh2YtMAV\nJy/4i6HlomMMPS1TSdPQWBlkC2Zqa2bLUH7rk84B6sPNgeOk1mlHMrwOSzuv\ngGfEJJSYNPQJnfd33BwQfgh/1yHEwlzxVwEYu5up/S2eZhCkpuVENAstVyOh\nBfjlFZg6sgJEKzqqIKpEhcmxzaViI8b9tGk9I8dVY33L33qUQAxXT1v7v4lu\nrM5czeSDN1zQYg552Ru3tBibTsSSJ5iAXbPzAxvYaUet4pY8q8cAJGIf+Mk+\nuj+bGz5/j2+YwUNQdh1ztWSF2FOnb7QeDJJKbI34c+5k2D0sy2QCqEyGZkK9\nZaEN+Ni96DistIWvCF4ef2GCqe/ZPB9+JnGVcNwfReG91rGSJSYYLtLZOhZk\n3Q6rPxHYbZQTF0mCgDl5IfXF5RHkqAp3T8qYJ9KIzd0DY3/yA7lmuCVQlK5i\ngwXacoxNRzuae6O5Llp0XbEHbRerl1cbQMaUGeEtbIUhdP0GMvaQu459w6MU\nJKtEYpMv0Fd43I6fMRI/KCKGSePAea3xqgFb7LQIHGDyhI3yn6VonzWvV+Og\nWFtjWsuzYUEq1rMNI8a+HeFFC0hN0z5QRKo9GCepObuk4yrdVPWJcOAbN7Cw\nHDVt3XLu/keIui6ESTfOokH1guKjSsu63JJMQnqAlv4wbAVfym0Nooze7qWu\nyKOC\r\n=R1dv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"67813fb9747c5626e000d757207ca38cb7aab032","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-67813f-kh3keapy_1604504263819_0.23267380734886922","host":"s3://npm-registry-packages"}},"2.0.0-feature-b89d5e-kh3kysv9":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-b89d5e-kh3kysv9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-b89d5e-kh3kysv9","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e89c93d36ac62d8623d6dd922ac12cd999b8205f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-b89d5e-kh3kysv9.tgz","fileCount":618,"integrity":"sha512-7di4mSTX+Tstfmm6GavqXyLuLve9bXy0yKoNphrScdSekLXlCECITfERGSIsYuyBHGNBAImkIjriADWQsGD1Hg==","signatures":[{"sig":"MEUCIQDtAcNNOL+sSMRaiBku3du1Vz77BRAHT4F6aRG0F6OjQQIge5M8GnIXsFbwgvYCUkLZ+Ct7qjQ2sHG51byeXDeeQk8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfos6FCRA9TVsSAnZWagAAn4wQAIfqkJYHpliDTY/jdGKj\n7h9UuCAjx6BYqaCUqCkbEyK+wIFTFpBqwDt9IQIAs/y5RevXToH4XzUNcLPB\n9uMK+JR4Stpl4kPAytDKlhvbQKxHCS9VU5sI3/czM0udX9aXkWey5qL1YCkt\n/GfcIpfD1/Ih+yPZlT/a//BZa96P8iHfn94dGS9rxoXUdMEyxs3mgh/M3ls2\nmFCb0mkdipG+8KB+1IcSzj+/UAKhWB6Tp7be5ch8n/GcxwITTinU81Qi5rYi\nP79g4X3twYBxSg956A85Qbnv/ACi0YylREoSG+sOStnglKYeTnS7i/QghfsC\n88wQohof3kvsm6jpU/dSd4/vv4kl2whdy50IoqpdgWDi6kJl/L99ScRCGylc\nxatvZXKbvo4aI6KBJbF6RnaL8CKgdEeYDDpMiPpISkJk+69dWIHBrjtqsBwC\nBetO59LsK/2hf5t6DQkc8PTZ0Wtw7DTFHqKkHPCmCI1ppYzDjdn39e8cdYRW\nyKg/mmLQd+VwXnzk1ahWTYXs+GAtxZ9ySYkMWCANH5C3HFGrwnB8pZMB4JZ6\nqLqGB+V7O0wmeybmRKCYvN3CHxNAg5H/oJpc8/WeACls6YIywe2drimCilYR\nsIha8hfQWJD0UEfoAFM5Xt3rUuOYZrY62s8Jso8N7MVPsNYzuZ083fH2nlFL\nuI3z\r\n=5cGn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b89d5ed3ea7ce462c0292fe8e8da0c68b8bf4fec","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-b89d5e-kh3kysv9_1604505221284_0.19763289019578179","host":"s3://npm-registry-packages"}},"2.0.0-alpha.16":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.16","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.16","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0cc553802bb07320cf52ed8a4357be6f5f9c59f9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.16.tgz","fileCount":618,"integrity":"sha512-jHI+CSx02z/JRZFsEOJqa2LzjzCVOoPgPf3ds91Hmf+IOkCxA6Zyc74O33a5K4FC2i/aBWjUywHyRxDaYneNkg==","signatures":[{"sig":"MEUCIQCjtqYHrayK162tla75tNtV1hjE8RlA2SnQdUIyyTXuIQIgXbM64u1JPm1DHBRNZeJuKYUJxEw8AizMwfCJwsjvfmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":679799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo6/KCRA9TVsSAnZWagAAM0wQAKGBUXcv3fJ6EPiFqr8N\nBo+zfZ3nNqlXAtUIAfw9vrKTjwcf0np8L2PolP05fGByGqLjLf0T0p+bf9t+\n4P8NwJY2R5j5FqpOzfUysgTVY/4IWbC5yTNkNd1oiFreYVoHBB2VWyqWR8hw\nQQLPxe83358etuo1p+Fo6xu6Tcq+i4OjglyL3k+x+rd+1k6oLMjUKhawvEqQ\n8n42hbheD/+YR7Z1ObvxbUqiUcqLXHhXdDyUiUNrXmG9H3yivAUmOBa0HTZi\n8ffQtpUNTZO+8vMc0rYgNdHUlNJNtiHjRjZyltuAnypG/Msc1vUPHZM+CBPG\nPX5lof3A9+YZ0y3lN2pM3WthRNOc4hr9qbY7/pXEtQHNE35RRh0Qmr0TAHma\nxcNrmx/C+HipBFOARb0iEnGfvU/ALTQc1CxHN3ttgHrixAnG2edSskp/BXVi\n9f2OqQh3kFm34m9HBFyVOIMARTDjF+N05TyGkeXRW6twiAf/AfiIcqdC6+AH\n8E+YoSamRaNdeboucVyu7gACIGGl0A/zBRYk7YrVmMAeSw6BLDWOEUU2pmvp\nW7Gy9mOuO3bOXbzOM6W/nwpeaC5uG4ymUXtEZvg7ZMDLwV/tNR0nlQReZT5m\nuZqzSeiYMoZ3CpDHEigT1p1MZBdMj174mHHDDotUlRoqajmH5jb/yn4sFzwq\nGF7W\r\n=ulLN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2816fbe0238e98015abc2e4d94b73954e7004051","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.16_1604562889932_0.7701324783630881","host":"s3://npm-registry-packages"}},"2.0.0-feature-0644f4-kh4lmz3l":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-0644f4-kh4lmz3l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-0644f4-kh4lmz3l","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6768746b696e5d220735de526e64cba97f2669fc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-0644f4-kh4lmz3l.tgz","fileCount":618,"integrity":"sha512-LeW/ZPdz0XJHASsqitFCRgxFlgzJPuQYWfEQOfV55J6H8rbEX2eA7dp34P9CiSrPi0XHYE3G8xqukroSMM9WsA==","signatures":[{"sig":"MEUCIQD8bmdH7bPEq3O/jPbMkQvqdg0uVB0EEIFIzFxTjLSj7wIgWSGSw0quVm1ooAfUznPqgLh8dbJHFPnMeDs/lW+Si/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo78fCRA9TVsSAnZWagAAZCoP+wbDn0oLTcCHChfdFO/5\nmBB7i2AH61xvRSBsoTAwyTqu7lzjGlRCjjEthtXWCuTw0yqF4AeCNWYT8ihg\nTwpm7DR24wuJK3QbuI650RS0ywLfIyAvjSBDAAzMQrFxKr9I/zdp4GFF7fSo\ntcfsQ4V7js7KWt7aF2c/LCqfLcMmQY1dPxST8xae2Ld/UiskLZl6pEIk3orN\nU+3+Hk6gd7ZzLe1ZDsgUWFrPgg6FubphkU90z9KrLsNjx86FlzVu+ByFUJs1\n/iP0fi6+i0fSY0blZR+ltzOAC8cTh2jKsg14/xGB0w9C2Rijg2CIPitrZ4aE\nko3Cpl8YB1r3SFWkiW7GnQjMItGhATwa1Z6FrZrJPB4S7HI+P3582CQyDztl\nBF3iJJ17qvq2YTY/IBamn2khz5rFQJbRR0KZrhKqPHvNndFWrHzI8RqU0/kB\nr1GwBp7tqxB5vtTThBcHdny2KULxzcMo++f8WgDBAmR1oXXsvoDXPZgZMaa4\n4nSDQbF1ORsyfRRuhPmQpt3xYLq2oYGb+0t3nRAtR2c9ZpthAi9VMgVuPQgX\n3ceMMVVdWU/QGzAng1OlPAyrDLNoq68zsX9DQ4gzMoarVJ5nbxgAzFPLV0wp\nFNqQR+EDBTmg9is5fPaJr/Zrqf3DfhXKq/o4LoFM8qVDRx5rPuY2FNjEupar\niaQe\r\n=dkK3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0644f4be5e139da43fed2b8d1abaa451d69d20cf","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-0644f4-kh4lmz3l_1604566815211_0.426959347190877","host":"s3://npm-registry-packages"}},"2.0.0-feature-a2a8d2-kh4lr2oj":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-a2a8d2-kh4lr2oj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-a2a8d2-kh4lr2oj","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"618891c94c618ec0eef96ce75cf3cd746ee5211f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-a2a8d2-kh4lr2oj.tgz","fileCount":618,"integrity":"sha512-gRRVB2UWXhnXOaLzQJCC7Hp83SaqfY05xKTp+Y3KnLjZvKVN1VuBUzQhGmokdB1NaZK3SfvYkXrd+psvHNbHNA==","signatures":[{"sig":"MEQCIEpcoNhbX0ZMfODJ5XrP8G2+E858wTDg7LC58HGq6pBsAiBFXkg38Sd3nysZd8+/B2n8sy2AWV2jUSfDcmJhaPL62g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo7/fCRA9TVsSAnZWagAAKnIP/iwQwrO2mDJvOV6vKll1\nRKs/wFuz4PRBuMKYAZQXt9mGVTaRjP4npUEgUBGMVvRPhTa6WTeehjUZEscX\nZ3RrxZ33VogEhhQ5kkYu8jBDIeSGqEUnVGjmwnqYgMMGXwiKy0Tm0bRv5YQD\nCKRrdV6TWkxl+SQoMb9Pkp9n7BCGsZIwgfvaifAsYNIOfQ9c8cOFiDDiptXj\nnyOqNql4Moa57iAXZKFFU6iMFkwkAZe0Q8Rnc+V8e+d5A6GIwIyZ0Rqm9ZVi\naL4CnQVWk0HOmKm8AkKP5qRMoBgCn9a4jLb6KksELyMtL6habRXh1k//TfHc\nhDeb8btoWdaTjWe84uq2i6wLkKre0jiL8WvBFfpqkndxwYhVuJtcw/KN3yhp\nJkwKS195I06qWNbmrdKEWL/2aThpB6TKJGbn11iqJgn1rxo0opDnJCu94+Cs\nMwqb/apQ/5/FTTO/fPelvAcACBvQY3le/rN5xoYgUABj2Xk4iE1jedr57Unb\nyemG4PK2pOLdHs+D645QdvJch+2e0Ubf2K873zmnYOYVAbL1geaaNNaUBOLG\ngQBr1yuZjQDXwSba/YVOBwWRRxpzVDXbFysXef8JNWPJRw5VrY+c/aB58i9C\nSM564c7Rc7nzS7x+NJOu2yDMabmsbUW/YWum4YoizYgtASbDgwa43PzJN4Bq\nfoz7\r\n=Y9t0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a2a8d284821bb6f035fd65b4068967f823c9d9f7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0","@atlas-engine/iam.contracts":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-a2a8d2-kh4lr2oj_1604567006864_0.7491032866469829","host":"s3://npm-registry-packages"}},"2.0.0-alpha.17":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.17","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.17","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b03a20fe844632a11e78bc7118ba259e071a398b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.17.tgz","fileCount":618,"integrity":"sha512-87zIea/8TVAPa27ZZmo3b+Jgy9h+O5NC+Ewa55diEeSPibWNl+VOEpfFBNlsldAk6pSmTS/+5r7s+kVUmOwo/g==","signatures":[{"sig":"MEUCIQCpEd3Aw4dSg7dO26lRzJtLauXrncbQuRsySNN4JFm4FgIgXd0BOO9a0OMt0AGxzj857x+8aYQ+L9PODJhP5xwEvd8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":679799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo8VJCRA9TVsSAnZWagAAcTsP/0dVDp9pvvcj1Ijyilb7\ntPH4Q9aEp+adj0plqgFneG3FytxjwMWJWXHHx5B1Z2WT/WhJDs22lalPUldl\nG7dj1pqJTwrOQBhJIlx9k7/eIwum3uz5oHthyB27aCIyCkIEhQo1mSa7BRZ7\nqwGr64CNn+2lThdg+wqBb2ds0jrV1kLcl66DAoHW9Dn2A8XQL5JvRT25M8nE\nLJ4wAWry4JmJjOuNhgj2bAVUpx5N/imciyTfKqSb3HgYZGGroAjdiVIQOk/R\ni2oLK1Yb7CdGvJD+c5/vlUHmqIs4hwYEqahWhLegxr4Js5/1hdjG1VJ+Il8u\nVBCIrDGXkRc4+mEZxK5hqngXX092keA1vUhB+ANeor3T5qXAHAPaFGzYi8Fg\nF8mSmxP2J0Kmvrsji3cb2V+RMf2uSr+VpSEietdUKULQg7cB/3wPgnrQwAMm\n0ZNUNxN/7/MFE+lNIjka1jwg1VW1g8F8pnYlQl+yj6EHQolmJe/WtcCma8np\nVUMge7TBsZ1ts5VOE1hb2mTZ0ovx9cPV4Fc9zMMUq9QdiqXEVa92eWoIi1wu\nEC284nLHoNS+/LleDZU/6QyV7oXm7aAQhCTp7KuTiBdWbfAKso0n0CQHJqSM\n6UmBXVW/Xh/kdq+T5GtEsHh1TVs+7KDRG+K3PRBb8ruaSVC8+IFxuPeRjNt+\n23He\r\n=CQQl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"70bc962a9c9466292f3b47b9eb9f3954e18fd88c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.17_1604568392644_0.915163680556802","host":"s3://npm-registry-packages"}},"2.0.0-alpha.18":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.18","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.18","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"44ad2f2080a097bf41f85bcb69caab886485b356","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.18.tgz","fileCount":618,"integrity":"sha512-hoEQg1B6EefjKced63yX0n4bgUlvXNZx7nRVTyxbqzcpwmykWUiEmmrz+shpclAx7hvsUrNa0JL7UbGS4jEnKg==","signatures":[{"sig":"MEUCIQCcmmrTrzqS2bsYkYPfXx5LILDS6mWnNyouBb4XeHZQgQIgC8tVIFU8bdKOZ/Pw40Yq6lAdH7HyNMu5F+7Tz3zZlkA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo890CRA9TVsSAnZWagAAQWkP/jGVTGGqgIfwBIZJ0ZTq\n0q6aDqkbjDIoN0PXJZBBfYtabGoTyyS4O2sPziw+JRqgySd2PR6pozpat8mT\npifLiI24hg5F93saMM1v2v7JejQ0BpO8oPmzfHZ2WEgTun9/O00xkbcAuWDM\nr9QAqPg+Hwkd3vEz6UMViwr9JmybKxDR2ESELrZaGDgjmLjUf6bUOlSsRG8x\n17HLKcRPoldHVQYr0Nafbd6Bb7jmZPav+arcNCKnplS64chjM+vI80Q+Wq2F\ngl/dyN7qCtx+w/+vvJ8TvFg6Bw7o6QyUxu2ErStfkTemzJWALlFTlj+rVl2h\nwitqUGNIZ9mG4WrmFz7aG7h8SmDHr4qCMX3SH65N18NYI2Sap1k7cdsQxu5F\nbRone3L7b9GkEdX5z9yjaZ/BNNn9zrUJFfMptLHb9BFVx24lFREpzZrKsLX6\nnhRyg+bFN4YDEXdFsKfaTA+aoaFnrjYyGzkVgJdqmHOh1CIyD+zQF9ThI64n\n5dZCSNx5qTZtPUgtl2gLmmWnKzHZ7m5QyK/HOQGRbqwsQcYuIx7QHK76YMr3\n0VvD7UK3RgG1pmDoE5lO4u+IySdOLixQwj97Q1WZL56OQs9AWOkKDWFyXiQ2\n3HF4CbfCf8A+CwL5oPfpXuYDqEioDtpcQljzXKilnqyd4XXwP6YlaCUVyp8N\nbn0K\r\n=pCxq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"21b766d6ac6721a1f79f81388ad8ba94571e899e","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.18_1604570995517_0.8904164883682153","host":"s3://npm-registry-packages"}},"2.0.0-feature-4a7b82-kh4qs7u1":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-4a7b82-kh4qs7u1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-4a7b82-kh4qs7u1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5749b7ce569bc17f8fb54fa14baa543b0a039056","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-4a7b82-kh4qs7u1.tgz","fileCount":618,"integrity":"sha512-2t8gg6VxGxnI4RWzXrn7rA8p7VxB7KT4Wl+5Dl6l42aoNU8VU/cfZ47OclvcHqp4EwQNSwTGv6Vb8pazE/frtg==","signatures":[{"sig":"MEUCIAhy3OgP9WlR3liAwbjGeuKcUUXCRphN2OBNvgz6wx2jAiEAwX+W368XMxs+VCPwtxfwPA2Hn99qGcMUFgPS9bbNzCM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo+DhCRA9TVsSAnZWagAAeAMP/36lBzgS3wJ/Xfvkc0Dh\nViV7UGYj+q4UesJdzlmDw2oAJGuZ0sebnVv1JqbUMPAAAFvIWNTI+PLySHiF\nDI7HANQE6uTXvn9fWUoUYglbvyB0bukpLHDg4pK+vA3lsZ8Ln8F03YovHjKr\nrNd+7hp0iWchMBib4ktTiKM3bkKr0YqupIHqW/vmJ1URUejsXSOD2TPJcDux\n1nazCNbHDwO39BJL8tSlDcaxtx5YSHM9jP/T6IhUjC113BfhICCbmImWytmF\nwcMtLTf848yF15w6L2RzJMYVbInqe3pjAXjOPXauhcRbbbAc+caXtYU89/I1\nq95yrd3Iw9rf2nyHsC/8/wx0fv3RuhgkM4rXMVqb+ANEDbjP5JJXpql/uGIq\n5zEP0Jmse8iObIGEppAsOhxEflEpEE+08fAbrrU7wQRgi8lWxpGI4QnRvaVs\nLUvOHB7DQkPyH3uKg2ak5faApHzSJk2ekiJGAuGpky8T2UA9K5ePlFl21e4P\nb1pRyuhfQ0ZPNWlkQld7PbUlmdb88TV2EtBKfXuGs2fufu5JTWDli8L+hN7m\nuKh3SHd3mHbYCCh7uFBu3ABcxlM6QtPkadZlQ03Av5QIYy3b+1eaIsIj1ryE\n/kBDNQmBE03H1XUooC7yfPSeh7vWPAyXBnqfEj8CUJmHV6BKtGhQXyqCt/ul\n+8Vu\r\n=pOvT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4a7b82cd6536abd4342d8635c98fbf7a8ce29da1","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-4a7b82-kh4qs7u1_1604575456865_0.4457979512282262","host":"s3://npm-registry-packages"}},"2.0.0-feature-8b46fc-kh4s50v3":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-feature-8b46fc-kh4s50v3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-feature-8b46fc-kh4s50v3","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4d9e248b16060974fab1611f75e63104fc4b2c47","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-feature-8b46fc-kh4s50v3.tgz","fileCount":618,"integrity":"sha512-ORUv5OlWscsW4KR+Y47RKfqtBhUdb7pirf0TiGLFzKyeUP4vsCNmnvEJ7noJXwmELKEqfn6ThFPuTG0Do0cz5A==","signatures":[{"sig":"MEUCIQCMUM3hmdW8VKgK/Nh4zknuXt9zNreR5cxtrUQxFEenPgIgOgmohC6Aim1kl+m9I9Ye2QxPkWl+AgoulJFujPe6y7s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo+nHCRA9TVsSAnZWagAAcpQP/3F8VH8eTf80KMLMvYhb\ns6YhaFNEP6IBDpsk7zGhkYurg/W8jvAVHF+7ug+v0jvH9NnN85ZXQpFyF+YU\nM97iDgUC0/U6g0ln3zy8bS3T+HWzrVkety09Do5WlhsRlRoodV7+lWBsL0aS\nTQJGT0z5om9fD5UgZ2GNZKBb1+YkZDpjaWY3McpfXHvHpDGTsINtu8UFXhla\nv+VdEY1aBdbf9jX3lafdF0QXKAPcthSHHa5D0l22gEKkCXkzGaHJ9VdeUF1N\nOO2kDRZXTeiaVs8mmQadMhqQbWD7TalTSDfEUnLTCgvyticDt1I+fVS8jRlM\nw6Gmwm3li0/s1arRFAUOR4uXo1AJ9OP+JQJnFGXMYqhp9h4w5Z0C7vOwr07f\naBvzWS6s7S8ihtkA7z2NZOVKQyWsqjpql/6VMBF3DNB0H5mXZcCtCM8WQj2+\nNrrIqepdLI9vHuVHErKGzaB+5uKJlj1teZXR2EsoAn1KQDqBIVexNuB+ofiq\nXxqFoFu6Gea+EuUDJpR4cQ/2iyKK7cPRUSs+NlvofHRVKWaNw4+IxE0k5Ugk\nYz5MVIE8OVuvlxy5a+5HuJg0z9Sztk4Wxs4L6CSHsP0/uZKhjGgXxS56vg0o\naZ1e2Ad+zHvFvrVMmUA3qYOLOoqNjNtcTdeN0FGoVMu2F+MV08SoW+uz2kjk\nMEva\r\n=0Kmd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b46fc469d73759467dbed6bde97ee383ff98719","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-feature-8b46fc-kh4s50v3_1604577734961_0.20785868644555694","host":"s3://npm-registry-packages"}},"2.0.0-alpha.19":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.19","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.19","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"07810200d7f39159c5ce38ae0d9afbcef6c9f98d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.19.tgz","fileCount":618,"integrity":"sha512-60B3lYYD+sJgjzYyM7nBsH1NaMrTjXWR8Quvr37wSTUss641IbyOLFkJyWqXZtdwCkVq7umMywHKg5YoW6EIbQ==","signatures":[{"sig":"MEUCIQDO1yKfnjNvoqDCjnPAFjQBeraMvUtJ/pe+9bJJ9g4j+wIgLU/JAL9o5m+SsYBwJxIG7JkRW2mitlvo15QbT75X9CI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo//XCRA9TVsSAnZWagAAs6wP/1WOc5taaqfvFlBmieTv\n+x09PTWj0X21IeUqZtv0s+P3FtxUaSLB6C7i5AsBgHYFRFoeBx0cAfiYvQoK\nIkY4L1XwOiI7wtAezX7pnM5ioUNfxc72bC77O2vjwxdVWBn4z2SKyLJ8xFlC\nYj2nuDTZKPXzYqXBVcgFZPRhgXyLvA2K+Zf74qXGDWISnPXt11cP2AyFIW0X\nhu5riL6J1250v0kML6o1t/hKh28cV7jR5BfeuyaRy4nm1PhJIpBD/dBY4L9R\nbbGEqFQWoZUC0n9MpEGlIDax645p87wcnR8U2TOVwh928xLjrOtDSlUN/EIC\ne/pzA8QG1iS5otYJxQCWPntVDcfjnqXjPX4xrx/fDYehJSyKaEpi/psct6Cv\n147LIal+7lHb0fvAyTJqIHHla4M4xP/4IP+KYwsqM8Octc6WmwbBiSq/95wv\nf1oL5SKpXf33zF7mb82BZMWuLtR1DvQSrX7U6KYzYwnovCwf3zA+MQZjHH+P\nlcB+zK0FtXNcsOSbmYB72e/Mmmlj/5u7DNlGbZ5Fr/hcbQ//KHm+IvFi9Nok\nl/kFcT8vN8NzcxJe1Wh+xPhuzyQvXlC5aIZixvRd7ygfx0OMyiuZc6X1+sss\nJ1xJIKMespLADMHyYbx08QW5A9Vydq3fOmD2mbrKigimVg+Nu7MZ3lLJTMzf\nSnb8\r\n=Pzf8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dbc7f44d0baf9a3126d6ecf2950486ec92ce2cf1","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.4","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.19_1604583383215_0.5691681459888724","host":"s3://npm-registry-packages"}},"2.0.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-beta.4","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5ebe755772e32b776cf759276ec20ec45b601fbd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-beta.4.tgz","fileCount":618,"integrity":"sha512-1JhEhI/uoj8KjJ1Z7vVgPo3zSpPG3QC5F3sb9uH4YmcagQ4swf5xxyvDmBVrz9xRMrN8ejmtKDS0xI8d58Me0g==","signatures":[{"sig":"MEUCIQDyDe8oj8XIMUXAY6RJ4UCvVLwdQwh+cq68yjLWSO/MMQIgWdfGLpcSS4Yt3yFTYBK4bKGvi6RQbQ35tNfqTxFfFko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpSSnCRA9TVsSAnZWagAA73cP/1FuwsIQWRaz+yYqECjv\nKBQ5Ojemk0qvqfgSgkc58B2s81bSF3Tjkc9OK7SaP2tmfeKLLYbguliZd4Sb\nYhBVg/z4sGGfrKwEYBiVvUwTOGuAa+TbS0yMYGEt72CyhCNXhFhUTUz4RLLs\nSeqKJpq2OuTUn3TVGGcrwaIo8c0kD/9n2YNyQEjmH+WFFMZuU7dk1snUr8bB\nrNkL8x95cILapxNnSlB7D8fNv3xqIecv5QLv+h32ZQ1U1w5zeyyBZfCE7XaU\nmCk3kbzFCaFN4tmSyjeK8OngQ2a6Ad9FEyei388ZLZ209Ke7t8z+hzq01LZX\nI4X7ridnupGW3zVkS2RsQsEyNvbH4dPx+/jZkFDjRwNu9Yfu+8Q77eYJZrSd\nZ7rTI8OrfuAT+5q67vR7Tmn0zVysxDrqzVprs9c4tcU4pS2+vmVwfq/GatWE\nHrscKN/Hu/2RrjXvf8i+pa6Tm+db9StVyIlhWMEQa85tGFSr2sZjRWhUxuw6\nm9U+VesmRV1pnA01WZScHqiFYYgJTVAKGgj2EhYLuCSQVlkzCrvMoe5BPI+I\nXSWoyhdwA/H0IYroDKBVydQWIZ64bXP5QdFtcll+j6Tdnd5n2/focvoN/OHA\nwxI3Ti01paIAL2lhsNgIAMzYMkrGl8U9oxYQirOIMNUETEnX7yTFdOOYDJfT\nAvOR\r\n=egmK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"121be060ce2f0a671608588605f54a01ab5352e3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.5","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-beta.4_1604658343153_0.9159719808625353","host":"s3://npm-registry-packages"}},"2.0.0-alpha.20":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-alpha.20","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-alpha.20","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cfc827062207854e3d530c39bef0e05be30591b1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-alpha.20.tgz","fileCount":618,"integrity":"sha512-9m9sNUwbRPt7Wx28Lrr1hmoXH1v5QhvuObjI3lH8ZxsR9GFkLJGcFuWSAeQHgI5s9tqnk8cYmBea2O65t8g/2A==","signatures":[{"sig":"MEYCIQDaBv9YQs/h/HmlHzb95DwCMBTevB85aHKIHmw/OOOkcQIhAMpPPrWKojk3ApRXxHFRC4mCcPR2ijsxVkwMTcp9f+VD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpSSwCRA9TVsSAnZWagAAlFMP/jEE58GpvfOoKHzZTBvc\nt4VpKUeqJsxxrpiFKKUlzLWlwfZSASrlLR5U2s05mgOgUTYLW1z8zYT5Yn1V\n/jBt3bhYWKar5dgrXKQOfz7qlWKYmytR+AL+E+dZ0XxlqPVFXyrA0VF5X4am\n+LKTVzZcu2RVNgW1MnBcwFRcIPxn0Xsa6HO9tpM/PMCT6WOyuMFoXg0RNZ3c\nzVZTfT5B/sK0PFbx7kCtIGsEVMikGeBkDMyAYmopDC6/z/jRFw7sjTBxPpqX\nPsETmctTXyxM5PzyJIlWVoid1AH8GYMcXEN02+/jad9CkNRzdS6xZkdMidLF\ni2WYZSUkoKC8fWebpJSUo0wHvf5LE5ayuWeei7KC0Tn1+cERtnZoeGumqytS\ntOhW5hXusEz2AodAqwaUFZ3H/Zpbbw31ypF4QvUz0MkcQd+p7GhnhoQjrRP6\nXEd+ThVUKPeHF7oQ8xm/xaBdmtIGptGiSoCCALZME1pJ35/LHnF1cv0iaa4R\n9Bgbk8Zdm78kwX0+maBuhF8KJW1ZXuJdfRZDFn/Y8o5+as2vklhiG2xEvD5W\nGhu05LoupbKvfVpyv/PhrjBifAdwAYkqSme8mFeKpz7EGQXSpO2PL2SMsItr\nZukXYHRcjISkkc4JSEIL0vNvn9qEjFvAyylauX+HAhvZ5fo1yS6p8GCraUPd\nethB\r\n=S798\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"575b892a21cd496ff88356fe7c193d282c11b456","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.0","@atlas-engine/iam.contracts":"^1.0.0","@atlas-engine/process_model":"2.0.0-beta.2","@atlas-engine/error_provider":"^1.0.0","@atlas-engine/event_aggregator":"2.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0-beta.5","@atlas-engine/eslint-config":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-alpha.20_1604658352018_0.06758713077791256","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"926a521e927b6b6e87648f44faedf4d7fe619ce3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0.tgz","fileCount":618,"integrity":"sha512-rwveflUJxaQtdHe1wuRWwlZ8OkRqF1wT00LgQnKGGwLSxtlrFk5HBP8nNdHn165VKBnP6wjI/F3djIxB9fjpFg==","signatures":[{"sig":"MEUCIQDCPBv7EH4uPHf4m+eru9eS5zQbYh1qn3gIjHF1JXHNpgIgJM+aar+qEwe02AQqJsD8A5xKF617ppdNBmVYCP3fpZU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq9MDCRA9TVsSAnZWagAA6vEP/iVMVH8k54Pwd9+pkUDw\nGJUyaARRBSad3XJDdBDylHg6wO+OiaDeAMllQX1/QLf88Sc7eJDeiCiGrJr/\nLBY/VmkfQmENtQilTt91S5ApqR+d/mT6aTpMIsIYuHofiQAyscPf6L0XDh8t\nUfLy/c2viERdUkb2tuc9sFhnl/OGnsGYgybrDQ9ysOgb662b6YeueElAdoXe\nOKwLXf+jpW4IjYfUcCZX4as3waFxn303RQEJEvn0Ku0CEkznR5wtEUIt1eRc\nMDe8cc0OCnRPQ6txeJfySRz8dh3IWiEmCEKU9FEtxvsR7LZnHyUPdnMVWaKD\nQoK+fv1S+UI609jGCLpQwEwVrt8jPkuLxc/BmgQd3nov+6d7xSDUGsGqNp5q\nSCSKsfoPNrrWEVNXph57sVOhdSQB2ojEKsl8l37vKbxjyUpcpXtWHCO6Oobt\nXuJIH9MeMDbrMdxk3LJKtyxtx+ArlGDzP7RZTwKVYWNmmvk2dIpY1CnNBHbx\nQjctsv8fE2qjLnhNUdh496hqQb1rhQZbHWE2X84gkD0K6kkYrgwQILB4cGZ+\nrt5Y3bx3Q89HrWAD+VDo9yvFlkdKMmmQqeVJMXc090v13QRgRXfgpSd8JUvR\n+7sqMSmYyqjW0C9HVCIrY3YVc0502mNHP9cNnDPJNBYFKfbUxFHbs94l1uL1\nYCP1\r\n=wzU+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"fbd6e76f9c3705133374ccdde430f51ea1e8cad3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0_1605096195348_0.9295749451880582","host":"s3://npm-registry-packages"}},"2.0.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.0-beta.5","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"631cd9429c044b6054eccb77c5a4789e885788ae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.0-beta.5.tgz","fileCount":618,"integrity":"sha512-2+14BJnAWh5Epg1M/mqR/fqsP/RJl1OELbR3dVRs/232EQd9hN9tCnQGqo4hBLpc5GlKyXrkVCtCYxAdVXZGKA==","signatures":[{"sig":"MEUCIQCfAP2jvnMWdVWh40b8Mv/Zx4p5tGmoyK/+4UGsqmMVyAIgSfQZEOX8OfMqM5g74fTPzlDpWKGMyu6MveQ/EFDLR9A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq9MRCRA9TVsSAnZWagAAoAcQAIJOzTthQrg8/C8S6ap2\npiimjAgVFH09QluN84ZunwPmehItbwq7v8CPIUjYJaC3JbNTclXwpMAyzEbC\n12Xrq76rgpjBbgUS6B3ynxaUvCixpf1p/BrPMBnjpZi5DhRmOPRsobYezKck\nc8PUMctfvERGQcJ2I5078vTyktTysUGFvH+0nLnNOmKTm0K4bweCtVomqVSH\nAA0qRmfVhzqhDzG8totJF8w3sH/mX6QiWc492kNv9Lt9+PWs0H6a50Vnh1bk\nVXKy77afqzfRH/WN+4N3ZFERrRll3tnukE/J3crpdkHi/OBKPMObDshfRUHn\n8zPaoZuf/2BWscpgmjAgG9FcChRCvyCUGnRjBcmnsiF1Q4xXItUqlHsmKjnL\nib2ZrQtTv7pakjK3S0gfw7ZRSUdcE9vYYpxQ8C092AqN0BpyovzKVI6jesXn\nCir7GxvvnKpGeWtjnx4xc91TwxXgyf1sPilPjOsc+9O5fZCJ4zSUsIaqfXr7\nDCp2cA13mag6cex0TD/SdKBnjigm2SYCjK1EukSr2yrTGo58ixNTAR9Eao/9\nxiIMW+2niWdSbxEq3p/+t3Y5WaWeMMU7sn+YMEcgL/uvVMPIoTG0UgcG/kb5\nq1mCFxc47VByMcwKmfsvuueSvHrHU0Q3rSLup3r1pSkLPHLkJnhsGS8q+NX5\nJSG0\r\n=Ky0L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fa3cf87429a9828c7bbcb292c0587029dbfe7511","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.0-beta.5_1605096209380_0.30022965875114416","host":"s3://npm-registry-packages"}},"2.0.1-hotfix-ede8c1-khejphka":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.1-hotfix-ede8c1-khejphka","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.1-hotfix-ede8c1-khejphka","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8e5f040bd9305c0eb6bcf13e32865aa8d13da56a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.1-hotfix-ede8c1-khejphka.tgz","fileCount":618,"integrity":"sha512-vkBBiO32J31MunFAJaxC46QwZZUMayNaiJW5Iywgw0fXIiOWWAYkv1AJXd1s951q6+eFxf+0lvZ36jEdifSNHg==","signatures":[{"sig":"MEQCIAshh8d+rz0CT0kiRdbxVpYzaUmHm6AjcGucFVedBmf5AiBmflHoWo1s/P24LwLY7WC1Efp26gGWiZpX9XExR+TETg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrOxqCRA9TVsSAnZWagAAgAMP/31u+RyzlEtkK/sRklFg\nTuh5WLV+vBAPmPXT7wtSFFEGMs/kYu3799oFo/I+jEGxQp1/fp2Caqu3WjJ1\ngWJ16XAcTZ8l1AA/7lcC1omnKNJwJj4HwrKwUqG9OEYOvQ7fBG2qW8qB9+li\n8ELyDcdV02ge1DSbUUg3fOjT3RqA0xes47n7KXWm8+SWKqiCf5LHoG/VVMMw\nOB16cuLYUVqGXuWDYZlCUye+78pEz8biStKw7bdbO8pHB6xMTfd1kuR8xXpQ\nycclWNp0KsNwYaGp4hwwUBnbLAKfPuYxi+vXyRMrcTeEyzk1xXd/lmAHSfcb\nFBHYoCQIdOQHfReqZHmMOLXgCby9FujoztM07cCBDOAZzndlg4KEIGABYL8U\naqe29h6WlcRfnqSbMAGLWOAx4y9QW6Pv+Ip0zccdP1KYFyHKWXFwo8buCKI9\niPzLk5ZYqnPFdO3/hHFKav8j7liGd/Lq1sLyEIw6shmR7Yhbt8uNJfimsPfF\n0SAW7OT/eZ7/OQRHZGn96ua/4TviESKGs5Vqa/viG+v/WyIA/43xrQ4YTRQr\nvMf9GQwDrK3Iy2gdRB7NYGQVN4TCZ46j8iHYiZMsejhVV8uCdfvlOZNziuOR\n+Iv94WeF2C0Ql6YhWVcpa8HjfLUigblXPBXDJy2ZZPrKCHqn/vgsWgYKwhCb\noki1\r\n=oKTB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ede8c16f1da0a5119a7df9b26953adeab4969d75","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.1-hotfix-ede8c1-khejphka_1605168233629_0.41116561547402486","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.0.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.0.1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9cd36ccb0ceec9cb52643b66cb77036313f7c1f1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.0.1.tgz","fileCount":618,"integrity":"sha512-FVGr3PqgEySX0Qls/UmpqOOl1X0oNzYZrt2+HTOCDKJS6GqaJnZSn77DWf1MpH4EPfOVdmWeVL/ce8o31GWAgQ==","signatures":[{"sig":"MEQCIFPvGq5RYFOPfFnoMkSAN/oozCIPPb2+b5sL1LXNLJSTAiBuYg1C9TGoKD59+9XEsaPXKswyaXeIFGzwGgL1bDKE3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrQIBCRA9TVsSAnZWagAACF4P/i376EHEqirP1lzT1lKB\nzoNK9ne2YYc3KYcGrLE/wLeLzjfOxLmYEuBAzynQyy2RWsyprzHWwVAzUVP5\nwByDzOg3u8TM+huSjS/5Kz1qope4c/IAJKUWTMV0CkwWqrzt5RN3lQVnpDrK\n3n8SRB0Yy0ebKWOX6kTqDpDSH79pe1WmWiP8OgwSeb90Bgt572htZ1DvPjsM\nABoMAgBnV+LTBfO4qcgdBLaH+M9kPzGQeYt5obDDfEN991Y0rsAKPhXm8yhD\n8BhpCdy+8h5czF3XUJe9hcpy1aUklL3Quzf+8J+18200jPqWuuOw4YdqlQYt\nrYxhlRldChwfl34QPNouPWyuF6IjoMJbi0+0xL2vz8XwgugjwhpNlqWR0z8l\nb/TX8cMp2OmWmK+LhoOA7hr8glbyHpnG/yFi66Uczu8gefuSJeRFvsarxF+3\n654wZ+WGoMkb5+GgEMihrzY6pKqp6+BCqHfBcJdbjkX7k6yVKppA7QZ8Sr34\nMwEQ9Da3R0P96oK46I9WOCxPO0Oyb5xf4vEZ31UqAtQp9BR2wFbt9Cfo86W9\nyvATf/EC6iHQWSO2CyGROeafuTTcOULZ4UYt4ikA+NOP4UN+z8q5IXQPVVKD\nHE293dGFFBSJ/TpUxBQB6YHvwQqyaw+4SKJWXEYhQdg9pc9lYdhVxPqUlU4k\nyAUf\r\n=INiE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"6a1d89e5ccd407d1b164addd9e8a97bff1d74db7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.0.1_1605173760996_0.29670805308813675","host":"s3://npm-registry-packages"}},"2.1.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-beta.1","maintainers":[{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c162d5fa3414aa3bafe16f5cda8262e99024cac9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-beta.1.tgz","fileCount":618,"integrity":"sha512-WvXZCefg/+UyXpP1tlIZbbC4ILb840seqkvNjaIzcLJTnIcZNkokwP+YUgrtkIjjNjc8WW1tc8nAzKrjxaLk4w==","signatures":[{"sig":"MEUCIQChBbPf9YpnWcXHvhcImvW9m3PnxWYK6cGCFyH2Lc325QIgEZ6hetgv4nF1IgI2IkQUL2K+RMu25x0zkOZO+nGwkH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrQKzCRA9TVsSAnZWagAAobwP/3PSe1mXFp7f7LRc5/M6\nnbrFsPAobuAtW8GtOpP9GQ6QqSzRbhsPaz0dldGdghUOTZzk9OZkM3cCkXRl\nn1JQo2X3cq+TrZEa2j8pZZiD03+Z3HmbWFQhlJVcp2EZ91kMdX4n/edXLTxB\nSu4VYvTH1Pq7nJCws3sgnvifYGrs0kDSV83DcXYJWNLUPx/2VYJtZfFSz1g8\nzUascqVJrPl1Uvg1bi48sj7YhALRPITWpzr+MH0LUhdUGPdaM4MC0dH4i5Vy\nC0/osBMLKutWZPJfJ5qtVwWMldeMEt6H2B/+NM+mpYhXcoB+L/OwOXDGjaRy\nduo/mkqH7+HGOcdb8kEVbXZKgywfThccQ8lQePL0CUFBrFfLjOQ2b334Pyje\nsdmPuSst3Z1/XO7//MjycB+MEvjftS/THjjVH8otykCfiuf5sKi9xlL+VKfd\nZ0ZquuOpwOiIkARyh/FqxpQ4fzadJbTl7sgYkwPeCcCnEysLKriWB/sD52we\nllJPNv0myl83GSnCcFXjS499YR3Ke3+BaJEdahXM9i1Q+6iOJOrg9TIeIqrU\nCzUDhmdNPlETyBOwWov5HanoV3PGAVGvAQ87Yy3pDg/sAPcPJD/0Wz27ZEO+\nUzlhUS3c/Z/ljc+Go0DQs4u0paFfa1dt2L1VUJ3XiFg1GO0ION6w2kJlV06a\nu4h8\r\n=E2Qg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a3824172f6b0ccea252313a4f48d535282fcbf21","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-beta.1_1605173938634_0.013676912831797061","host":"s3://npm-registry-packages"}},"2.1.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-alpha.1","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"618ad812b0c54415da1b64677f6f4b6a02cd858e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-alpha.1.tgz","fileCount":618,"integrity":"sha512-OSuvtN4FUZPEYsaynHRfvFc9SMATPeJNgIwQX/LEefugSrkwuKvwloRV8x083YcQNxeRiDyKvLzvEV/taUUJEg==","signatures":[{"sig":"MEYCIQDE+hNM/oOOfDoUWvnrhyEXZH3/xTlfBtZTNkZVywfUkQIhALpS+YFT1uqdunHjyvz+bupwOHlfV9rJiHnKH+kmOsih","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":687792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftnbGCRA9TVsSAnZWagAA+vIQAJCnUP52RlFCykhb3TXN\nSR6v5hOtFfHyag2f5whDURO9nzjYfl7qL3YjoseXlEzb9NgVBp+E/m4hz1ol\n0RGNQjbK4JZdCvtOM5cjU/H1KZcMkFie+JpX+ROpvQTpX07KWvFcrFKEq1fZ\nyoz2vTVstpZ8TQJ2DCYhIONgNaxunSEIKAKRnUZiWJyx7qW30kbwKnWbHaZY\nLlvpFK0jNrrvUKdUSfeJ3M9HouKe2WJA4fuHU27Ccy2NIYiwlHFC/cWWw+da\nzIp0sKmspEdwlYd5O6r0pmOcCeoHJHKPOYzM5mU8onK5NlfLS/Mo+zRY99Ah\nWOX9FRI11xnSMUbMyyLtleGm/wAfNzYlNX52rKssEgt+rypnXDtSFPqEXGlA\nfoAYCxHUE5qDgR5TKU0nPIIQ+D5HF5Jn4afyCM7dPhjoExr9BqB5G5ZABLji\nLf55fhbujhzs4Z3msRAPAhSGubqBhCHj1cIU7Mvuhjy5BySsUHzAe5V/kZz4\n5+5qHl5ZAJHGIsdRFWfLAAE8S8m4MZ1AFz65gwiCnaLaixA8IDxyzFk1kPdt\nZyh+p+7TOmXg+k2jN3Vm5IPzT4gzFNabmvy956oUCESPW5Vkdmls2ngxl9nh\nojOqfwnGwCk8x2hkXrflyMJSKzN8mUKA95ucUi7z4f7YoHHEvLJ09gwYAn9P\ndb9P\r\n=5VEM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"913cf7307231a3c3748553c0a629df65291a0676","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-alpha.1_1605793477467_0.8631095239173161","host":"s3://npm-registry-packages"}},"2.1.0-feature-8b1187-khum1upm":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-8b1187-khum1upm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-8b1187-khum1upm","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b5a95a12bf0a0fe9f63a54338567b8585fe63268","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-8b1187-khum1upm.tgz","fileCount":618,"integrity":"sha512-ohZQBEBXXZuL+lILolSHXwV67S2yjS2kfnipgU2LH2Gp1QRrJtxwhM7BB3ee1kwl3i+r692emkxIHN9TYl5VJA==","signatures":[{"sig":"MEYCIQCZZYWyJucTMM4to0nagyYlKZcWWm+2OQcW543urj9SCAIhAIS9v7i0ByUljfDJmKuhP82XLd/GOX4zfOQce7EYOaXB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":688726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu77uCRA9TVsSAnZWagAAgK4P+gNItMFkM/WX6PhnWhsd\nQ5yaEplYasJeUtV9t3rq9dAFiF7Gi46tXTwJqTb/VH88fPC5oN1GBwRDia9m\nEAgNN4/JyfGaLvKgsIwkR/Qv4bZQ7dgXcdZ9SMaIgLRaNt/MO332YfppYSV7\nQgD9BNd49R6DhsYqdE6KsYwnacyK5QXI5IkCgJYL9Q+2XW7loXvDSZ4dCvh5\ntO87VX1udYlRVPdD4biA7YdlxY5EBIzFm233zYCFgc5/UOSzS9PEVdF856L5\nHU512buAqv88C6rD1GkfxCJols0cFOl2ze3NLs7w/ueSbXHcwR+tbWh2FTZK\nkPrQ4OUnNhKtti+4Wi5/FvSTE2LWGYRhdLNOS1w+MbQ2n1FxBCWbC0c9N/BR\ny/0w7l4yc6WfrR4izZNUgUc4Pxg3Ov+5+ArDSR4yTrXg1bkqV8p1O17xiD7h\niB1zTyN9Fvw/lZLJ1uZYmkEjGi/7PsyaikR2etN2N8kpePeYHjM/eUHlR+oc\nN4Rdgwp0elx8NknnmbEi5Z6z5LHJWhmEbY2hVpsK6o5DBmpyTm4me5fX67ys\nu/OWMt4Mlr1EEKlqQ6ZxOlZjsqu7/6zvLI5fg8VMNsUZF3PuDNBKCLvDuLf2\n+GvoczLc8D+qoc7FXC4ZizDcT76ywSN9mgAZj1fSISpEcbU5LGyP1IN1cnhX\nVqql\r\n=xWeS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b1187406aa13034f594821749997b0bbe03d389","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-8b1187-khum1upm_1606139629764_0.5570464697759512","host":"s3://npm-registry-packages"}},"2.1.0-feature-9e9e8d-khvqfj4e":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-9e9e8d-khvqfj4e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-9e9e8d-khvqfj4e","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ab2b94722c20801dbe3a2eb77704ee8e15ecf807","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-9e9e8d-khvqfj4e.tgz","fileCount":618,"integrity":"sha512-NJZ4lhoilz/yPkvrZ3tMiq3Z/bkUqhXr95RsNHvUSmI1GkwRvW3J7rYryT1FpGy+eTz3Xz3h0gO9ud65ebVE6A==","signatures":[{"sig":"MEUCIQC7p+WjcoyUtmFAMYI8eWu5WYAIicXqLL0Fv603xu4+cgIgV6j/kN2yDBn+vUGNlCqlzl7AaaW81B47dec9MI09xGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":688712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvMfaCRA9TVsSAnZWagAAOocQAIA9X/rXzircaORkVLCc\nCy2a2Q313KBthfMXUJThcxPROt1oirRkubifHW2Rgk0aaZhLSaWraUkiDvA6\nYi6XPu60YxghGQ/waC6QDPtIwT2T9yDODaVYf5BhIN+bPEgiIEfGNqkQUk+e\n1GBhOY2f9RC7Z5Mzhf42tafv0mUQgBkgvFulosGoU40W+P8NjNRuSJ+wEXwo\n9LoIdRyDFkZwqvgqzz1H8lzxA0Dgc7CvPVo3SCE4wlczQWsThoPWUg211EEf\ndnr6FMc3+/D9AwQrfmyj6+/+Z2zcPu5v8EqvOMyqvG92736DamhAAPZLPf7H\n8XxW1Qndv10Fep+7FZ5zpL3HCBVTtGlNqO+uz9Ng+6umKrc8bBvnGcJakTRk\nza/Qx9frFgs2WUx5ebKn5VUDWsIKp87KcdqEKVF+w1BzqXRiKrzr83Bn5E1B\nS2GtL2brhDgYHB7xUuSo0d2+DpQXusCGlRkO/BoFs/EzqZBRu3vAsEq21bBS\nM/OmOz/WkxTHUMosJCgCxgzo4N+Zzmw3c0Z+SipSPj/LqnlCNGQ22KdfJi6D\nKs+eqVJ0lbZueE0say9qpzqLogsbK9FDnIa1NZZuQVzcvPeGAzWSZA+ftjog\nedPG5KJBCrMUSxlQ6dDFPoQUW/311vD08gwelExd2EwcV9Q67os4xvNRcEmI\nSrJ1\r\n=DHu3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9e9e8da93ee1c770b5be8869e2c6c7ee02a646a8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-9e9e8d-khvqfj4e_1606207449740_0.40261308701173926","host":"s3://npm-registry-packages"}},"2.1.0-feature-65ac47-khvqn0ys":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-65ac47-khvqn0ys","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-65ac47-khvqn0ys","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b81c4e8c44564d478fee3fdab8b0279c63340a42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-65ac47-khvqn0ys.tgz","fileCount":618,"integrity":"sha512-ZBT+nj9y90GsN/Y397LEqh2t6GxCxSJiYWhmbYb7RqqBb1PDKCT2IxCffPGIofDkxur5u8oKomf2s1Nh4Kl4dA==","signatures":[{"sig":"MEQCIDtEQHE3oST1fZ5hMm1PlZ07Rs8Uzj5VNAbIQhdCzwUZAiB9meEwi9n6lrUbuFmR4eOpkdTKy437xm4p63BMRcKrYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvMk7CRA9TVsSAnZWagAAf0UQAIlufv1VjyNMN1lilSkc\n930cwRWyuVd/WP1+zmhohvTJjnb9GTY1ruozeY/sr9ZQx+ZLCt/noNRnk1x4\n4FfZPYd/LJlg5xLe6oViJ5faqVJ0p6iAfYUu10lvlvqGH6fLyFGl44l9/fsI\nQB3opR78n/VD1sVclg0Lvj3Ebz96n9OjBLeS2Wg/FRV6dfhlC/GthYNFq2+d\npDbgdK6m+28PUinmZll3EmlTwJC2VtIs9azUKdWIWRswoGVtrT7FZ6CS++yM\nd0XB1IaV7NxLY1AkHtTIY8qez3hqQOBjsbOGGdUDfROcY8BUGs9Qpb991NDH\n8Q6LuQP2xqOa+3HEAMssiGbLZyKj55hN3Ph3Z+289ibzK0HpnLZeElY1o0L9\ndEta3lMUJI7OW+Pq524pxzvhdzZl2W85w32LalEfeXBbhfduKizm0OWMiiCu\nnPkR4yC7KVswUyhunrs0h9CnHhcMGrNnz+bBaNSy/M3PZrIn/+zO2MkaRQ3g\n7zUbSQAPxM1F5DK/W1ulN2D7kU7+TUTXuATk648ps4/oEKPavH03yoaTd7lc\nz2zhiKnFbClXHZ32hi8g5PwI2ArA/a+jAxQGE7QfQcvbHdwIWzizmiC81kkY\nbL7YbZxlpD0vSN6YXK8lAyCqWmhIEU8NClSbJqxDIFCnKgv2/4FZ49bLTyHF\nOH//\r\n=V2FI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"65ac47ec408008fa18b671ce134c5cb2efe682a4","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-65ac47-khvqn0ys_1606207802461_0.8874787207605945","host":"s3://npm-registry-packages"}},"2.1.0-feature-bef1e9-khvqrkx5":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-bef1e9-khvqrkx5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-bef1e9-khvqrkx5","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"465b97817d50ed1b4c1b813eb3b4a4f1fdf80796","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-bef1e9-khvqrkx5.tgz","fileCount":618,"integrity":"sha512-KQUxIU6ib/oWqqSC19q4kcXfsZlGZ4VUg7LWS/ZZJsYUd3MXpHiw0J8B80u8XlZU+Ou8apdM7Xz2l0MFQaRgHw==","signatures":[{"sig":"MEUCIQDe69L+of7V+GI92tDJlkGf7MFgxcQkif2YP+cWabU26QIgbLIOs4PFiE9flaILB5yDIWfg+4cn+KCL9V0QzGXZ1Ss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvMoQCRA9TVsSAnZWagAAwpEP+wXErkzQE1JHSLviRYil\nsfnFTNd2sWfyHliIdib/xAEoJINUDhtUJWfqT4RPeLVptQCUNj2J+X5m2kmV\nUE5A+7O5/vcs4dwzzBbRT6QwGqP4JtXLKtK11Q9dJYzDZzBV95TTYZGDkSF7\n2yfQpjRl8Ebu5STOj6wi1TsWIF4P8MxlDzXh3pFetVRz9KrGCUtGxaVWxVC6\ndWqtk1IM0upW4f14oyyAnc/cB4/cXP6j71jV/GsGc6ex0TqAyOxvD61WN2Jl\nO9yEwkidV3myk91abqZNYxufG7ZFblAtaiLXKJRzg1CX7KC6jJzP7inEN1zw\nHsBaLs/WEvZrHqcba/EU7QUsxh+6Co2i+GV3x/8I+V3uMHN3MwB4JsGDTO2y\n+KhCIJyGmaIbMkKb8jsPTGgIp1J7rYy4YtNSXdm/f6wC0Ij3YTHfO+7UkVLT\nMqat9YArvoYyws5HUAFsJxlDoUBy+A1yofDuWf/NbUiB704ECPnoaLVscd0g\nHV3S9GTyMNjTiSms3m/irHAVyoyBdqjTNZRXzQ69I5/4Os18oDz16Wjn+6WO\niIhzJmrjRM11Al2RlD605wWEc0g+aG+VXmD+w8dm77C8ETO03OtGv7NLTxgp\nXkP0toAOP7U0qRUQrnDU/JZKZCJIJ0J31V+qVESqD87BRQsxzyo2F+Y24OlA\nmWhd\r\n=0man\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bef1e9b76a52e438497991e64c05f82d41aab171","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-bef1e9-khvqrkx5_1606208015888_0.1961899744722888","host":"s3://npm-registry-packages"}},"2.1.0-feature-8ed657-khvsxg03":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-8ed657-khvsxg03","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-8ed657-khvsxg03","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dace76ea0f9264d33dc4e23019649179a9ac1cf3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-8ed657-khvsxg03.tgz","fileCount":618,"integrity":"sha512-b61YwLmYQtHbjUSklaBhZnTp2rYCxb19M2hjcAq8ZX5lYjCHRZGMQKmFMhvM9wamov/p9Blu4RpL0zky8UZXPA==","signatures":[{"sig":"MEQCIHQP///JyscOVrRVuzskFhcHc2PVklAVTJVl2+5wuLKgAiBDcRcdRKHHH+LkSpfaYKEiWaU/f4PVU7a7BmVXrlQnGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvNg/CRA9TVsSAnZWagAAUioP/ixwMG/+Hv3AnwrFF1Jo\nrhR6T33JwQfTwLF+bSQidBiUUwqDqgU4XBq6wRmo6E/PLdhGLEGtRfJqQtIe\nRZzdxXOeUmtIm+tmu3bxsGzCKRDizJZQVfoFWRcj7VARZCVt0wsJXPiAi3W1\n7SBv0wPj/VKZXoQtRa2lHfDlk2nb7x4epxs7OZZ60gCjsQ7g5n0shtIdgNoc\n5WbRAt+mLM0vB2r5CsHBnciHIIAEZ3uDvjt8yXE5vxxekdhbZyjRbfyoVkD8\nhx1SkvrvSm47u2OengTIkq2QFCrhIc6P6eUvGLLMYehs3dnbAZ3m+o/83O1f\nKQ7bYVynldilhCFlJOeLGOlgeJlZuBGc9TKjRx2X7W9QH8xTHMg1zm3dH2i/\nRKOzn5dpSwkHkWcK8Uo6zRgROLKSEalIe1uvQaTDGm3GwTeXEz5vFxNjuYq9\nBXss9EQxdyY/fBDxeN1TEXzemDZWry75ILniTHZaKCAXZpd/lq2Dh5n5XwHT\necCk+kmqQQrsDZFHYQQoNPIXpM8Qc4wF1IBgKRxpjQU+UI/uOGkfbjOUdPbn\njKfgQxFwrAL8lTg0vwyiYUyfIXHmE3OAv26TPl16eLr8KJCAeHOntqM35iUi\nhpN9icRMrtpi9AJgG93M2V3tqlvYZczU4XCT6O2JKBF0fZGzhYRLdMGd7eaa\nM2hu\r\n=0OwJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8ed657f3a3b0ac41bff66aa509e08a5352ee73b0","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-8ed657-khvsxg03_1606211646766_0.4524382989723097","host":"s3://npm-registry-packages"}},"2.1.0-feature-531f3a-khvthzxn":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-531f3a-khvthzxn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-531f3a-khvthzxn","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"39ab2cb259fdadc8b5be96da70a5f2e02bf1572e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-531f3a-khvthzxn.tgz","fileCount":618,"integrity":"sha512-n1+uIHJaHKcekedN3V5vMNfjFxLfOPdSqgDojEL5r/cHJ/ETWe0duqO27aHKsVwDeiTJAEbV53Sk4SjsV8N0hg==","signatures":[{"sig":"MEYCIQDJmhYHesPlIsh/eFUW5bvB3As5x3yC2D9OizNwv8FuCwIhAOdEb0lBtH20Yaf80rVDXdx4HdF0JaV4fxX398SZQI+F","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvNv9CRA9TVsSAnZWagAAPM0QAId038FXk5hT+VfQjb9b\nBZodMaJlBhlJBMk+l8H+s7ZoiTwUwngEDeDaVc/yb1YvYdNXEIimi0W+AA5S\nGKEbXOPhaz8ZOhi2ybeYS3ROJ8N7pGaMMcJIAPqfnIVIzsqqaZ3hRIxcmyT7\nDeBt+r2KURLTFZDNNJWKBiCAUvXL72v2OMWakMTGahK4rx5Wc5/BMk67vBfG\nwvN/Gvr1pcRy7+j/EXL+v0wyrqQi0cc/CgasDed0c47srag2rQ2hlPGwt0No\nE/j4LqgBewdf08Ye3ExIWqZXRyXrI7VVi6j/fLoBMdobhb1hiKDJoou/6X1m\nyVCAqFz2w8QkNPEYzpoLKabY5OMMKxwcOk9UxcEYKB4kdJ5n0/6p0g8b95iR\nvJbYyriCQviGCDukojUvEcQhPTt3BqI1lqnaagu1LphlMySgGRFwl2N1HqzJ\nUEMjDmX1r32YW/hiGbDtEWQ+t7IEmGFMSrDNWl9/qO1mMDnqh9B45fJBCVHK\nchrNFw0eZ3cIgHMiyx8c6N9x2wQx5OqXN0eS7ax0wxJr0l/+kHUP8DfePTZG\nFolB0sBh9WDoiIJgFnqhLhezNaCaBny05nG5ZJq7gAlsui/TTSM+CqiVPfma\nLePsl6AAaaG1m5zNoRo5fD0PhvBn5TLDeSwi2jAA2X8bn0vAkZ7cMibNc1ej\npsHm\r\n=7Lan\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"531f3a6144e6cb67b9f6163814f0a2b880292d0f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-531f3a-khvthzxn_1606212604955_0.14664892109917016","host":"s3://npm-registry-packages"}},"2.1.0-feature-c55038-khvtl821":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-feature-c55038-khvtl821","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-feature-c55038-khvtl821","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0f34db609696b8ce47e8fbe1726ba34502074002","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-feature-c55038-khvtl821.tgz","fileCount":618,"integrity":"sha512-YitxWdQrkYE483SC4pRXAUGxiqqq+HpHI3P7Z4hSHOos8X+GhTYhVdryb5ri5Gg74sDfUONLc5AmqAugH0i/1g==","signatures":[{"sig":"MEQCIFvbugvumAMRJR568a7zLLavlaj5AgIbSQnOVv2CcRzJAiAKuXgF341jISeXagMtKdMdaPzahwh2ULgqbySokH3emw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvNyWCRA9TVsSAnZWagAA3zYQAILj+KmjdmZRUELP6cPi\nLPIGbfK0xzW0RdZwgXt9dinoTTaarusCtdTbbBTbe1B63SXsgJl2NH718DPS\nx5ATbiofpGL0MCK5ucaXer4ctEuT/iE8A41XspiupbSXEMGUJBSxUsCqt0UA\nhnyaFgrYmwTkhBsa7TFg2ajEnPKeRut4QQElNJ7n8rMP/HLaZEZzSu6zq/zy\nzRu+l8ohfkcImdKPwrNQdYqqk/+NPNsE3ifvq1yyEm1AJSmFN70f49qyLOUN\n5Pd9NAVBatnEyFcJ8RROY/qNfaRt9jeyzIxvE+5rcvZu9Vu8/3uEsSkt5gp+\na5Dx1z7NJAH7lwe9D1lGti0TTRxIdKm9M7tLBt8PEeLlh2XqYognqKayNVIn\ntYqslYZm9MTKqd5yrpP9mqY5dKeH9SsaXgoSQKT43lteaJfxHEzFWmxSjULl\nqQ4NqAXzVfmDEcGNiYG/hGtJqzZjY2cHfkfnHI1wY/UhTBvmmwHVKBfyXKnf\nS5P9b2XgTtxZF15qKp4/kaNXUZ5JbG7PReaunxG4EStuMUkj79j0WDkLkm/M\n0lHUkD8TxtOxxl8QqVwZAV3du1DaeH+xsFwkcmhDmlQNAFUBd8t1j7CwHMP9\nzhj9i0enTFAM62DLtWGwvICFNuFhI4D2Dq2k8BqE3wWqMi+8yXdtAf5QMeB3\nqPNR\r\n=LVwk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c55038d722fcaafa440f25289d2aac3f324e9b8d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-feature-c55038-khvtl821_1606212758054_0.5768361214814317","host":"s3://npm-registry-packages"}},"2.1.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-alpha.2","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f172b6a0d48d112ae94a7e36f131ed499ad0551c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-alpha.2.tgz","fileCount":618,"integrity":"sha512-q8X+1HJzzqHSxAnrfUBsVB9oy6SziUQF/eoaYroyDNbhiJ0HP1pJdiq4u8DQWpncimTCPn6YXQQBq0dJFr9gUA==","signatures":[{"sig":"MEYCIQD4A7VpbCZonumAWYVOdNPVC2njEOzm8OPhETS/8PEdwAIhAP/gP9xCYMwEQbFc47jusEWgVRcwpFfoiIHGL8SuxF9C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvRs/CRA9TVsSAnZWagAAUBMQAKBdsFrM49mXfqHs2saO\nchhlsepBS3JsJZWxZBrsBpiHSuhMTTMUDODNswQaIElN2XBdVwpXuIcmooXL\n7enGgsqzVQKQNFCLq6SBd1cgLQNTxw1RVwTnVnoTbeas0loXqus1pmUt92PL\ntxNxOx7Eoms6lHcTZFW/6apCnljR8OGjrXIy/8ZVsYFF0feIAiyrUKm2simV\ntkSMlHSMIGY+0QMzgrxSMzOToSA5T/bhDFf3Je8yx2D7KT2WRN0j6r2mUbwS\nURO4pDCbw2BBC5sTUybKXYngWo9E17F7yPgs0cdnajwShvIx1WALteAGS8uy\nqfVoa6FZiSQVM09wNNbRgtY3G/MRyCWSGEYKZng8lskGYFVw6cKl8Oyk3FWk\nq/7O/pyzs1bsYkBIq8O2NHMUvzPI3ZCRZetZdGyMWnrdfH27oItUEKzC6FRR\nhk1c6dS2NaZ3Hu//YTK59eES7pbbrJ3BrFXJ2UEVmrlZUd3pt/3/yJo32qmW\n9kdqoPyQ39mqPN81/9Qy5ZRqHwjmiTOfhfuo52bjMKO0lPJzPgWK3ngjwkRT\n+xf+E8C343PAM07hs9IhX03FBih/3wfNFrmOp0wNSBI5WIRVryAV71V5Fgsa\npXZk2KMsEtqLfYMuJH4LZMoTPk2uMCwsWqhbomud5mzPXNoNr9WDM/fYK57K\neTlI\r\n=tRpb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0b62079c21e9671c6ff975795b722bd24b7d5279","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.0","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-alpha.2_1606228798610_0.42470012441293026","host":"s3://npm-registry-packages"}},"2.1.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-beta.2","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cebdbf11ea114da6ec7243e4ad688810145a8d61","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-beta.2.tgz","fileCount":618,"integrity":"sha512-2ZHy8fvH2BhA6Y7tSBsLuCvWSzx2vX6x+vJO0qKVTguym7ow/oVpC81ZBukiEr1mOPlEPTwMrzjMhkEEy6504w==","signatures":[{"sig":"MEQCIFYHvFDwwgwS25n+vUtW3y47TAppMuOmWttxOJrjqC0oAiBlQhVW6UU/vGKnmeXapsYHEMl7pUkSds1TB7s9RH9zUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvkRCCRA9TVsSAnZWagAAlMUQAId1RFmOAed4oZj4rpzK\nC8MW7KFKZU5b5JAoOBFrhte6DYNK3gCLYIlIGY8Eol1DtpBJZJ5VqdCEnOOZ\nZzJF6XDIn+1rRNLUc1HftRuUEEF270sSpgkfEiQm5oFxap6XQRsSxeJKEMUD\nGd6Ss4dsmxcLywZK3im8J4LLoDzD10WI1hfkUzR61XijnsYqpoWyqca5PWOf\nYtSuOJGiiFauUnPLz6YhZPMPyvxw0pfBeFOr8WnKaMaxVt7RoQP861RM2Yca\n4xFO93BgxnmTQkNbZeJnYk0tnkMowRw4XbE6b69eu2bKy9TvZvOcmGWrvk8d\ndRWRaXQ8FB/BekrqDTRWm4hFV55Ettf13IIgX/Xwiy78+U4gvVTGxFCrPi98\npx1hdRsXf0z7GerZX7h06I7It/+JizoKI02gsmaVJoHVB6or3F1iV/rVpa5I\nGgz3gHfdxWMysMw98i6aeOJFunCVa/7w5j2H4mUHFAYj/8Ojsek13j9gsCYZ\nPX/hBX2JMPtC4GN8iLp3d9IP5xNZAWMyoCdYyTBJXGNOtYGruzgy1IZL6j3g\nkx2AwSagd2gLKUb62K4N4urcmxB+n8Fe4UR7AVno8Dzx4DjMbnbi5BJ7fwoO\nny0q/XcIf2KAXVIzuKfOtcPFqmn0K4zavXgnBs6dE8/5M5wNqaj4zjNOL8/z\nX+9r\r\n=ptmt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1c4076289c37994c84ae31ce67073857f06a15c7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-beta.2_1606304834219_0.7228679738510759","host":"s3://npm-registry-packages"}},"2.1.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-alpha.3","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4361160ccad4b5569fd21ab4c6d82808e5c7f344","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-alpha.3.tgz","fileCount":618,"integrity":"sha512-pSCFHB6kIdTzgJ4ieyDfOQsQfsTEoulLCnvz89Wqw374CDP871An09wEv6me6qNuCA+KZ5a2ED2aQtUgTbC53A==","signatures":[{"sig":"MEQCICo9Ke0CQKMQ9214FbvgsQRYy654GLOL6l++DXXqM38kAiAW31XJ8nWfXiNW5I/2e2uJg4BM/7saTGaysa0SsLs/gQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvkRNCRA9TVsSAnZWagAADT4QAJN/h4UkK4H09bQ1o6KV\n9nyYAihELG9LhIHMSOkkZFQ45ljZjbfUqrgnCVy4GRbWaFSfoPCURCJefd8h\nMI/mMPOp14YkGJa1456zgt+lwGGSKX8xU52ehKBJB8ZhYbnmjEbpY1zccAbZ\noo0Et0XvNWNj4IzjqJdWrskEJbU8E76naKrkCReIdAfkMH4ivqNPraveG/Kw\nGWhMUbfDxbCJlpihbpgGHXUd3oZHdCBHf5YM+3flAKEjhooKVniMUcxedPqu\nqO4YBM8nd0dIlywYofqFqB2ewur1+JbemeLolgTGsnNyRBe/s2FOsX/HwgiF\nfQz6qHBRR0Iha+oO+oa+TuJBA5+9zZ0RsIUGLUbAYm24Djpjy1g8vlMUQXIk\nu30yhcM2g5iMEZHwvsh8wjro4GuSFrowST2SSGfcFnxG1vNzBBEtknkCcN7d\nPGCeeSXYx6mPV6yCzx5hyJDGtfX7dvBkqcZX8m8yXaavvTn8bMg1ZBwLlXTH\njApG5IMfhXjGbR1j/r5JI0lSlzoSCMFlD+ejf7WL8vK9w31PgK7aGFJ/pOYZ\nv2+o9zswmE55mYcaNKxcDBmsJUB+d/jo9jyrsq76pTxh4ePlZxeXKoVJiTtL\nl2q7PqshqqkS69ijcE0b2y2pMO03a/mshaCHgHE+SNc4g7oiMj3gBcXBFrHh\nCcgN\r\n=WPtm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1cd0dbf8b11856674abe28333d01a64f50319f42","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-alpha.3_1606304845008_0.7812481113639966","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3db5a593c9687dd4f4b1274f93e2a993cf6877ed","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0.tgz","fileCount":618,"integrity":"sha512-cKdXieeJ3RCtxSdkJz2uRf/H//fi7gcUyXE+T5QwcvBLZ9FYpTQ7VBrGbCniz8ZQOwgexe1WULgcHwqgqxNz2w==","signatures":[{"sig":"MEUCIASTyHqkyCnvXVed6CJZtyaALifSG0eeUlxs/hv18vBwAiEAiGOWkhBcDXX9H0GaD0syMZAjjcIigNmCOWwRXT2lLf4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx1nWCRA9TVsSAnZWagAA1HoP/0xrhySc2Xus+W0FRwPC\nCJCC2dO4btr242rH0bsqpYXLR3NX7fefnkk0ESN8/ZuGu9apzdtHp6rgLrJC\n5xHxClMph55yAX78OVlgNawgyyWmIaEV2HuObZHwqbu5jjheumfan5c3kmyN\nSKhmXogHpGztWab0fUeTR4Gd+hMGCqmLAWmXHx9nB+hbqfGK/V6ABWH8nPs6\np8TMihfL2pVwIz+/gKlvr7CH4yABcYpPqqzdk3Rtpu2KybIex9h9l0+8MnGN\n2KoK7krSxY0WDVqr4lCPnKceDIqgNNF+i0D0iQhBl2wpVXDFu2GrKyRU12qR\nhukqODm9esY3Xkl4wdO5e69IF4bRO1HL3NF03W0QLljgcagJHw7sjlKwNxCY\nAhk7drlY1PCLXab5n/Tbom1fGwUwqQlijCaoKT4B8dq8fdASwEVu3rU+9CAu\n8DLX4Jw7MsauAJ4XCHRtQjBHPaR5sbiw8FmHbgpCw8gPFwyzvWBKbA0Lqtb3\n8xPwDS0uqraJtZkxcf2gJFd4U4tmae/X78UAOR6n3eKKpx4qPkCM2mQW6Y+J\nhZG3pc6VDFM/8251KcfXO9FyjWkvuMs+c0ioMPmplP5apa1C9zsMV8GrFL3g\nwOWmkHWGVdTHFqfN0wGv0os2i/zLjGJgK+EtHlkG81UqAerVu4QiRkK5Nk8p\nmBVZ\r\n=X8by\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"e7b355cbc999aa59b1ffccfdb9658048161f8863","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0_1606900181740_0.487055290082695","host":"s3://npm-registry-packages"}},"2.1.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-alpha.4","maintainers":[{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4b157125ab3a875c97d900445bd55096cf1884a2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-alpha.4.tgz","fileCount":618,"integrity":"sha512-+5wRtOIFg3Od0u1ZE7m6vS600KtkICZXWtTUflT5EBiAImHBwjSYMikVS6dedk+rOVaKkTAYhBln0xfrUTz++Q==","signatures":[{"sig":"MEYCIQDe/PCfF3oawLLGpsayPteWhivEvGplbpm3F8bQ3S5DtgIhAL9Ya/Yc/X+yYlnVwRVy7cBcMU9oBLhg2TnwvIybcf+d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx1nfCRA9TVsSAnZWagAAu0QP/2YPeZTPKDKoshXejooW\nYg/3oOekoro+NkAelen+u8gf7VUvC9/xt6V/q87Gdf1feryw50rNFQ5CGMDB\ncMev7Avuu4YcEbuq/PKyJe8RHInjfhJVIzm4uNywQPSgJh9LQ5fyVJnuJ5rH\nBccev4OoKrvn65SsIxDqzUxeZyxyTYwYWiqJiELNdP30zgv1UqVK5C+6QnmF\nj7Gkwdc9FHPioh+TbKXyi1scxmtky/VvXUQeSf1ArBmxYhREwiYcN5RIPKLU\nuWFhzB5N2UFnKg+//HWcEoXhWANOmTAxr5UBuvEA92NOlUYolbCViY5zxHye\nOQNS0mgN7Q2pTVjOgkjmwXd6TZIMwpUw/NWAomVA38zSxKjClads6of8ed/i\naa4tYhoAgfnD4pO/aWvcsnf6kUjtW2tnm8CAPr283BReflAGV156FDWVXuD/\nddvv/wI/vLKEjdXFxODoHCHbiId8NDI+yWnQ1dF0hnp+RzbwRy3a1J3VCO3H\njqn4cnPXvk/ee6EwvEB5v4uPW9vjchWQwn3KHeBQfQ9T2HFCZfEDph1Pj5Z5\ntkRzayXcj5A/zZR2kWUc0Qr26QTTL1WqntM8yU4EVa3fiGRvr/Z3F+mnl4r2\nW18wyM0lW/NeQGhF5luFx4ukVmN/CM/NbC/WzFdp91gbrOPHdmDlpxSZOrPW\nI7V6\r\n=1LjE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"86372f5c5bccdfa1591fb5b70a8ab665dceb42b0","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-alpha.4_1606900190977_0.6949425396805748","host":"s3://npm-registry-packages"}},"2.2.0-feature-b82451-kjtx7n3b":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-b82451-kjtx7n3b","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-b82451-kjtx7n3b","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6b6966f82c0f6d34021de6c9b594d91208adc4cc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-b82451-kjtx7n3b.tgz","fileCount":618,"integrity":"sha512-TvC9U+qM/R4AOwPzxuby6/uqd0rbISnCdwxMCV5/uZ/97VIQG61n4ZOaQCj7pElFh/23LQ8YdAtIFJbWJzRvNQ==","signatures":[{"sig":"MEQCIDZFNX04mGnUV9vVHIc0oHwJaT/3qE+X0fh6IvVG66dmAiAKdenCno29SdXhHyAIm3J0gRcTJap2F7lZJkXo1aPIrw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":691249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/YoUCRA9TVsSAnZWagAAZ7wP/1AjMmURN/XEGRoN4Cya\nRk/xNDFzJsME/Pjtv7Q+qFfvpYHlsLBW3vrlkKglLjjG3HAnpkU8HfUwISFQ\nw6zHZIHr3Fxo2pD1htmA+mwrf3C+y9YIHYnj5BY9cTskFWfv4QTjvEuPQywG\ntN/qth4NFvdEcnV6n4Z6yOIlC0Qo88iG4lcZ4qaUsJGu8EiKbw5/OgUTizri\nie665kA2QTTnOk6l63u5C8fMCxzeGOWuGn8GnGly+itormp48bsQkQPdabdh\nx08SAUJ5D8JUs364LRSr7LKQkxVSWRXKSd6PHwFOBvzZh18Da4i69ZC2t6v0\n6vy64WTNyGT8b3VcYiPttiO1nVIHuHnA956jolZCYQh1ctoskJOEEk4tJk5Z\nbz8MmZc4q2qqW2mtgLwenNqycJ0m2RjJ47zmoUUlpZ8oFN97xLajMTObutKG\nZvwuQS7Saf11+j2iVe7VJPRPHSKyfgebkaDAacqo1nO5NfMPoHDMWcFcWOfK\n4KVtXUWP3eYgKe1zrcNbTNLEvEtT+WeTUIyY+aXr2nnySRS1s/3dHRr0DB0y\n7+Xw9VVjUDtDD+93NZ0V1nXkEx9KH/nMql1m3NgEXvrxqTIBVkp8GVs6tobq\n3tBQ8IDXTbZoP4GH16ky/pbctoTO4+Ac4DVX7KsfDa0hWEc5REHRujm6wawu\nwZar\r\n=BqM1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b82451936613d9bfc0b42f52f859e1aef871c6f3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-b82451-kjtx7n3b_1610451476436_0.8716928927153857","host":"s3://npm-registry-packages"}},"2.2.0-feature-a4d644-kjty8dur":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-a4d644-kjty8dur","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-a4d644-kjty8dur","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7dcf510ae80764f54d838aee0e878c84fb752dc8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-a4d644-kjty8dur.tgz","fileCount":618,"integrity":"sha512-vx21y5Hh1dZUFT1Ia5Jlip1gglzPGH3wL5AUomIbW0LrrzhW26R9RJ91slIOPwnKU1BlyhZvYzTzo4R2KeRTpQ==","signatures":[{"sig":"MEUCIQCLuVZpT27IyUzbDRDP6vLFXSy0ESxI9foaOycAifgOwAIgbZUmNdZFGT/B1OWQMH/HO8SnMAT7iOD+myezZIG+VP4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":692927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ZDFCRA9TVsSAnZWagAAM58QAIe2tMTwGCiyoBOLTOKW\nGRan7XuowFstNqfRti95WWaWjpBMum3biRj5cAorqcrUQvIsL+QNXe1NMnSU\n82gdXv81TM5PsKEvOXNv6gURoAtTG7nUjaxIwtIud9OJclDvZg9qaT9zgWVu\ndaIp7Zg9tiFN20ZWCH+O9+HF6nuXb5zTq6zrclIE08Qs9MNVAV5eUW3tTEkf\nTcT6P+GuM+3HQlLspUriewF3E7EFmoYvYF6xLtd4YDjrRN/lUCP/ZXQ5WQop\n3iDcLu9anZ3fVwb76prOI7vPiEZGHRJeni1XKYi+edT/YGPTMU6t9ig5L0lv\nMtn0rJyIZa4oEfzK3WtTdbuvUE6q4A4XtpHGFSX+m1Ua4/ivFEXy8YPthQ9H\nqBviP+Yzlp72p8dEr+2+5hsOokRRlnXGx4uuxQ4ftDjjP+aZhoWkPi2YPOmv\n+100kzvBgXoqqFI9q7ysbXAxpRqppuTdze043e5ILB0hjAbn37ArOrRpdA82\n1pZm/PL/qetck50x+Q+4hKiZMbMaQQMZqm369CGJWNU2fOiiwqIeH1hfBrTb\nwBAz2yXuU4Yby4LFHKDeMMMq3LnYGGPPDoQoqb0HMlqoX3+qbxrakyDLGI43\nzkjvBLPabJp5QgXfpNyAbUsYjHT/pT93R6kiG561p55nR1oUbPksJY0mq+BF\nthQ5\r\n=cNwd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a4d6440c7935353a2b49768ec4b2aeaedb296acb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-a4d644-kjty8dur_1610453188731_0.921636970652234","host":"s3://npm-registry-packages"}},"2.2.0-feature-097eda-kjtyde5x":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-097eda-kjtyde5x","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-097eda-kjtyde5x","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"66757fff5188af39ea7bc86d2d259c88e0555e1a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-097eda-kjtyde5x.tgz","fileCount":618,"integrity":"sha512-K5yT5VMCporZlXHRqmyaDRLHslt3bP/+rblp1khZNhiOZ7sz3cStXJz9PcMvbASmbMgZHwF/CDQBrvu7FYfAlQ==","signatures":[{"sig":"MEUCIE2fc3mzdhvrYIijr4veoh/lMIX1rhdhduFCSmBdJIuPAiEA4mWF2JHkeCmxZE/ndtdQtUrQyXMxySxxVps15GaOMmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":692927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ZGvCRA9TVsSAnZWagAAspoP/A9bBAaD2j5DIphWCpPS\ndGgANRio1pWDSMzPks0nwMAVoNRMBPiMtngldBGcRqNpy+PJqRsNbaEkFNey\nbj3uB0srkPN8yNNmH8lYETaHhXG2wZdZ/Xafw12Kdl9Tjtrf6LD4PbdLJdf2\niNRT8kUd84/Smxz4QbZz6I3lTmWBqGcUN1OtSoAmijptBJB6dBGqY0E9ZdGI\ns38pMjbh0rnw+L5FHFjpXYXlfZXB5Eb7nSQ0K6OIeVqTcpiJ4FTInuXYlyqE\naYw2nNpr+eGc0Y8gulCSiguz+WJzHKunpIOqlp44AAlqHLBY5Cx0kSsrPzAq\nVPP7x3frZYsXTIfnIlFm4S8m6u7f+np/74QZmtiDt94xfhBWdmaIXb322xi0\n0IiTYky45f0G4+GsFtOzhCVpNCU0VAqvQQ8dD5xuBbcyyyhji2SdTmtab0/u\nMeRPhoHPXRB+yENFpd4E8KOSS5GUG888iLrbZBaDfkB6S1hf8ZPZmFk28pmv\nM/3a4hy6JoI0yHw5SDiItolDTioXQFbPnAKvMtjJ3KZ6RQ+NrBt1XUAL0mfq\nrade0XrtypvAG5oreMH7a2nqkI8w/t8m/dSHnw7DWxVC0wL1Es2CCwGHOYpl\n59xmHL2MNg6+xyDEkUjmeuN96Cvw/mIYn/sn/LREwsLd2ileqW0nMh9THyea\nP2cC\r\n=bhpd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"097eda944504780ec9768e80b0509f89058167b6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-097eda-kjtyde5x_1610453423063_0.23317277195867492","host":"s3://npm-registry-packages"}},"2.2.0-feature-a678f3-kju2wsk7":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-a678f3-kju2wsk7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-a678f3-kju2wsk7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cb4dd918fc5e38b0f9f445662d55b23daaa90414","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-a678f3-kju2wsk7.tgz","fileCount":618,"integrity":"sha512-YwS8UBBehFiE7pf9aZ99if4EPsBqIejx4B8j9sD7NdKKpjltcr66+F+8QiRXbhnktlYqM5OEsepN1olompELPQ==","signatures":[{"sig":"MEUCIQCWTHoo17K5yu9Vf+lH37ExZpb4jN4QtDk1aEQieYV53QIgVHcXwkET/Zt9F7xOvj1ZT6X7Eriysm5Lcg66aQEAVBw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/a94CRA9TVsSAnZWagAAU+MP/11WL3lOZG7z1JLVA+rS\nIHvI4pPM4w1r9K6+Uxg8/7SYgprAKc9uKvJ1EHCVLVuLz+4X7JYa8mNK1YYC\nBqeU8KTKDX6AgUKruK/FM9/+9E57ikuMAIDIcTL7tieqwDMYqYo3xlvz7Vbh\n27/mkXTC81rLIM10iUEqYhLY9xXpLJfHpdcnbOKI7vmfg9+MelPn8MVx9cXM\n/WbX43MI8pMODdv48caY5a/ys79UQbWtP9/X+0PAl/PzvNxed3Zpwll9On5/\nKLzhRYbYs8COWrQeF0lAjDIkifUh5NTq173OQJWXlBZdMfM8j+AgG80NV5Tw\n7o8mSm9nnqsrQON65rbfMPDfWeHs+QFhK4lmk7q7IC6/m9ai6JDFRkSKUYHo\nV2YqLgwTKr2rxfyesiB/zJb78sQQSXqQki4uJhcTM0Zt1IR6wvXmnG7YaU4C\nvf0+HD6iewnh8TN6MtQgDobeEeuanufLK3oTSHNRtcsexf5o0daxsKUps0Ye\nMB+RWvxkzQJe9vpTB5pqJuef/j50dbLKhzOYBSoXWPyEjHh0BeHSinYMVQI5\npmBQaVfVAEua0elrM8RHHvdQep8vlCtbkvtOudvalPM7S0ChlFicHPWKRLjP\ndS5jO5oDKqbc4DpIlShimWMlWaTRBe8Z2l2t+chyLyOOhY+NK51O2ZhuAxzq\nRhJr\r\n=PW4z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a678f379c7e38563d1aa8598aeebfc995d03f2ba","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-a678f3-kju2wsk7_1610461047363_0.008015159337856792","host":"s3://npm-registry-packages"}},"2.2.0-feature-152dea-kju60mbe":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-152dea-kju60mbe","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-152dea-kju60mbe","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0cc6e8a5985e6a2eaf30142b94421f76e980b8b1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-152dea-kju60mbe.tgz","fileCount":618,"integrity":"sha512-A9dAUf89yoTPU9o05XLSXqgVgyat/KBwh+HhPnPXOGBPkL9XHhNrxju0v6TyIo+xvvtXfBgC4B76lObQigig/g==","signatures":[{"sig":"MEUCIQCwQSn6uQPGT+vNXgi0DsO5xV9srgXSTQYMhfAF2AoJuQIgNhpQgc8188jOhfGasB4h82zJsGoqkzKcjM510FLbxSc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/cPUCRA9TVsSAnZWagAATcwP/i+CGEvLvfcXa3hll9/3\nMV/jhz/4XXdQtRfy94TYjnKUdTz2KD1i+v1v5XuOb3qnVX9h5eDsPzbbULux\n89iiFzE9NU+qTWZvvKRivN0jVmGwj0SQS4wBDQUGloP8ED2dWQB+U/SIyHP1\nxeZgWnlP4584jDCQ29Jyafk2KzZh3qIoG6I1An85BpZD2U9/GNYpdgqTBiRZ\nuaTYZr1yCJc0eSIu34UEFpe1SmS4Z7vA4MOndyWwmS8jlOe09WSCsG9AyKuQ\n1mcaaCe03ZP1Y9o6Pw7h4zv8RhFohgq6Q8EhxtKB3BysDihQyCUyM1ettGM4\nv3zQoBX+h/g5ei7oHuidCHBcmU2bf/EDZw7vBMCFmY3/yRZnQt9IvEKoBI4p\nHBMaPnpEx9wSgrebyG/iFNt1JVHTj/L6tgwqf21F6m4KOUXZjXkruHR+uEct\nyVVRSoyVIhwNZQCRAg/DAKy/IWeMnvjInbmnKB6HaPrs9zKNt5chJev/jaOc\n9Gm9/oFUay96f2/aq02MnVAgqzmJJl/r4Rz84iRMYfgCmuGp011GQkvbAhsG\njMPi1j64u77lJcsMKNRlPAeEthaHPbyYbYBfcd9zKQrJrsw0V6YRtosTdnXD\njW9WkqrUn4ld8YZYdO71+audDe1cLVWHWvIMQSlFyNb5pFAE99Bp+OFlMKD6\nqzem\r\n=nHvj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"152dea2d0ab719891d92720656dd069bf2ff56cb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-152dea-kju60mbe_1610466259617_0.6614640128530938","host":"s3://npm-registry-packages"}},"2.2.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b2de9f65881f3a78c582e28111c7ff748281f3e1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.1.tgz","fileCount":618,"integrity":"sha512-LZa/CP4nWnKHGUp0fLtkyTM0LjiDKK/fNKchzV0vQ1V4T0mljBLm8T/DTUofSIsEUxo8TP8NiWRcwilg6uc7tw==","signatures":[{"sig":"MEUCIQCRVohh3cHprZGmhmqvw772evf36CIbM4qdaQdrW/TZvAIgTKUWKGUeeGUqzpR0ZFqeoOJPP/zcuGnICzVfehgmGnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/q/6CRA9TVsSAnZWagAAAfEP/23kXLCpx3ieMZqAEdgD\nY5b/dXOmZtrM76eS7CPebIxsT465WqO3UYznkNndoKJVU5yIxFQTngk07C67\nYxE7X5JIbLbiLWOgqjsBIWzKu3S8wSLqeyhwavQUsN4Uhsk74um1Q2NSvU0S\nw6D0ibvj4VcBOvzFpr1AZvoRiMSABfeMMJbOTTiUnD956vHTNhCnyGSBybH5\nulDe68e04L0pfmWKfd0beHKagfPykyZhSQEHot2hgHZBG8rQa0wBFMV+i1oC\nvwDXl4LnRfxw/kxW+rRxjJK/rcATaqhnNkjWjW8YjnYfoTulW7bX4jzw17B7\nXLuWk5YR8GmI3cu5Z2I6ZLx2+l18ev/TMyTYSi98kBXjnSt3briW+Ztav53t\n3R2a1H/gC/T3yt4+yM+s+b2aDuDX1+6SBt2+ZpnM2CXMlVvmvQPtPdReUo+u\nKY9JD+iRlwoYPl2Ymel4Q5r45s/SKDuj9eydL2TnMcwfWtA98rnHqNS/1rto\n5+UWZd4fl3sM5GP9lLlePTR//V90IHcneuf6BLEsWxiA2A0ri5xbRRTu4GM/\nywo59nKJMEfmPznCSwlV9s3W7i0FLuS0Kxab3nhdbJKSJchaB8pfBNQ1ctSE\napFeCyPqGiP7bbor7uNpKr+reENGvYCG9+Tzlu/UfZmRAuGoT3LFzC5ioyCN\nCJZj\r\n=M/Tu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"37c8165909dcfe89d5a1b6215bc2e75ff1b77db5","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.1_1610526713871_0.5651376076150814","host":"s3://npm-registry-packages"}},"2.2.0-feature-e5a547-kjv9oqym":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-e5a547-kjv9oqym","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-e5a547-kjv9oqym","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c1614f536ca79eeace905351e31c2fecd6184bf7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-e5a547-kjv9oqym.tgz","fileCount":618,"integrity":"sha512-pyuZD9NpYMdkKI/CERHTRy/UUn6qAz2vhLYH1AglNXgvo/DiUJlQoVngn8z7xXu9z6Fnm4NSwPvAP+HOUwkU6w==","signatures":[{"sig":"MEUCIEZQ1OGpHfJ0lhMbt57szeU7wZTprxS865ImIC4q95vMAiEA6Hj+7/mcgvUl+nN77oNR4WJ5OY5nFOELS23pj3PYp6Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/sgfCRA9TVsSAnZWagAAiCkP/isFriEKEryAQzP4ga/Q\nD92veErZYAO6kQmAMNyXwoY6QxC85sdkUn3NZVJ2O6Mcyk0DpVsBlEAwewq9\nFebRS5PO5btL8FfoVuUucVJfxHCpjHnTcd0izhPkkoUZ7aebxNqMYnThEZvm\npKFGMqYP4fE5+Lme78onFozpOyiHOwuikdxyBMJK58zdwqDBinjQ6hRBjg/O\n+UsPnh/rx64cHJD0CrtLwKiD3TPLMds7N0eHavuAzUpPA3wMDdO6Jeg6QoSd\nsToNLoWvErR2jkDh/6qDayOUnRaEbguMoRU6PQfdtedIw+BjETVXkyvqGbW7\nfhP6vR78Jm+lsfbmnDh2nZp/kQYFoMEWCMpMuyGIsyQuVuusJZh9LPXG+/sO\nf5BpqgkUDdcsrlmxlIL6+WcAn41L1oQ3+q59D9pYW6qptopzFnhFFP6doBYs\nVABZ5YR1/zO1656bozIp9GqbL01U6iCGlGY45OidZbB2mFuAeC3S6fN5U9Vh\nPUC2dItz/f7WihorVcLLK8CCAavetgs9Jl20AKqBLC8JZ/RE4p6Mz3y+zP1H\nVZ2OK+Jz+Wqs2GYzGV9eZxTgYIyUggv17wqXzanHobIqUjwGm9gNJRxYc5A0\n4/Ej77MBRRvJT0dA/CW2z+l32hbIw9nDD4akUkkYuJ+k23Td38zOU2pEoaXz\nQk6v\r\n=OYv6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e5a547bd56dc4fbb9ff49269c350e89237ee5173","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-e5a547-kjv9oqym_1610532894589_0.2177958693735884","host":"s3://npm-registry-packages"}},"2.2.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3d90a98584de42288b37fa89c728e2c2692dac38","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.2.tgz","fileCount":618,"integrity":"sha512-eaVY1/ihemEbMyaM3A/mIw4HjcDD46dWcp41xzaRQ7Og+Ow3QhPb0x2yx7PUBsJMLwH5c4efKJi6TCOyh45AYA==","signatures":[{"sig":"MEYCIQD6sDbc/f+jbtWbggA/YFvrPpJ3WiBqBjcByv1uAEjhhwIhAIJxtJoNu9UH3nQhOzXOwXRtg8seCffzAWIz5jrmT0fR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/uHVCRA9TVsSAnZWagAA1oYP/3ihxUug+X+fXigvBDpM\n6xyvbjKIw6RtjPHx80JVCF9TmHP/rNYOLpY2aYBAbB+i1UAKHmlRtp7KabcI\nvvMcVU3v3WQ/7DYPrt+HlX2jJ3T2kqNyuV035ySZsa/d4eDk7yyw/XXPncf2\naIvjOuweHB1FxxjxOMzPV2Px39jndMPgbGitU6M6V8uQrivYu4URovlUMDB8\nIx/ELnjmsY9Pwv7IMWg+KZuV/qmXK0IQbc5ca/q8zLjddMSRYkmqmxUjIbJ3\n5MaWW5tBStC6eumXElDRzyRzNr9XGl3Tbup2V/FjlOSYVlz63JyadFIjErDd\nFKLJbx9JPc8wLicbAGAr3WBrVOA/7TTRT8OtY9Ic3NXKpjLGlqfMa336kTxA\nDaiZs67CDbqmXD36fdhCwWq/t9UWX4foE131q9FH8Mn7RnEeHaAswvI+qP6Q\nbPkt3TVgp6Fh5kJQPcQ4KuyfbkuFKVy2vriVHS9AnvJUuLmKNLNY7lRVIt1K\nB7+n4HhjMgNJwT8of/gozhWCxOyx0NlldU30ybcj1lxcPpFcZ37kI5zu6ZwP\nkbnkmqJtZohBd/RPucGpQxRXUFHcjDWTXjFY4T0g36nXT+LKF1e84YON6emG\nCDuwUD9pxtV4R9feeTVbC1yCh78ncdhXP2IjM43a9LUn0CVkDaTYUGo8zmyb\ne8fV\r\n=kp3s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1eaafaa05ad62993c8ddee0e5d7484f43f73d600","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"^1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.2_1610539477133_0.3231103618678455","host":"s3://npm-registry-packages"}},"2.1.0-hotfix-295f60-kjvhyiaa":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-hotfix-295f60-kjvhyiaa","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-hotfix-295f60-kjvhyiaa","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"41c3c88fc94c8d93fef85eefaf8ae3c3a243d09f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-hotfix-295f60-kjvhyiaa.tgz","fileCount":618,"integrity":"sha512-X+TlaWowvrFtC52lmxiIEYW0BrdPGhudkMbAjyVoLPWw1pdBQk9ttq89+qyZi51peCxm5ogwyPhZq0YIy3kAxg==","signatures":[{"sig":"MEQCIHbpGV6e2z+kRdiMCvQ2zCtMOkoJQc78SSvJ0JdrzB65AiArt2YM9sgYd0bKKen869goHfFyjWXFgE6+RdcdenCx7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/v5nCRA9TVsSAnZWagAAozYP/jEV682vwPLchjNvgTPN\nzgeVJ5hBSFLnwQJgkiqU3rC8y34H5twv329kMjMNuk4ro6I0qxyzsqlzk9Wz\nBHFjsYAPRYkm6ArMSh/pK9Ta1KpsFGFNaRx+5dhkPVL8i7nVBBnZEGfA3ZdX\nmaW7I9UJ8Ky2SRg6UIFbLOX0rnzvFNmEz86JcdO0/u1OeHaKI6vMEjhh4zxf\nb3f0cIH/b7TFtEtFYCKANbfk7mNKTgP1DhDYsdOwonDXsO8SWgFMZrv8xkXt\niyHuRIKThsE1Cd1OnMNH58rx4U+QVk2+diYDEt9Zu7TmRHqaTlxJErWz+BgA\nIBvyNL4R+4HW7KVa+OQS2x+DpJHHx4T9yK92KO9ohyihetmn5G386rslkuiJ\njFuXJjY3AdqVQ3gTovz1BT4tAZFLuCxuaFNPOEcCOxmS3d2TMSPUUUn309jh\nehzNUoVhTvzd16ofb5Yf7IgmOLOmbANrY0da/PWCRKqRGKW33dMjPNwEaDr5\npSBCATMxd1zAAOFqtRbPaZ6OtT1pJpaMjexyRZU+BO75O+SOxG+nexD5pgko\nnc2t+GmpcBrioUB17kw9u3I+bOGrQThFVDx8bYWcs6pqc4lr8JiJKz0/NJ6m\nNspOVzkaOsK/cE7VTfg0kVfvQB/2cmmLv96M9ajvNDv2qVSrdIYJNR/vI83h\nAj4k\r\n=ujIf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"295f604187c2be7be2e1f510f586c46646abc936","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"hotfix~reject_unauthorized_cert_switch","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-hotfix-295f60-kjvhyiaa_1610546790543_0.1498004645750326","host":"s3://npm-registry-packages"}},"2.1.0-hotfix-e9b7ba-kjvlsqtm":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.0-hotfix-e9b7ba-kjvlsqtm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.0-hotfix-e9b7ba-kjvlsqtm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f7e41879fdc14cb67cc6148d50301a6bcaeb2d72","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.0-hotfix-e9b7ba-kjvlsqtm.tgz","fileCount":618,"integrity":"sha512-4Iv93vedJ14yJ8FR1YswY9valrinwWG72jpyDwxLiiceJ37CO4idRbD6TSz8IbBDJR+aWcWj/fTpUNe5jceysw==","signatures":[{"sig":"MEYCIQDAkhU8D7vrjL1yFxI8N9jDv+iMKmHsd83D0FpjJbuzuAIhAJIZFoEzTLMzwna6X0jV0TsGXJCHbnmjbIeC9ZnPGG0x","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/xeVCRA9TVsSAnZWagAAYrMP/1PEPs2mdW8URyY/+21u\nbruPYNZ4kfU+4gtixYHnUEUFS4uSgqHjrw8MNjUMgU0a0zjG/r5ADshNdpwy\nNRugRM2Tb5VpL+4yeLNCYhq34unQ/KjnZcrELecRE1a83tWOFUskIZY7coYP\nJ0B1Yv9ZMZB3Hbd2i86bBNIJMojfLqM8WRJDoGtOuUvNIgWOxxbTKXGCA48M\nvu/wzDtf9QB10X9EbrFyG0MK36w4eSqVkozC5AaWDj50tLu0Qi8tAVeERFxe\nCiJD8YtEHT0p9EAPGqVH436jucMuD9RlAlOE+KpjOQkhMX8qGvyEwZEg31SD\nrGIZBBFq781cY59NOBbGyr6jaEuFMVLqtHKJjNm9Be1YDoxpjO5daH+FFJxe\nNiOIPvMbWCkCwms+KmxRR9f+wNgl/YSyfQaGipsbQ8tqd1pXzwcn1YpzxbWJ\n7NyezElRiDowUxI4dwd2VdQZF9Nnl8aeszHcfdMC8bJcUJ0Qp9fWVNrb+PN5\nn5gbFN18+oxq8t6o3k4AbfOCUe7YGh2WS0prwukPvo2WzCN0785okhrhk9x+\nBCCUF/wDaoptYYnQz1YUdI/r6dBSPAxMvc+6F5ra9BC4qJyUJdhkVfBEbZcv\n6Dt+kBXT0MyZacOULpgjt1gvcHB1FRFs5ujZJuBco/Kx9nL86BE+f8/K0G+8\nJAIz\r\n=oI2B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e9b7ba25d87fd576408c3c7487f98fef42c14a0b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"hotfix~reject_unauthorized_cert_switch","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.0-hotfix-e9b7ba-kjvlsqtm_1610553237070_0.016811653750835376","host":"s3://npm-registry-packages"}},"2.1.1-hotfix-d87b50-kjvqelab":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.1-hotfix-d87b50-kjvqelab","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.1-hotfix-d87b50-kjvqelab","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fca9091cc640e086d9ba77bfeb0292affed63a83","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.1-hotfix-d87b50-kjvqelab.tgz","fileCount":618,"integrity":"sha512-CO2XowDbd67/VIJ6osqZPpYlHpi67lw2BXFzNNWDAwNg+Ppze/7CeuGDl9EX7hnRoLDur7ySTzg3Nu8c4EFRsA==","signatures":[{"sig":"MEUCIQCp5U5rOU1SQKLULRumTKJK3++VzdZYkShCP72qbTuZKQIgEcvs1bxZui57dm/VfT8AzQuAjmmPFmOGhTOMimAmGIA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/zXNCRA9TVsSAnZWagAAu8kQAJh5yq6BQ2KlC5xvBaKO\n0IcG9vD7p6KsaBlw16gmkfa6fQlmb0KHWtyfaOATfOYQkPBNuNZErykLDL3g\nkG2auzY7RAlF70W+1Syq3oHVM82zuXgxpt28uhdHi4bQZ4v7E4EVlXxSCQtL\nTGaO7hKn+kG8VpuVfATcW5L8YXXIpGPAR2jdvHiugGkro5wtXTEdGNEofqJp\ng3ZiDftcPfcrVG3IfXbvMihy6b1+KwtphkXh6CvX0TloqFP3u0/Et1UOe0jq\nqLoUue8yw2952Nkt4iZukoDYNJwpxfV1s8nTceIp2bpdMltAPtDy4gF0G2lp\nIgbaliV54L4F/D0zQ83xia0oR2pbGLF6y8bxXIRj88HxCo2mX8XDTir8WrWb\nuW3Yz+EkC75pcJbxyQxmunok32CemHUS4KeM91IPLwOgScu4f3DeChXxvdz0\nk5sflxjg3ohvjSU+q7l9cBYOZKw0FDsMBAwDLBcl19KQoXTiFvnFG+j6bdgm\nJuyALheoqSJ7y5QFOw55NZAKJYnPji1BPJbe+IdIWHwX6I4kVIH6O57a3aSi\n8He3lXkOtfGUzZ7PJdGQNz5ffNBXcmyklL3DnclszV/aadn6E0tGLzrQEV81\nAw2EGZK9bdQxDrOGR85BbfAI/alPGJeqfZu7suhSZ9vZf4RWOWsIIvGfkjyN\nAUK3\r\n=TRgA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d87b5093cccf7594d5a91d7182fec49ce6cb85a0","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.1-hotfix-d87b50-kjvqelab_1610560972526_0.44534603320583344","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df4152b26f659c4b11e4dd8c5c74404572213aba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.1.tgz","fileCount":618,"integrity":"sha512-kXfLh4XMmV7MjEt7OA2VtXe6TwSdqAy+Q52LhgSPIXiJ4zZP+3iPDKkRuCNejKPe+nP32MHgn9/6YQYfByrTjg==","signatures":[{"sig":"MEYCIQCnHf6Nm3ULTv2aHWfT5bUrmoGL4KBUpNUwT4nxZy6xgQIhAJpyl4EQjoxpbj4Cf1cS3oUJL2T3WzW260JIit0pgoAj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/zbhCRA9TVsSAnZWagAAAmYP/j3/dEEohSQHzEfF9iTT\nE3VZEkwsBYb7gJqM/X0JOEU4Lfh/p+8qf9czVHdjco2ENwj9SFw/sZqnUi8p\nal3UmPfykzEUYLahmNH9IHzR5vj/zAt8OUCMX2lJmmvwQ8NR4sorKPlXEgLu\n4E1uebH9x+b9hd6arQomtjSq5eiau5MPP7Gog+TNUnrJLEIOUQdU3LmD8DkA\n5+Zdo2kHgUEswHs0yIxXqeyOxFmtePOD/nO4Uj9zVK5hrilGiFzfAtw/nNqR\n+SOycvxpStaQmBxeBK8KJF1sCrZyQ00PfP1kp4Ik1cF/v/UQ4wkIvOm1GhnS\ne0zVD5Xu4On4xltKugX5Cyq4MiEhu0SQxs1SC0g915ZF1C9ncQ2w7P00lo6m\nHQfKXjbHp2lkw9dIkrbdGbUKA2OwFkntSuC50WHeGhzkr4WrnZgFEESzWDYj\ntlLcqrBXeCYWFOcED73yeOtEHzH/fe+SWun/H7qp6QI1ZhtYVvuBf3OZN3D8\nuDb9dX/EyHRnRFA2TELDfX3HH+OZt+naGsbXnpaGbk8vgjC3pFsX5VoWZN76\n463y6/kl5qJJW5zfkD0fO8u9/tkPuIPEABRgsbmXY4ZeLsy6wKqJTxoLcwwK\nmWIeMX1WrW7NSZhey9tHaXOHFNxNKUI2tfo7k5EutkfBSCsHKdWIxaQXJttR\n9oBD\r\n=soGt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"4a511612d85d725a32b957a7843430f1ba71d18a","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.1_1610561249278_0.3963429017642608","host":"s3://npm-registry-packages"}},"2.1.1-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.1.1-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.1.1-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2876556ca680fb4197633be43523486c5777297e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.1.1-beta.1.tgz","fileCount":618,"integrity":"sha512-726AZ1hGq3s61ESUAPiGb6yB1YMyu3Ivk1hvdhY+rhjMQ2vzvyRgaGZJ9liRk7ljhjtqa3BU+qFprdkwFmRIzQ==","signatures":[{"sig":"MEYCIQDSBGx5svgIz38tM5vgrbUfWXSf22LBiuGvCZyUutZszgIhALX4f5lqCHbbPHXSi67jM0MnkYxossCFsZO2G/d678Pd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":689704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/zdACRA9TVsSAnZWagAAAkQP/j/10fSUIXDYDVonljo5\nBHmQx6jdtZG4CzbBkRk9jlRC6QsgeUuvZQXFGA1Aka00KQsygMohpO34uK8X\n1C/f4EI3yudbYNIF9xwbF2NVkN9bIRiiRmgBPa1kvxyFItINumXk95gZgZb5\npPrP4OfmFrBbhrG07YRYaLxCCHLxEz8rAkFAvaDLzGZ8yIzr7rjNP/013iA2\nCZv0D9Ycub+g0uAi9Rf4uXC7gRfj02T+aPQfJ5JwrdFGMAU3cfFoNXnujEHv\nrS7oNSj5i6Px9ZpXYmgkDlS4/E4uzUIS36U84cebgg2EtWJRil6WdmdNG1O1\nmzmps68k4FnHCwFMSN9vyscuZSJNIHfK8q1kDyW4+3Qfmv6zHs7r027K9ZLH\nUn0grs8MlOuhhRLZUUXhOblbaZsX2p25c5TKSysM19vFJ2BEVn6zcejob5+i\n4drZ9KGGEzk9HdyUSZBhlSOLuxWGWOG7IWzHfYbGGKUNdIbBlTJtT5JEi/+e\n3CZ9zcMQy6qLDMXU7tGH92tmTccDrVCdn6KPGAZ9qREbNidAQgIKku3cnf9u\nASLxVT12Cq8DdMsTLuIYu0+vC1cYjI/1Tm2TE5ePxZrELusUMT4z6sdrVQTR\nkzGdg0sGJOY+d6ETOzmNLrCpUkxIfuueWPc9K91Qx8pvC1a7M2NAlyTsjXoF\nC4Zd\r\n=u3Z2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"226838fde879d876d8ea3ec46fdeb11bfe160bfd","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.1.1-beta.1_1610561343464_0.41856048616438324","host":"s3://npm-registry-packages"}},"2.2.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"853f85f648c17535a75da949994f732cc6a9d55b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.3.tgz","fileCount":618,"integrity":"sha512-itzDPrUYuoTVJMOpmiFmQ5H7Y2gJFUPZqMJKcYHNi9t1FDv7mQaqaYt2Zk0tIOeILexGfpExbPIAhXHSMnVhzg==","signatures":[{"sig":"MEQCIFTyVld1coODXRaU6Q7/YVr1LzJ98Vhyul9ZHUMxzVgrAiB4s/K/Ge9ffwCkn3ynow+ExsDIvtFmxfZkmI64fphQZA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ze4CRA9TVsSAnZWagAAWVgP/1us+Qzu8QrUp/bAWudK\nADcjsl5UEF6mxxxnt1UXxkmYvl7h5INzvhAXcgJNsM1AhVWx1bIadNXIASft\np4unPccc8U8uOx9J+9xz5lmSSb3YXyQK5DN8hg2381Q2lS4GEfNoLdJXcsec\nBVKnh9Imx522KI9OveziZaIXSVHwiLpOSZGH/QZFjNpdXqUJx6vhJD1n3GBe\nZSPWhSqdWDg5Km/x1nke6ZTPVPas7bX0gSeGTcot4nbzFcIxqr1jttCoKEAU\nYstvdcVqawK8CpSaIWA49R0z77MisYG7API8mAl61n7pu0mg5EF4wDFDWJqk\nwrYiVlsDJNxAYEYFk8uU2W9n1Xffk5RsVdoBBcYcSpYSPbSVzJlZH9fh1iZn\nZCw/nevDFguLFWGDUPq8I8l4inXWuUekflkkouE0cZ3UObyfxNxyuMeMxRRC\nePCyGSHgAchwwQUlqBjWKnggThhMxRd6JLa2xPG7uItyb8rILaqSwystC0B+\npFazx4yj4gwZrY/u4Ko0I4ZA2LVr6PhKPYKuhnkAooqqFud9702pw+Vva2Ha\nPg2bMGCPfduFKeElZ404ey4acd1GI/O74WRGmFjzcVQ6erg4H/y+h4dP4RxP\n5cFKbHvAoqE6ZgtLb21KjJYz9Nj7pli7io5J45UY/NnaTAJk7fDs0mDDoF/t\nMc9O\r\n=Ecln\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fcf264baaf30d6c6d996c23e424c7828b23fcc2b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.3_1610561464033_0.404539940321323","host":"s3://npm-registry-packages"}},"2.2.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"98187efceae30b88d11491a963bb990349e91c98","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-beta.1.tgz","fileCount":618,"integrity":"sha512-qU400Y7ic52JcpP5bNczVLF0Jtc305QNRvRp1rHyUAVBG+aJ+z+ZYLkR+UfuOINoJ3gycjc47ZMHyDZpyCkX+g==","signatures":[{"sig":"MEQCIEENFvvdVUUy1nzFJwiwbrUyYClFuk09m2/e+6VkHSuIAiAZYamWIjBd3dbC39GQP6ohUy4FLicSJIj1irm74iRUqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgACMNCRA9TVsSAnZWagAA9ccQAJbtYE3NNxnOh+LTck8b\n9AUTOVKHmgdGhNz/c1V4bWzoih1TYmHqerj0j5nLU4NZeE7aBa4elv1WB8pb\n2ggztiahc28tnjVuxhybjBi5QPFHR/GvDbNLGp8WqvXfCqvfeY91v00+SKwL\ngeWB9JRHbhjsZ8GJNUJhuyEXCtW2vujzxHo2lJNqx6mF8L/nGD8W2tjFfkM8\nbQTQtUj+WzMtb/oHnxzaoyLFaYI6bEtbKLpMDvSeKk9GWvIDmffeTNl6znsN\nHtAXyVW0iIhCh9Us/mn9a3AXyYqs0Xmj731f+C/uowYpUApciAsgPOJQ5Iqt\ne1/k9+f0/osSk8ix0cw5ZZo9drsHF/l3ncSEFipv92va8uogXRY+/4icQGuD\nG7LS5ffKMQXArr2jFq6XlZ13BsGuht0nmzt3oN+rkd/ZcCfCw5Ptc+mO4xQF\nhatdvfboTemWUlBWgg2dpjZRgGhGxcwaKYZNcgOmLFGJ60VA/D2/Pv1d8wee\npK4ZnlvsRn6dfeHBuNQyMPLXW82TE65KR4OHWKd81Cn2XK4lXhGf8w6p8I6s\nvG+1PJN7fP10vmUN8ssilq4nAl5L3tw2xC66exve+1j5l5lqyTJG2FcU6G1Y\nlRT2HB7kzhXh6obwjCa/ASKHcsWZhvwfgGKh6DJ1v+Q48YRvqcQr2+hq9728\nskUt\r\n=80Vb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"861b41702a4adc33c899538816ef37020f8fc017","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-beta.1_1610621708635_0.8515439940882177","host":"s3://npm-registry-packages"}},"2.2.0-feature-c25f24-kk78k453":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-c25f24-kk78k453","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-c25f24-kk78k453","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"40b72401428b76aafa3a3f351a27d356280c28f6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-c25f24-kk78k453.tgz","fileCount":618,"integrity":"sha512-3beZbKyoqKWoA7qJ621VvCImaXVjmYkQ73MO2bb6A/XZ8BYZHjv7QRHBx7t9i93eurCi8czMxszGVtDzC5EDsw==","signatures":[{"sig":"MEUCIQCLzP/WK/cSl3gqs09FGnBnAbDYrTYe8IcBfcB64nJmYgIgbpL79qA2RZOXM/N0aDbaIO/Lsxz/FujKf33i0XkdTh0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdMRCRA9TVsSAnZWagAAfMgP/3AMnchLMQrc9SRM4WE7\nAMdGBeWZ3Onb44C74itJzLLTHWm6tkHLowjCY+LOMbvAVncAe+eWkkb/+QCj\nQETef0dHoH5292fkL68ECHTeqjjf1O3P4YxNcsGyE0FSg/PFXOicXRH4ExUC\nwjBIMp1nsmCnvJhJI3uQbpnkFOWNF4t/HUI/Dg1hHR7Gq6YsQ4GlBZA+kQuM\n6Q8pJdBTt6B+A3cA89DMwy95aSmrKrFLy/38f5EkrFlqXj6lLW56+mbQ9ntQ\nUQ3mc8VcB2hO9PBUL++wgNlFCefooL7TUUtxW+q8OPrxZNIjI1B6R6q8rMug\ng0Cd8UHqOrnzUceli+mw6BruA4XARxvOS0LPl2sgZbogAuqRkLlL/TSBuKjh\nSNx0GZgLAZLTILUc33KfmY4+xtuxfWWIhHm+RvbNnxinPgtxqNq4VTIk4x6m\nfMxEJuodb2gYmbrGftKpsUsN4HV4SC70f2/ju6retwtNqcipVKSXBDuxQuwJ\n/ZetRntHZwqdKUMhMCV9tB6TA+vAfaBCG81Zfg0c9jqKBeOrpA3l71fpfZWZ\nHOJ140In/cvFbPX75oixga6BDlyu/UwLPoovezJxuncGdzNZt1DakaG9yKZW\nR9gbMZSqsPZb1c8QwtvlXzP1HIPRPHbMh1sWDO4h76aeP/1awTfYh9ZvI2ct\nSrLe\r\n=6uOw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c25f242e7d832a15591219997509b92f88f9cbb3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-c25f24-kk78k453_1611256592317_0.19808586886386337","host":"s3://npm-registry-packages"}},"2.2.0-feature-e04399-kk78rpu8":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-e04399-kk78rpu8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-e04399-kk78rpu8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"472260a84b9397786417025109d408ff04022832","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-e04399-kk78rpu8.tgz","fileCount":618,"integrity":"sha512-FF/eDVby8Ro6uBcaHjp4zlxQdnB44nfU2uccPEa5yqt0IlY4+ObTLiHywYrl8NSL5MoCsVRciiUH3ILDjbuCcQ==","signatures":[{"sig":"MEQCIE7ZWeSY4bDT2PWG8ySrh/c9kMD03IqhvhiJihod/KBUAiBP7cTUEjFOL1ZZ3KDBeLxVM6JL9U7JMN/SN7uY117TSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdRxCRA9TVsSAnZWagAAmtcP/0eSrBb2CgSrlIhEG/UC\nurJ3rA9LgFBoxe0hbGBHvdh1rSKE9fywbiJqrKPFpOzzPdQFGazljrlX/f1f\n4x25iKWl3NS827qzzvNblgqF+b+OxLFy/6+MT19Om/pZTAlG1Icm6ohq3Rca\nWO5Q1dFSEx2FpQGKB8QcfWM11H+YIUymtMQytRfEH6KsCDxPFhFXzp8rfXPu\n3h274f0MgL/3cJQIu9EdR0mcsHpqUEyJ+d91yDxC3I9Pt9zL5sVKb3QNSMy7\nZd6dt/Lln6Jpf+x/HkbBAYmC0PIbvOVix2ukJQYQgWrcuJL4r1rFUsG/Ct+K\nQjcGJjGNQXpGRbfDkosXyAuXMSG/XektmnEazkpxFbIW7Rc5ejYO5zLorGoZ\nClCEG+yGCZBKfb31EGWvVQ1dSBifzJg1KijcuTAojXWNDkDfP9nvFDE16eYf\nDImLtEXd6kK1seW5wPktWslMA+KarY7d0ZgkM+bHuGp3FHifscdAn95W6EEr\n54sTZnQ2i1Jfvu9U+KmATBVPPJ9vKnEVoKl25XcPvhRgO61zpG6Q+ouND0/6\nhoLPmSFj+u52Hi2ALMQUO5e+6YAAP/EdFZIX7VKsXtfIK39it4P63n/WqK7m\nw5rXpHPR525xwa3FqboS6qXxOF/Hj5P3Ow/mkAOCjpHLcADpe/z8dzLX3Kby\nwH0c\r\n=JTzG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e043995b9de32f26e2fc3d1478f79101f5aa6bec","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-e04399-kk78rpu8_1611256944507_0.5358631225591421","host":"s3://npm-registry-packages"}},"3.0.0-feature-504c05-kk797519":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-504c05-kk797519","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-504c05-kk797519","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2b887cae422974f6ce74a0aee1ce688d9cd579f1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-504c05-kk797519.tgz","fileCount":618,"integrity":"sha512-nueqlfEFX6RIbrPPiIgkwQ+2sOXWCEeCDubs71mLQinsDzJYCu4o3bO6SLRkw0Hi52jFhlSlBUuYTlTybTiDcA==","signatures":[{"sig":"MEUCIQCSVWTB1o8ryZ2HWydn43LaS4HWlzC5/fdiq7FhAMEgvgIgM7ZSetjWmTQ8pieNI/vjuL7Bsmpv6NVZ8+1dGed9waA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdc/CRA9TVsSAnZWagAAjhAQAJrK0gbl0++gHgU2gcjp\n2VD5nR4PFWXhgCP0WHHpJ7y+VoEXtE4OHbENJXHn1AO5phr+A4CUxqvZd/R5\nLzyxbQFEtzKawZkjg28c+rCp6XaEB8YakNGe7gJksRhys4dzzTtIAn9OzHHc\nCuft4RhrCA9iMcuSjrOQYzUK+i7yQTqs38g/FocKX8yGey0aU/IBmgUfMBnu\negU1Nt8gNCGZIuc3TVQijZ3WWj2N3Aij1SMr2WASZ7CgEZVXDvM5A5iEpeaw\nST/IYU6LYR3w9Qa9rLhQ/fRvd++2zkSEM3XQCPxjAzo6Y2udaeEUncPB4T9b\n5Wxv52EVrtjNo3Ao/57BB3qImp+CV6bEJgW0CG3Pa9SvaCVj8aR4fwtW9fwU\n40MP0JjKIE5iY9nZAx26YeEIhI5wgEDtAgJVzu11yHFTnsWLP/hiCkFk7Jmm\nFpnuam9V/Wgkm0ruZARoDnDrzZsI9/MrQhOoceIMUD9LrQRRxF6A2uuUJi3I\ns2lvbPrUr0q2A1+wXZ5dVubNGdQD0rXYPjgGruNnt4IoEhAg1ilXX6wWLv0a\nF1zjgnId454SGHw/HAR9oKtPs32OAgzsW76vl1jHLfjuffoGnftpgG8legv7\nuDNeEkt8Rdxn69GayE5hfzOtyAY2lzi7VmCVaMQIuWRBi6Mex4sBehNCGlnS\nnJec\r\n=of9Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"504c05185543d00822f03599e5f8b2bf7cc682f8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-504c05-kk797519_1611257662863_0.15475140591143588","host":"s3://npm-registry-packages"}},"2.2.0-feature-cdd56b-kk7abf23":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-cdd56b-kk7abf23","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-cdd56b-kk7abf23","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a80d30d9aa1857d8630c086149a20436e53ae250","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-cdd56b-kk7abf23.tgz","fileCount":618,"integrity":"sha512-4Q7L3RhiB4oCwjEX7fqhaZjv8G3e91w5zzjZT9KvE2ljdEK3iV8wzzkt3Do+8YxvMDNhlYuEAEdOjfk6RMNQag==","signatures":[{"sig":"MEQCIEn+s8zeRoNp1po+8flknWmGS/jtPWLu2ckbDEboCUhrAiA22lQ4c64+MyAV07bYqFFFNyWnJr2s7SaqBaJj48oxAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCd6XCRA9TVsSAnZWagAA/TMP/AnDi98OaLG6/xS+DBZ0\nYzdvQb4cWeixeEO1kLpIZ5qSFDWi0JVchNCEDWth68F2HkgtwQ4foEtZjmV0\nmH4GEHOUCl70ufIuCgvErL8cjgi9SSbtsVwwd/sfFpUy8pMjCR4HyxXQYTzb\nGfxMTuu5HI/4VYAcK1qRJbxycwvdAXk2FSXlWaWNLWGCk4/y95TrwyzO86/2\nRrqLJtSco+VMHczuZQ6w7Xd+Ux/x6M6pqq/ymiQOkhdQwZH17XRi9YS8WL15\niejQl8m79BLvKEY4E5hWX+Vn8Tij0DngYaozNQD5/WtsGOkyIr3H0W6eTBob\nWwCIu2ZRnHIXwTkJ+LHp1T7DLXpiKQMdzpmjGWntJcnaeTdTLRxJ2siggVZ1\nohPOUhzi2Uka1zxZUiSTtjABg/Xvmi9vb9Gqk9+SNIDgGO26V9wQNY0Q+DBw\nmAOWrRb+XMHJUm4j0Lc7KYsOUmBNOa6uFUG1kN2Gb9AmO6WT1GWoauDPVqzw\n1XwFQDhSeJn5Uz2PlxFblGuR2dZYebMZBE266/jUo3A32noRtC5ofescTvvN\n1TxegNeXbWvQUgwvmJJkSLo81zdEH28nk9dcGg41zufEV7LqQ02SxW4mck6G\nppotC7U/UWa1avjvVwWdfDXlTIqv1dl2503cqoUdu9kw9DF/Isz65pJ2OyFr\nJrQn\r\n=SzCM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cdd56bc29db4f95055e3e15629b4bbd9d66b00bc","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~add_deployment_info_to_definition","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-cdd56b-kk7abf23_1611259542861_0.49436428691743006","host":"s3://npm-registry-packages"}},"2.2.0-feature-7cc8f7-kk7ckmi4":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-7cc8f7-kk7ckmi4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-7cc8f7-kk7ckmi4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6a4143c9003209de84cfab1d5d5f15f1bd9ef01d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-7cc8f7-kk7ckmi4.tgz","fileCount":618,"integrity":"sha512-Z1hrdQUZO/GJKjRAc8Ipz1Va4k4v2/87ogmikv/DA9ebqACcdm/bg2T3lGN6XxiXx/mSBNnGi651IRmUoawUjg==","signatures":[{"sig":"MEUCIQDlpvwoB5IcspAeP+OOFdAm5tNE76hjQVkExy+EHi5U0AIgLKhhYjyY1WgYVbENqwysMNFRDhZTzGXJfLXzTJDSVFE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCe1oCRA9TVsSAnZWagAA/AQQAJx6+SjXE2Z+dDxIzSoB\nlCXOVZ8+OazGNgZH5P0FfvekBJbjzBXtPSZZwvf4eOeZNL4NP88oZt+Cgud6\nvz0BWZgERLoPjXqW4qxHIimgx/HzENQloSV9wxND77DBthTgFWpuI040oiMf\ncL48DUsBhPoboEenGevmkX4ouDQ2MHDVftfIQ8fjv2ElXUnmsfwuXJy/SqH7\n8ljcINXBW9B/OVNLCSYT93MYEdE5bnCpVl8RY7JRPN3XG7Ui74omfbB/4DyY\nfCGIXaf5GYjJJs3Sb7edSPlNXJ3qBJUbcSYwJyrTlZqNDPhFZtp73UtlqRvY\nd3VetQFxXpWhbA4opT6zi5yyK6zyMp35Z7tTjkU8wvQnVJFlWYfvTIqdeV0s\n9TOGa21EYHQMCP6wrZ7h91bc7PmZh5PtaqriGfSnyIvI88SiQF/EKAfw/Ksc\newW4bV5SIEZi8d8uU6JD4CWqZXxzNWVZ2/ohOTwGw2zfdHtggNlZKwYPqdZK\n62QWxXaDXXEC9dY/Gu+aXnIE6c6SmLtVUb5Ps8ikT7hoGAEcvfOkqS7MV6Ze\nC95DvJ7mM1YkE88uiRBindT02KvNBQdEEd4G+h2FJtzKMWUt/VeqqJ1sx9OZ\nW0pHzGhmsPcIS1ZgRaWY0B9iO2AMaXjufporl4M4HKiZqxgWDAWyhuMFbBMP\nCuIx\r\n=oVsI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7cc8f7da5ef6eec337e171ca1fe85e3bc7bb1dbb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~add_deployment_info_to_definition","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-7cc8f7-kk7ckmi4_1611263335883_0.0034995341723438322","host":"s3://npm-registry-packages"}},"2.2.0-feature-bf967a-kk7d7tjs":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-bf967a-kk7d7tjs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-bf967a-kk7d7tjs","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3388f881b0e317b6777782ce235ee6e09e52768c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-bf967a-kk7d7tjs.tgz","fileCount":618,"integrity":"sha512-n3RjKKlN8DBxSNZhXh4nswZQwAagoWFXnWCDycezwc8AHMQvwXjIgMXqMqnxWbjKlpCz+4egkrgItJjOSa0QZg==","signatures":[{"sig":"MEUCIQDR1Wj2AlQviZzkUk2i6x7D1nHoBjgkfL643dVVtD3Q5AIgUieeTV1L1oJ4Ea8JfAxpVtew8bYVQAsstfDxKFCoeHM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":694361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCfGlCRA9TVsSAnZWagAAQnwP/2IZaFJWbd6k486tnsDx\nTtHSlaaeO5aJ44YCL+yMHSjz6F4zlsz9RzdA1owxqyIozLyix/t8hfgmzcYE\nXa0gBcCp0jsqfSfloRmnftziiTozpT1U1X5JpDT8+bouO08lfbfFDqM18KBE\nFrFoRZs82GIh9VpqeRgWPHKXYptGT42bDL5NHhLk9PizWDuX6glC8PHqJweA\nVC9ot4ZXbrqoosmQuiDth+u4jW/1PXCgRLh2Oh3emojV9tim6eW2vR5zUzZH\nlwIxtJffnc++9axRJ0JSQMKlCwOdkXl7Gvcu3UV1nrX4OELn9N7kwl6P+fcT\nKj2t9Ufltf/+K38DwctmIJFZ6/4KK1Hr1otw8JmfqZQB/LA310Z9HigwQPrs\nrkbuC7DhoEAm6K93aHYrgQe/m17JsBk1X7zk2tJ1tR+wEIGQYx+7GKH43rpR\n3JlLlMWmJV76nzcOZBhX3brLdXV/uxiqNhGdSobbroHfn/mDdNWSlKkj6kFN\neaPM7x6Mg8d7AKzoOrGDm8eQhpeOL6IPK6WLt5I4y6tJIlAHbj6Y9lXK49wW\nXcEu+wRrz3tZm7QKurXs4n4FskCcEllnuw6Ruc0KRrX6YFv1yMrJFWnWyzNd\nXQWyaZx1XitoOCw20yAhnd5m/QE29YH3p7SjHItn/dJ5QRFpH/ODcQxtfyaG\nS3jW\r\n=udNn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bf967ab9e324ad35b20257e3f2f70fde5b5d349f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~add_deployment_info_to_definition","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-bf967a-kk7d7tjs_1611264420570_0.46238357053152956","host":"s3://npm-registry-packages"}},"2.2.0-feature-ba5a52-kk81obns":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-ba5a52-kk81obns","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-ba5a52-kk81obns","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ed16fc7dfd09b5bfac5027224e62e7cf5f365b72","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-ba5a52-kk81obns.tgz","fileCount":618,"integrity":"sha512-F6at1kGPhuU7FaQ30pVtdnMH//JimMn49+6BkOj85zVLHoKxLRQg64apqpCGBFcduTcxegOyB9zPnZdbdHP1iA==","signatures":[{"sig":"MEUCIAb5gkGddENlw5fMwNTqaPfwAd5tjCwEtVWKKqAxH5M3AiEAtdr7dmBv0CNQ3LAn2VyfOF+bssnVahSUN3vdD5YVDbU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCpIaCRA9TVsSAnZWagAAF0EP/3iJUXWQTM7iM0+AfmxU\nm2oqKd1Ps69mGSGRL4rDHQA1L0s2gjZOzZzKReVUXooEnnselbmnhHiiRyBD\nB7Nygbyblw5uG0tJIbxhRvizfUVhpqFfKpXnB95QGLOeKJZ1b4TaAitCn6b/\nUGIcc9BJ1QCPJI3IIBiQQl/yknTQsoT4w20bgV1B5OjJGz9AJmHBnYKbCdIU\nbV97GmbIKefghbb3VMKi76J+FWUfhzWh6o/zwGJkCFD+FZDbPcbHUKMNIRFY\nMtdRTCITOjrkC3Ha77ULRgl8jTJfPJcyA+9w6VQ/gNGWexYgjvY7Dnqhik/x\n48AfhemJV1e4Uq0jvenpp8jtu/QHGj0yA+MiSYuMbrDfn8RmbkdnRDfIGeGk\naF8iDAZnbuJFMMDiLxJFXQtZd3XfY0Ig55DY46aFsFS6b+hzSg0soa9sVMzC\nG/6C9fiofru9TLrua7PmNyqakuybOGqEzgNKCPTSyChu7svmnMqgwW8H7ITg\nSLr5qGZxoNPalJr+OVZJaaKCyqrNjQqy7MwCS3/wU8IVon5DVJrR5e7yfgyt\nDz0bX7yIZnIxbRth87zQKwV7YCFOV+PunmrrASukOGFdZO+07dkUYF6CUYVI\nvs+U1O/tvBi9E3Aw4i5NvGjJktgEUW/VbzaANkwiyDiDbEV7Xftu4q7BZBa/\nWnQP\r\n=LBFR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ba5a528eeeb4372c2c71a345c6de7f7b566efef8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-ba5a52-kk81obns_1611305498098_0.829956156587109","host":"s3://npm-registry-packages"}},"2.2.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cc25cd7ccb148412121967bade2786237eea727b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.5.tgz","fileCount":618,"integrity":"sha512-61DueJ94gfLV/IEPKC4dPstRh9lacOTKfyNhFk2PM+I44dhECFVMbeDEcTBuk4mHZNUfXIBiY5svI0akeSHGuA==","signatures":[{"sig":"MEUCIHG4noZ4DaVRrXYfY4goBZm0AxrTWaTs1JYGfK/k3ptDAiEArDJAckXxg7uggtI8kHYx2cKeOKBo/iske6Nlcazkx0s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCpRlCRA9TVsSAnZWagAA/ooP/iLboHMxoGvv+P+/aOmd\naUoXKttL0hB7JmCgVPhAigrX0GPOiki5G5CX39Uh6vagW3j0ZHisrZ5Y1w4+\nJBAOMfMpsg3BSgxUHvO/qMRG5Wecc2Ac51tc+UYTiSRC+l7UFU9EvIVdzZHL\nHSkvAEEsXFFB2CbrltcPPvi3prUJMz/dm77v9+jKCdjDqr5ee1j7Oju61wjf\nt6fdmy63O3VazCNs0DL+EpqmucPZaqKmBLu8Mtm63k2MJjDuWH8GLn1da8O/\n3aeLx96GZJpsMx4oWYBrKO+5DsLG/oKi+wGZYYu3W50Q7TVbEM4YnUKyqavW\nlrDMj7EQ9rC030Quf057hwE+ai9qa5srbLLW/gSMGVSmrSSB/eBzmap8O2LX\nBj4IywDaNc24mjUudkYEoihQgWrC8ohmMLJrbxIooQrVwZhlP8B3vyC/Nbxv\nTDQAw2EDkwnnKIWwj4tyAqYguViUSlh3Dy95JR4lj7LQmIHASORuAiEBbJs9\nS1WgmqDE7vT+0MYIi1eoJFcxcNNb4nkAejW7ZavpyRwXfiUHP6B8T0cZ6dDh\ngVW9c2bY2Rl6gzXMgFcThQ5GFFz/9KEIyNf7iNbZtWhvWWWnMXa6WvzQmuBj\nkuD2F9eanL5syR2Z/K40FRqvBWXT95L12niyq/SgCKqM+IONXG9yN6jVX2U6\nDcmr\r\n=He2Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"46b269d2c13b1645f1e27dfa8cb602bc12a832e9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.5_1611306085301_0.8306669143791687","host":"s3://npm-registry-packages"}},"2.2.0-feature-d203e0-kk82av9f":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-d203e0-kk82av9f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-d203e0-kk82av9f","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bd991fc62e818ebd220a4448b00715a64a196d69","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-d203e0-kk82av9f.tgz","fileCount":618,"integrity":"sha512-6DbzZHM4ysD0pwlP+0hweRp7dLf0huM3vzPZ1GaRQHeisDzjDFEnyiagFpeiuwaydi5d15xkJ1l+v+skAvy9Tg==","signatures":[{"sig":"MEUCICtlKIq+jR1dAAa8k4Ywu1Y5d1Z5rVKxemWNRkaM6lGdAiEA1jqnVBDf1Q9iqGMu8SfkeXzeHzcRCDszSr7CUgOYfxY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCpYyCRA9TVsSAnZWagAAg7AP/0WD6ZQZRi9nwoam/12b\nVYHxuqUIpBeoikhRCB+Zwtwppg1LYOE08DzJqsXOSUyk+S6t92/jhBXSGsBn\nx13ay8DQQhxCUKdyQMXU9h5Y8fzk9UI/ntIm+AEuQ3FZQOxA7Fsp+q03XTrF\nweXDTV4VqPR1iNts33fnlDoE7cvDzd9rXlH3nHEs1UR4sPsEV+XetXtbhJrb\nv2Jn4WKHmPqSo5+jwXjzC5+p5X4fGbtHTQw0WEH5UVW6mHNfmEfPL4LWOzdn\nPES5H2eGyblaQNx2/4VJ+WqyvIluJ93nblMxEIEXX8JKD1lZqMYQ7x7V9crb\nQCH/VkxeQgWb1gogMuC8tyWsBPZYWpsYpi8DO3UPV86m87Uannu8HaI57LgW\nsdvtFBs2XGFVSE78PYvH7zMZGJMeZGcsTE0YN2lSzGOOKcNUfZdvJdYEKq8Y\nYXA4GqvdKVO6iGd8isBSgx9ThCuKywNkc8vWF89IjCpPV6RF/vIzopEcTO0A\nBdEnyvy0joBxzpsaCCqetroAEbd+IZ2p7yFk50r+N531f4p/lSQjlKsj712I\n/8O8ntSshW3wPeyKj1ivIktJtu0IKl1m6QP7SYi1XWRbTN688e6ME31wWrFB\nlVyDqvCtkI7UY9VQc+3iuOU3Nr4OlFeU2I3/9mkI6nfQc6A8hFJvN4zfj0ZW\ntsFp\r\n=1IuP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d203e00e35a2337be100ca78c484261e819c03e3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-d203e0-kk82av9f_1611306546019_0.1736331972342331","host":"s3://npm-registry-packages"}},"2.2.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"965fb050e83ad34a32c9aead9a67dd51fa5a7944","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.6.tgz","fileCount":618,"integrity":"sha512-VeQoSx74m40H65dgF9nvxZcyrxl8qChTRnfmMm641qbY3dw1kyRmnZvu4o4Rx6B7PCLLEGPlw/TvzQLgsA2OlA==","signatures":[{"sig":"MEUCIC5CFHUgUuFJdaf1hTuIIwoSbBWfrQYDQUnE2aIZc/jTAiEA/jqng77ERHq9O8YvjB91FMLdNn8ruQv9GKMfITzWrJo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCpjQCRA9TVsSAnZWagAAC7IP/jPSMjm6sTxXICGOnz0/\nAocb0tej5QpXLZPG/NBsnL5NyBFBttwG8csNLF0jOlO0K4Om5gV2VWLxexE8\nydommx0Aq9NGipHxZZPBy5p01DVKHFXc/VHYnBi2QxUD4JRESVLdc5nw7zVu\nlyCjTQxsy1BKPTz4hBLjIt364/HZ3+sP55wA7/BbuZ98v97zXlpZ7tWNjmuQ\nWP7+4dfHfsxkhBUVrE37L417t6ItXvtPzGvpQWR53Z7/WIPkTz2iWuFt6Gnt\nczaA3clu3aScTqT+bR1EZtBpVOrHx3JVuyg1DRWZOokm362zCztQFduwaDgc\n3M1zplLDa300dztnSp4rx8HIHttEscCCy5IQy4LlKiRTyFPwAEQ3NSkPj6bf\nw81bydo0+VSWyrn6R13oqvpGEiMWXAzbXyz13dCHjpXCxJTER0ZOoXoBts++\nrdqrtEAO3YcDPtzDdzCoqc1Ccz+SX0DAQbpRtadhL9lqxGkmHyNlrnsQb4rT\nvY/LUFq8P2wAUCJH56uJg9hiqTZOhst02tAlsdXzOUlkgmVhuo2DaV2vTGkp\nYtSm5oyCZ5jbU9XxdpYbxeyYOkI0UjyZ2YiuXfQDUORY+iTf7vQxgT1pqX7/\n+I1QbsE/+VR8RiXelbyw+oADs1+ImX27ExWcHzUVY2nO1BVdD5C7TRV1lhk7\nBkf5\r\n=R//+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9fd1e5869b273d99523bd5abff0500741d9924bd","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"^2.0.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.6_1611307215799_0.4638479629996384","host":"s3://npm-registry-packages"}},"2.2.0-feature-85c129-kk82romu":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-85c129-kk82romu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-85c129-kk82romu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d11678cdddfe7de9652d7db209a0a34aab046cd7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-85c129-kk82romu.tgz","fileCount":618,"integrity":"sha512-D+Rs4tkIeHr63KYDgDui/OJbpNQ1yORQ6snfKQ3yoEF7H4jVZxony4ECeRRJ6gK2dusep9vsTguxoarnuPjuyw==","signatures":[{"sig":"MEYCIQCoYfT6G8JrkuGdj+W8HSFZioGbjUPVkwPGjRbWYxjeQQIhAKxM1ZC9r3bfjvbX0GiVI+PWpmTGAtkIT3/w6WkUikLM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCplECRA9TVsSAnZWagAABzUQAJZ7cZ80eTnmw9ichqGa\ndWREWR3fg3lwcVLMGfKPugDcBOfOMFz4ZP25EdaL1LvIcMphfevy+6m6PjuH\no3QsFcnXcurQbIJJanRj4q8nt/QhaA1qa4nYxg42Irl7xMdWYxF9j++OIw2s\n4zfLo14e5OybrKnXjqOIJen9un0Kp6C1fponCtSMT73mW4mu8QVMS/teUg+M\nymg3zxP1ILq/53MAfxJ+GUlZcPiBvHv3ayI/jUXx7rd/PBUFjCaGxQyuqH2d\n4EuDuIvHU4oK2DknmjV3RfeMt6Aw1/StiuUBHJ5B6hUHgnrMLBPk6nm6iWpt\nE9VmxIpY+ostxpEM/F42wNhsweXoMZg2TeP95y+DpDsd0GsR0BV4LwBPY8Ao\nJ/ezGJEwpLlkyX8zDGtIEEKC8LMjwi5v1XHCxm41/7VwDYJFhAogInYdtsGi\nyUnx0+NI1FdK7XwopeIijktTEvhYNyfLR9cflFezZPbwOI/d+06Lf+K1GGQ6\npI6fACRzYI9igvXq80RBBuSE8OPCeFuhVN7WStNj1Nyul3yX9J1rzowDeECq\nSRbGB0XlYf8Atd/SvfihADZ/CDArmEvg7Vb5HhnnBKSp3PrQ4EF+HSu1Dqy6\n/H4UAQizDKfAW2QUPPfnH3SuHNc9wATHuL0wJg7429ow9wqQgl4HJ9eL6n3I\nRULf\r\n=WpBb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"85c1294912754493bb1703e4c8d87024cbd8e1d6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~add_deployment_info_to_definition","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-85c129-kk82romu_1611307331826_0.644896313675031","host":"s3://npm-registry-packages"}},"2.2.0-feature-6685e7-kk858xpn":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-6685e7-kk858xpn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-6685e7-kk858xpn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cd6881aa4f60e148db5adf9e3bbaf2f7bd4ed1f0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-6685e7-kk858xpn.tgz","fileCount":618,"integrity":"sha512-KTpS+zNJvdZvsNfaU141b3Yd0+4N5Kp0PV4tBuJ0+VQzJwzVfk0IZiooqR1Az+JrqyEglUYjNt7Ch11dEJXLRw==","signatures":[{"sig":"MEYCIQCjLHmBCyz51QhiiA8ZuWgHeg+MHv9F/UZHX7w+uKlNFgIhAL3sEXJdbQI7xHrmU6Gifl4wf6YiHM9QA3DhXbVNuQt8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCqmJCRA9TVsSAnZWagAAf2UQAJRnLcQfwGHLGgE2Csk9\nA1oXovPcGxGgQHC9BJida5c3DDwCSXL9SwoOdAijQtKb6NklMaIRo4hJ2fIU\nSWPzuVVCvUo8PrbedrI4iJnpuS/bW5Kufse4l01hkVSPezBeAMwZGH/drclq\nE39BMQuISBUWz3HBhu2jjHQAYhNTm4aDVytge4bguy6ocJMzsjxYtf4U/8qh\ntu1JCrF6eGQCrDAVWqVeTylcC/V/GdYA9HaR3hSuiC0iNGjVMsZTpTWOdDQM\nxksgzq3JUsRDZ/Q5uS1SruZ1G8dNyQFZN4ECPQY/c8xmgy4FHibedqb1KKAR\nwTjrHx5rVe5r6V/mI4RlpPkLXRD6mwqoBWTCSoCi4kqvou8rGMGEqEB+W8Dc\n26rEDHPWjq2FVZ5Hkkur5hIQXwjkw0wZEUagms2qEr3AVIpGaCb0VS4WztoC\nNocvcIdV1ToJiLgGjVlqKQD8qI7UwoY6c+hmnTwI7nSpG0mVC/tIi9CVfGYY\nE0hu96xfFWBUHgeua2jMp2BECG2kowysez0B4GamMip8Y3wBd5O13dqnO7wv\nSWV22u1miUtCjyDzZhs8CFzIkqXydbI0rCzAXVIZghn0e0g1QxxXTiHXGiwr\nSlvYjSjbltAfQApkkdbRsOJxCgogfT01dHaf3jlhuHnKy/VhDLQYIeeEwt0l\n0ejW\r\n=+4XM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6685e78d2ebd9fd51920ee23c9bdf873e0ed0941","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-6685e7-kk858xpn_1611311496698_0.3363176433869297","host":"s3://npm-registry-packages"}},"2.2.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0ea47e409427efff1fcffb3ea861755c1dd3cfa4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.7.tgz","fileCount":618,"integrity":"sha512-Y4uzyKseehKj8WHbI2dp6UqM0cI6lXO0nFMlV1XkvQVgo5FxV56HbhmVGAo4Wou8tnxZedLdKpN3Ufsg3HgYlg==","signatures":[{"sig":"MEYCIQCgwRdg7HzDF1rrBszJ/U29BNXx3uj2JOC8NmwOafOCJgIhALK4WAH4hkGzbyobgbJ1kDZOX97yzUn2kxkCDpHJinKy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCqpjCRA9TVsSAnZWagAA62sP+wfX1fIabniz4OhUB6jT\nNNjteabE/LblGi7WqKC3EiVlee5P+J6JKm8JHBDGnNCzZFPODEoMQqlw/TeR\nBh/BQu/cLc+wQMo4kNSy5MMw+Lzrc77WXq670dESPp1pA7BC2glNEUZ1teqF\ncUlLJfVIel/KMHK96Tu3KA76mwt2XRkyuUdNKH97VfKgS12AvZTY8XEYX1dD\nTIes5br6o84D+PCMhrV/9XvwLIR3ddQ8OBphTcpwCH6huMYqhPz464GU1IXe\nHjLkNnh4nN25sxcjRtPUYGWPHaOpWZjIodFZiBZoyeezmb0R0QW4+iBZLZVL\n4OpZ5+vuWRw8e+hXAD+A52PntXd1GM6VwJmLX3hmnX02W4VopL9ZzW+ev7Mf\nIAXY634wJBzsSGSKdU25z2xs31yT9OCyokCRpL5/C5PSK5lcxjJ6Kx1bQ12C\nWKT8yel2617a9k+N7HMVP4FykkArRp+UZ9lMBEpSml2MDL5d2htGSBgdH+b1\nzhlMFZUbCUiNIwQ6Tc/7XhGfRpAjpTNRI633r8d0Io6FhtzVqogAE/FpUMpp\n6vhLBqwNj3f5lhaT2hSZqk5LuUvFDBX1L+fcnEBI4otfklcXVXcAQBkxBVcP\nUaNvZHyPpdNvoO89PlcBl0DDMDyf0PK/INfe9ADCgE6kNsCfIb9sn5Hq7Mku\nAmd0\r\n=C9lX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ec9588f64c4af9883851bad65c0ad76cb2e3c7e9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.7_1611311714919_0.7664942832604396","host":"s3://npm-registry-packages"}},"2.2.0-feature-b00a83-kkcq1cf8":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-b00a83-kkcq1cf8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-b00a83-kkcq1cf8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"837a31a1550703fd44ffc6610deb780b096fce3b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-b00a83-kkcq1cf8.tgz","fileCount":618,"integrity":"sha512-oJdpNegJCmCwmODBAcwOj9CqERv3aYzP9Sv4CkUw+Lo1CQEnzoSCJMG4eP2+ENl2kLxyMQ06I1saa2XnPtII7w==","signatures":[{"sig":"MEYCIQDr8Qkk7a8PXciYE6npcGZJSylUAvwsSu6GNpQ6IQdrhAIhAOtqhbgC0rP7UG1qh5ECp5oSdonesU6OqGCLN9bcoA3Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":696973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDuK6CRA9TVsSAnZWagAAZWoP/0tEjtt5wtmIfvaQtMn4\nkgskW0aS16f+aFBuY1yakL+UuOTbj/94+0bRJ9J9IHbEJacetgECgXawNTi0\nDZdSfqJgsnNrNi7AH9ju+gmBi+cFWxOzxhZ1jX1Yixio3SfVI9Z6gCdaU6vA\nV23AXpaGn0aYqeQHoXFJWBxNybS6e7XxyRpPqfGppNmbIB3A5W357EPyS0iC\nr1dDlQKqca61+aPx758whM6Z6FJAqjB7/rgP+czBDFMcC2ep0wPrWvZ8Xdov\nZvxm34RMR/8csKjpEwtrMAwMa6zo0jIygBSSWbbm9do411GuKYF87ttEeF5O\nLeWyLR/sTc4Po+rifXvwa2uSjw7FlnrG+aKcZLs+Ypq3G9duDc53lCZamfIn\n+hagV6dPwEDOjpV5oJfO4Vie9VXdmlm+5a+73xU9TxbijcUZv8QNKFu+b7R4\nlDZH/RMAVadajC32L6/Lt6wPDo0DWjOxpoEJYAq9RR2JNe9rQ+BTYu8HRF6l\n12QTGeizv8dtUFg/zbACPgzVuSJPVmeM/nS46XAba77GUQSXftn3Yr7z925G\nxMcQVQ5FRoJKjtN5D8w70M3UBVjemddC147k+O4YAobjnT0knWBPobkdlr3n\npGp/5Xoa10FgaSWNbF2owc2lUTvn82t6MFeC7Wz8ctshdLOc0G/qjRVjX7Ql\n+g7j\r\n=PpNE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b00a83402d6896bae80b7c01487e1e93b57accee","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-b00a83-kkcq1cf8_1611588282148_0.6420902392147987","host":"s3://npm-registry-packages"}},"2.2.0-feature-8b14e5-kkdopklx":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-8b14e5-kkdopklx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-8b14e5-kkdopklx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f837e490663c1141351d9b3b06eecc112b3e8262","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-8b14e5-kkdopklx.tgz","fileCount":618,"integrity":"sha512-31URDUKPHid6ubo910bjchv6WmUu6Y8E1n4Dde+adHaE261DZTkikA2emL6KP2P2ci+e9A8ZkMSGbbHIeKGCKA==","signatures":[{"sig":"MEQCIDnqCZP79FWatLPvK4FLWgVrUx2jrbPP3p34hAW8UVTvAiBtRRpxOpl7V5/gOyGfyg+xUTUyN95coiHCokbZoHCrxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":696982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD8Y1CRA9TVsSAnZWagAAuiUP/Ax3RoXboyONvIc5qTjs\n9hbvW55iFfAMJ40zxkOviZZulDVo/HPYsIOh3BfL/dbSuHCjikUwNK0rzlEX\nM480lNgbm1/I7ZUbuRjSGcYAtA3PcdVFxiiHTi9AujrcFSl4NfjnstFWjGPZ\nFQK9HtQLwq7zmfoyQLPaPP/ZOb+6fkWwzflX3BIb7aYW/1v/fGlWRped5v20\nYqM004OQWnfsx6acy/pnQxvxIDvLOgsG7tb0/jwVtZIfvgz1jLwqmHesrt6R\nRlDfdK56DsDT2zwFOZDNuKU+JhkZlCwEkBywfngltP96/YrCH7BOJFoO4NHk\nPDZexvHh3CiVvw9p2orNnvtEH8wU9GeWBvPXB0vmSeSB146WrnNGGx2XXgcE\nT2zkeoHmWWHw+emG9BrFKTjvegO0PY+R2AQagfRg9SwwkYm7+Z/T9Iky1bsQ\n/o12UzmwNTBKxmYfJVCHlLAdNmm4mM5O/OCHb/8PajgquK9X8g7h6SG9p7lX\nhVU00FHMgPKKQ+1tFB41DDqkdBHdeMO2A3A12Ax4gxMTiK8SdMienjhyR6NB\nUcFfvUExgy0X7wZdBwQS5XtvemadXX+LRO4v3Zlu+EmyNcM7hu7oBlrxygSF\n1rwN+93zGj9NNUUohQGcbzLruOGJjbCbC1Pt1SF50Xx8gAdTX6Wl09jMT5GD\nLBdt\r\n=RdU1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b14e5e1292a755d12634d41fca88306d62a01ca","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.8","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~replace-moment","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-8b14e5-kkdopklx_1611646517259_0.3553606586531515","host":"s3://npm-registry-packages"}},"2.2.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c142c00feb8ec87dd70de6b107eba7247dc750e5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-beta.2.tgz","fileCount":618,"integrity":"sha512-C3Ic7WTzoWKZMTulcyCz68t/I2yv2Uy8Qd6uda3x62NWTNR9gucBNOT8u3dT9yqY1Ue79UxuLKcLmXzXikPKeA==","signatures":[{"sig":"MEQCIFzNUP+8rLDNiv0RD8AOu6MbPB9FxlMv8gdejnUFAyzyAiB/t3xQUf32YqYOsh/fBjDYb0LpB+1z6UOcv/Dzbnw1xQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":693787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHrvXCRA9TVsSAnZWagAAm1EP/0GnPB/zeEnzzQ0dKzRx\n6B6Wycxt6/2y9VSbg7aYMlnXDAKbUj3vVrje8urEms08T/bLSuaJaOPgpM7W\nPBfWNqkfB9sqyxP+1OJSdKdjvBsZU+cjo6S9HwPBJN/IayrNOr3xt4o7ZAOH\nPCEDLRv8BVOibkMY4GamLbwLlb3ExP9La25ADONVLTA+HuHuFlsbfYXnsSwq\nV1liDMJdvhbEmvtXvHJkR2Rz8HxNlts9AJsh/k7dNDdCnSDP4eFkIMvhEIed\ncteZ5LAfD8R3rBfIXI3YE9en5OBkyBtYK/qGKMDWNXAN+CNrP78h3TXlMe45\njV0dvhIWXkzGb0HxKoHyAnSE1j5aqDSEpXShBm7vE9Hk9MAMxiVOacIOd1Vn\npEj19PUwmYO5bOUjzMfMSCeuZVgNSDYvmhUGf8ophGX3ktwqvJ8X9bVnrOHh\nO59Sk7y4DtdacoHTJoHDHvdDN0TkImZ0eYeMA8HgW8+Fz4yN90MYi2jitcDC\nuXETtM3bPpBy/NkCPkPINVraKrNlbANFi6pJE71yyfsYxHlFEcUQlbPSwSf5\n7hVaLHkD47IzF8GPwEck61lqlG0dGU6VUN5RRwpLLCAQvxslWONf8kWDq3sc\njv7UMdqSGAZ0L9muqMYKINRXq4zUzhXnsB0x8hZDEomVkEy9QebeaaHpjGPw\nFAS5\r\n=lgDh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cfcb1e351fd19203389a01a73ab92281cb70662d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-beta.2_1612626902569_0.9817347102150291","host":"s3://npm-registry-packages"}},"2.2.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e20ac278bcd4cba6b783c04d28c1a1c4dbd52b03","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-alpha.8.tgz","fileCount":618,"integrity":"sha512-jDnlwpwKq4R2SFfN4x0m+jd5KWY1N91FUBLzkfY6RLpH53eIWiLcvu9MmOHQy0bz7Re6eileOi//VQhay1AsDw==","signatures":[{"sig":"MEYCIQCZWAYqZ2YO/A6GRuePI9Xy6590x81RwRmaao2XngXr8AIhAIonfFSgz08EDySRwyK0H2MQkkZ3SitUmM6HWOkWpGyh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHrwZCRA9TVsSAnZWagAACSsP/268xPqsQdxSk9toNmxa\nlkpii+BdOEVeQNKjGgjx6T6JD3iI0CH/UjMNkSr7+EAJ9FAdQu7DRyooE6Wu\nED+XGICfKAQ1nN5XG8dgYK/3GrwqaNiIFTu7DKiUyyGikZifnwY6rothnNvM\nCDkuJV1TEE/lTsyzbIUsaY5dWxg8Cp1Ip8b0fvF/ZtAJVuURS8/cS08waKoQ\ngcQSMMotaBOcAt5+3+FsfF9hLS2mOVxwvrb2gXADen02rsQmDxOied0jjMgK\n04SF4x9eYrRN1tPzasenMQT476alvGQiZu6C8cinBTL4lFQDphSIuygVbM4N\nCmk4HiSVskOK4D2drYIgfjKCXzTTBr61yXzFE+j3K1OGbvDX3djVfyj7YT1M\nrW6VmfdtafDIwQeicsPbxxcmnY3ZRejNjpreDD7poyCX0+Ys52zzwWa92e50\n62ybAL8kBh0lIvl8zRInaBhZw7WV6/Xmb3MLfRecdi6KRXSBqy6eznI96Jmq\nWXswbxESF47NhZBj6DLHDWND4PU7rGj833VpdpJhv/peEPJhbBw82KybMRLW\nuNncsI0VMQCVKWmgxNf35fzBtLo3EQBAGotds9Jo6PFUBHrAGaVT1mfDuTnu\n58ts4JHinOjBgx0VHELeEwaq5hG10VRDXjBtctW68R3tdaw30A2YNnMwqSwX\n5OWc\r\n=nyFl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"69f76f85cb0a8ef2cc49c808d5decc31b57e1d73","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-alpha.8_1612626969256_0.3485930137712927","host":"s3://npm-registry-packages"}},"2.2.0-betafix-d06880-kkz91yh9":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-betafix-d06880-kkz91yh9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-betafix-d06880-kkz91yh9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ecc7c502f85472047db1246c8eb4a63a56e5ee0f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-betafix-d06880-kkz91yh9.tgz","fileCount":623,"integrity":"sha512-4/2rxQh+2/Ovk/q/I+pdmN7fVK2x0Zf49iZbDtpUPVBGNSPvyAfBwpi6oiCLW9e8BoHcragv+L04C+qt593DMg==","signatures":[{"sig":"MEQCIDQFbsjQiDXcxu7tgPscOItQxa3OS/nZ0muWQU3XRtzPAiAmkVVIVz/SljIVyhMxBRBiXvX0nUxFXKgWSkwzG75ZQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":699798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI6vPCRA9TVsSAnZWagAAF1oP/342WwQMhhgMXY5x2dAU\n7zkzzJdWklfeIPCfAtvLfxQYDt9heHACnDN4GXMQpq93xvWvT8GzHPeD4I4h\nIYed3p5dJ24iql97O5aBhlRovePdmQNkh1LsYBJFbXO5axEIdMCx8M8r0And\n22gtXL3v4TwO0sECp0B0o2AFHZd4yYEpRLZeBb3VJS/qR6E8MoOSrYK5UwW3\nkaP8rSggdImZdHVAdWChBW6XBnHDTF0sOe+8/KrMchYGUmGy2jTnkyKk0ZNQ\nOvj+x3jR2lUDBtKkd3gUa+QhXLUeJiyR4szkLxhmijB8Zkh+eT5hrxuIKZYD\nnGsDWw9QjUi1ZlDy7v8VrF73XMv9MQIJLzUQwMgzGsXbJSaLiIyOQ8zGQM8h\n6tm5KyLra9ZrbgONELNac7hTcs0eEK7K5dO6sf8kVCF4bTxaf1DgLscWIf7K\nKyrrm6jVYJ14tSak6sCgK9HvmQH3O7PVvsS1UfCh6kVX4ClFM3qhK2SrqveV\nXDRfGpZzgBBU9uPJuE/sVJnosPvTwEEQgxLd0Ldbj2XWtEof40gzYWPcsKCS\nPyBMiR+7O0iH6qg9W5J7uZW3Bvs1nsmikxvPZ4PTLXYLLQi00zFlEOl9Z/pi\nYeLaWI8uxVi9cS8jQSj3DgGCJbTmoCU1jqd/SB3SkNPn6hwT35NvcSYq0XP7\nCphD\r\n=AgUt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d068800226aeee2b3e01cf4187a1f2f43f1bbe19","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-betafix-d06880-kkz91yh9_1612950478284_0.896021488620224","host":"s3://npm-registry-packages"}},"2.2.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"83cd8c46c56bfca5a8e4cfea7eaae91a4bbef3bf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-beta.3.tgz","fileCount":623,"integrity":"sha512-lVuiAG0ymkYduY/lJjT6DpR422b/yDDwWwVqb2jjr2KNit9JWiNHhtV+DfzHB94ISDufheLD0aUbmzKrtA2g+A==","signatures":[{"sig":"MEUCIQDPM88JKgbVS9HiOEPRGj1uIPIhJ/8gWqg/GAjSE8qQKAIgMGwp2+7zyT6gbdT+vSqAt45geM1JmkInYAHwQD/ALy4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":699781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJOwwCRA9TVsSAnZWagAANf0P/ia2KBcwXBlYlkJp8B5Z\nfj1/Fn/CYJlK/fegG/a88RNnVt6SYweWH2M1u4Fh1qxcdqAY60HSHQX50X5w\nxPyXtBPqgtsPbONKsEhJPYiUTApghXG9f00qAxgLli/u973TaZP+zyNdXej5\nkXUtqzZlkHXp27OV+V1dVONMgwExPXVawd71TpL1mYQUq+VVl+VyJrZkVvT6\ntP7VJZsG1Djp9lJVQgrz2KcT+rR7ZaBSLCdgkzRB0p1P2Jmi2UfVe9a62twr\n1wN8rDTnj9BIoAu7K5JOLr6sYXiQAkL0pIhEC+GEvQKooxieoJQa9DYsUYRE\nJ9B+lv5MGY6O1B00mYXctXfF1gwDbwalzme90k7TqCSJp6bNdLKHF4Y/07HK\nwOdOqZvgCLH0iO1VdOCPXaUXewJlJc6qDzaiYdu/HULqAPEZby0UEJA6wreM\n1V0TSuJIUmzMiJlgqqjo0rJWR0mA2eUGTcFrk2DFrZ8fA9PVY7xwE6gyBZw9\naibzLEgpIj9yXe2/vj69P6aTlSaSIRgV8i/Zxwwu0xYz8nML5mEtwBfkPHot\nAdoc4hA1NVMTrqCB+rX/aB63xHorWmyTrTUNQRYDj9U8lrNukCaa6Ymw87l4\nKIKuxtJ0YjGfnSVtJdREJyPXmNNLZ59+oDglhuCkzSc70006H3Y5owuZeooB\nyDRZ\r\n=e6yB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a5171850bba601fac97845a0a71ab48ae9f103ea","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-beta.3_1613032495435_0.28924726043656945","host":"s3://npm-registry-packages"}},"2.2.0":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e911c3a4207dd04230ca9ea156c502916017fc25","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0.tgz","fileCount":623,"integrity":"sha512-N+iztyAvRBeIhamJseHk4FWXoeVI7fRM0osmClPatU+qlX5ZewMkJAkRARBN0XbHiHp9URIKApazSmRUGjjnmw==","signatures":[{"sig":"MEYCIQCebnqpnk/nefDk1IS54HvB4ANu93c3t2jwiGvYaqXwIgIhAJX90+d2xHKwed6Ynv8KuKlL8CB2ScNFVmjxuoOzOLja","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":699767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJPxeCRA9TVsSAnZWagAAbwsQAKCDnYu6hLwLfytaIa5g\nwg5zq1PIUtRLEyrDcsmt0Mu77Ati74bz6T7/xQUtdsV2yR+1xnib6KveW4Mu\niu4hWM9zNrumIFpevibNM15CdUXkHkriUx0ON9x1ARLILlJca5W/x6fV0XTu\n3iVcxxCnxrNICa4Zd3w7a15vSPHMGQte17oXOIaz35nI5D+UgdrZxjCLtU5b\nyh6nUs4FbjlfauFG0Oq2hMAFVi2tsthpAzXDd8bYP6cu3AdjZIEkuRN0S/SO\nsKtJjI0pTH6l2eZaHUYt5AOWjihJ/RIYaTs9sw6kk33GUweg0i1+AZF74nUt\nGC4RPpIAuscmuKdsb+V1Fc9Y6uRdFmtIm7mO0pNIJiKbyu0ajFw+XTsDNgV8\n//wn6pWY6nu6gRdNUQ/Mt/tzOZZ1DqSmTx7Hj6sn8RlwSYSo3bYh2k2j0C+4\n2YehP10YZ3WoQD6FttX5kUpS7Cy7I8Nl+Nl4oNh0CFPfKS+43OXBrZX2zAIg\nfivtYXTJ9UM3w2o7Vaj73dlbscCMKNxaNPStEdOH3HrKX3/BV7v5Ovspka84\n2mJDDPgeuWjtsak+lKafdn6jFiSuySNXV6k5Wfi+BZnZqifdMVADbUFgz3kd\ngSdsgWCBUwilYgyix9QB5gnjueybRvlhpdK2fl5iRQ8EQI1NTVjNcULrbrrN\nEQAg\r\n=2NUc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"a9e27ebced15f30ca0c43fcc54bed36cac2b6a33","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0_1613036638104_0.41174223947372357","host":"s3://npm-registry-packages"}},"2.2.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c1bb64ec51d0a6a67d77d26e07fd60b41d24016c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-beta.4.tgz","fileCount":623,"integrity":"sha512-XrWgBmOKJ18/+NZ0wXMfZI0iiDjIJM5KEehiPeP19oI4eRR3ge43BMfVgy/GrJBRdrmr7iIUu+kb7VtgMmYhOA==","signatures":[{"sig":"MEUCIQCITaskrjq7wxCzHXwtjBVDw6skDSltnWPMiKVizSR7nAIgKpX+OORU8Y0AdCP5wIOZ//Hgf/3MlunmBf/dDtkyQFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":699774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJPxmCRA9TVsSAnZWagAAvfsP/0p6Uf8pFWCizTD76aY9\nQcbB9l+yv5yZOV7k+PF8MeGdagrBm4TajYGo080gi5DZg0jfXbwcqxm+sDod\nOPkyaDITnT9xLLMlgyYhLr9fRYCCnqDlGQUsssdMBDvAA17eGvHVplrEKTof\nz9Fyw3O86PHZBFNLiNrLrWVDQmx4XLX2vxewQNCixpygpH97IK/DenmABA0A\nzEZr+NY6yLN+3dY0YVrraUbSlPoXDgk+KjkxmZMbWTYy1w4NABf3OIIZasI/\n9OVCXHlefBxbztXPpibiqrbmVF9igN6Zm05weoPxEfbpz7TMpnL9DZE5U3KA\nyV/7K07dW1VwIxDAZ0UeNrptN7GsUTLwCFRouwenfS63zJ8nZ/wHw5fyojRW\nc/NjoOudn/YM2yN4A8Z1EXDzBGJyBS1fRhtOzPgtpDPG0loJ7agZ6TOq4/sW\nrgywuY4ENgbIkICl2qTL8pAZIc9HJg5kSrvOLeACr2zT2i9u2C56s3SiJm9c\n7O27MwmY3eUtz3jGRQIfN8B2KAkq2FnFwNhaPs6EdqiSVMj4vNKYo/d0MotX\nTGJkfO9r9WYBpZMtXXUDW0Fk5WHaSvpMST9CbH3tlcJAPNVSMkE++wxVkhy7\nGKIjDZmcNTfx0//Slx4O8Kyp+NpOP+sTLwd/pflohT3L65gyupsktpj/APAi\nZLj4\r\n=RZcU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0b6a7f8f7cf1a9730248f0aedacc9b7ced57ffae","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-beta.4_1613036645697_0.9578771773146644","host":"s3://npm-registry-packages"}},"2.3.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7132f1a9c291296d795bb9856aea872bc786c17e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.1.tgz","fileCount":623,"integrity":"sha512-52U7TWgBGy7vuhdsVzU8ZUC6UxP0um9EDtUVlQL3rvC8lDIeg5FgOC3/ZVqFxfOg+LROJY8I8e4v3qezE7Et9w==","signatures":[{"sig":"MEQCIFezaxLMoBKb3xvCGCgyqadrrDj3fwU2SS04WMD8mkSWAiA7dsifHV/CVhkVBJ8qUOQyFKtBv1Rmkx7FUywmrL4iww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":703569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJP04CRA9TVsSAnZWagAAerQP/3iasmx+vhW7p3gw64k3\n59Obmz409Ys6dbAnN2yvRQBVynmc9JHOhyuZ98sBUwGxuhGPZrm+kL061mfA\nRleMtJLHxCw5oCj5FZ8zCSbQ8z2FykSocpLpu6J8Zz6pcZUGOHm//zd7qzwW\n50Nz7wVYm81wTnjOWqZKuYS0zhSmt4+bH8jmoMQHHA6NHGer6+/VXGs9iXas\nNCO3ExWTzBulq4+e0YDsV/2YpAkY6rhK9vyt1Kkv9PlLy4PoowCw33HaxchW\na0W4F0NMilhp0P9SoTMraBXTLDfUtSH8P2P3oHP0yvxE3mNKpiovG0+zLhcd\niTqCJn5bxoHuivwmy6PDqkDpZHnw2gLsuyTTnljiUpqzMHtJ5bO+48IDKC2J\nfIZZMdNKyvzuZA+DOTQXGqtBEb4ZUK4EAT7Xrjo/KnCOMaGiNewWycIoVSWy\nh/8iuKw0EyGeJw+OMghwluD5pR4grSfgf633M8RS0Derl2LhgpxqtR8CrRdk\nUSOiUlJsVhEXlP0eXAtyhuBsPO5XieeaoTq92AYCk81z4S7b9pid+VFoD1D+\nJc7T5SnkmGbr9sAa5Sj9g6CQw4ggFSSMYV61LIASqMgaAQcqGgmSjgeVd2KY\n44SUY142Qwku7+JRDRotZGlJn4CkmvyW12N91S6p2kGFEJbwoA65GBvVUb/u\n0tmi\r\n=E/DO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6ec3a53f0f1efe682cfe9099504456121f0c7160","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.1_1613036855359_0.8862261412010317","host":"s3://npm-registry-packages"}},"2.2.0-feature-57f592-kl0prrc9":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-57f592-kl0prrc9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-57f592-kl0prrc9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3ca19bd61c4e53dc8681d484b6ef0b5a36cc586e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-57f592-kl0prrc9.tgz","fileCount":618,"integrity":"sha512-j/J/W+i4MUvN0cB9ZLTAECYyei69Eq4rYTSVRFGJ3Zvt2uJP07Sj3SD3F8+5U/TbAeZOrbcNlTJBjFVykRHQaA==","signatures":[{"sig":"MEQCIAKMkOSWNeo0a9SnSzoDfNTsEktCOtB1eq50wa3X/e3RAiA3xm41ago4z0GPUaFoMg9mVWwe7+dShEFGlCxJLIgcVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJQWuCRA9TVsSAnZWagAALpsP+QAfQwdYIZ0t+iLVuLYJ\ngJhG5r6ZFc2RpKGACgsmEug8nvID6kvGWsk94+ndr+qEUwZuSbuXzyNVyLce\npyh/sCA1sA/EA59VDIqKKLTzzS6mz9j8d5YQM2LF7hIK4+UlbrZ83Nn/AeDo\nv4DT1X5GhKycV6aTC4SqGegdfybE7j/iZxNyQ7ZZFqiuosVxW3EqULPEot/l\nH6hrnVdNBC8GyOOHz22XMfrYeGgOUZQTvLPcmPsr2MhRBz7YM+QV9tFtYQGr\n1B6UhYOUJsZ/cm7WABPwBSAAjeprgk/gIt30jN2nU0lzbRLRD9kYIofJPTGk\nZQCoyGK+EuUOnVHwGTUWz4LV85W9BdpLAaiIcIOAKwg5aovqdsYc/UMlvA+3\nHayqCM/4+A7qev1SGEObU1KCGlVNypQ1BTTokbcgCHlWwUGTD3W/g1s9sZh3\nrgti9LOjWqkkPE1DlviQPAOnbY2eTwZPpq+FRnYNlYizUgoJxzgvAoC4kvBB\n0qXFouUVR3kf2vhj+IhhlOPgWRiiM9RfzJOo21bHrbYInJtY4ML0r81XnQJy\nVvHiInoW6ivkNBX6dYyv5aY9/oNxLJx/gva1S04UJhlZjHaEO95+KcUiUZMp\nIjEWn2wK4NocPho2Ds1r/DZrDG6mqWCUANFJkz8CYsGvvEfG1GPDFNI3+2Ut\nWDWL\r\n=d1HJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"57f5928d784e6e67ffffc728d9ff4b6c6f4ee312","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-57f592-kl0prrc9_1613039022117_0.22444270859465254","host":"s3://npm-registry-packages"}},"2.2.0-feature-a19034-kl0pshy3":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-a19034-kl0pshy3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-a19034-kl0pshy3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4ee5ef4de76b862b1c769823a5da4d4091ba0919","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-a19034-kl0pshy3.tgz","fileCount":618,"integrity":"sha512-GC/bvBNXvNJ8JG7MGhgnMje/FpKTis5CG1cntsUqfGQc12088/x5MnaxLImvdjHifsE7RqS01PH+17fiNrMQIg==","signatures":[{"sig":"MEUCIG1Lbs/nYbY6o6UntcmSl51b1H6FZkkhGvEdCZFLVd1UAiEA7aLNloMAAI56oItsDyVxxNwbSuB5bXvWgUiWEPe89lQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJQXNCRA9TVsSAnZWagAAl6MP/1i+yaE5wcwPVXaKXZSb\n0e5SoTlyWWAp59cJSdI5lCvVlP+Np0ClP0ge1TKH6kuCmZE+tQo0pPgZ5Ia3\nS3mX6PjMB7Agmj0v0q8JbcDEDeVI4B67qOLFrFIy0/T6hXar3eZB3F++tFk2\nOwT+vRxoaSvjej2vu0FpDZkOOmdgbiaIyHmEPNrKGjbC6zQrFoi0lEcYJqac\n5AC0CbvVvlg5zAtiSG1h/Qrd/WnaVQC2D8zixPZMj3PAplP6T9QNRyH0T2IK\nENnQC79kqMACpX93y3Nwdz9ORdwC+Cgn4j/LGFZzcoFYgsWEk98yYSA0bfDm\nsB624UQyqoKVlhBfPvARLdn8ZA7vY4izvcsREtwnNFtQwZXGtkW5zYG7783u\nrN5lHOKgo7ugBS6AtCUqv2SwmKdVdt6EXCuhTe1RGDh4qILwe+/ncdID16/1\nWK2Aj3RAnrrOki6KUedqld9UfdSS2qSEOb72zHMcs/w3QFy/taUzNDD6joqN\nI0pagjWAOFamseUhFYOCX46AXiTO+PtO67NbRj9M2cc3KaUNhRnt+0IAjVfX\nDdwydMsTrIdDAF3Y0ocoD5+7Eeaji3caEx/eltVyIKECFLkP9JWR+fVI/ZEY\nAQpbjH2wHPuW73Y06zrZVpBvxGqN4o5s2/094uQZBH6gdGQse6erHtUNi/X0\n8qbB\r\n=FxAl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a1903471ba0c81b68d0c66ac804ec22cdbf8f7e3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-a19034-kl0pshy3_1613039053476_0.7686529651591645","host":"s3://npm-registry-packages"}},"2.2.0-feature-ce9530-kl0vmct1":{"name":"@atlas-engine/atlas_engine_client","version":"2.2.0-feature-ce9530-kl0vmct1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.2.0-feature-ce9530-kl0vmct1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7304172975a331ad4cecae6374d5a0c7db4d8eeb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.2.0-feature-ce9530-kl0vmct1.tgz","fileCount":618,"integrity":"sha512-MAV/pzzL0HF2u7RKAvpVEfh7CVOGzFD/yNXGBquWFFLrUHr4TXAb9/LcqKumV5WnJL6mLo5LBtzJyjaGfsV4Aw==","signatures":[{"sig":"MEYCIQCCGwTMbo/im+fe8rOZ9ws0fnyh3Dgb721vXycNv3RPywIhAIaa0mg87zjkhCt0xPgGCZ5tRgHAIm+UUqmvDqTs+ZDC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJSwSCRA9TVsSAnZWagAAhNEQAJkhhMYSh/IomwdyIFtT\neAFH02LD+3tT2MwoAfAzG/ks7bh+yBsevyCHVYCKmHhp2xhSF/UZ5u8IfuVR\nkLBLDG5iVpqsPneYYO+WZKk8MaZjl0FwVI0SXeaIJhjh9WsnZEv9/lXuPf3T\nvxTlyV8QjK4Ysc6c0gLWXnov/YQSPI9LxEzpArY9QKkZ+DY/SqZljJXsxZb1\n5mjy9642nPR2eWxupsqxArUfgGQfZxrgJoX+MHtcWEY4IzRdCoA1jF/RAmVl\nr1B+Yx2Xo8zX7x+DA+62xFYHGoVDlj2urCED+E1ChC1SwGuGrbHUJGnytNFD\ntAV+xfOqCmNunOkPalL+QmVsRrSDPiye/dMzkqLjcc+e1X6Wu/RwPrYYl4/F\nkpjhMjJWYBia8j2x+haC42cB4WmIWzKUTFcb5khVWvK3rp+W34/ufJwLdocH\nOLqryK8n6/Lq5KW/9JaFgG9KRizD92bks+BUXLWiamcm5WlSIPAgbIRqgOnv\n4yJY1/4d1miFhOz/vxdsJtqnaboi0bP5090g6bRRvkLhoeJq4HMfYZ6AHR2k\nb5hPOX9/7mdoLDQ0C8iEbCAiOsOgb659FpfGhfT88wL8xOhegBcfyMW9Da3+\nZRphCof3gNfzI+cvWcK5RGxDdbJeTXGSdqRevPMcwhiD+tFnVvWfUG4shu/f\naydC\r\n=EnuW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ce9530f33b3201edeacf335d23b15ddef3738193","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.3","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0-alpha.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.2.0-feature-ce9530-kl0vmct1_1613048849916_0.11016720205966668","host":"s3://npm-registry-packages"}},"2.3.0-feature-98b0cd-kl0ywvlg":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-98b0cd-kl0ywvlg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-98b0cd-kl0ywvlg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a51bb7423b17a84f19b010afe9f98ce7c0b4f2e8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-98b0cd-kl0ywvlg.tgz","fileCount":623,"integrity":"sha512-mplNKlsy2R4dACiQnkocMX2bQ/xvvK42etrnc/2DntSMagE1FyQAkZ3Xok6U017IXK1kpnepreswjyqqS7hGXw==","signatures":[{"sig":"MEUCIQCKGh2VW5CZu7Da8zMGclpDMAUDQ4BblrI5FyJ0zUMgKwIgG1SOlwPHRtRc91vTjabWxNiiryXECQXtBgr2zBgWV74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":703361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJUGxCRA9TVsSAnZWagAA3H4P/0xm5vgapyJbgXiOxHkP\nNpapAWRwLA8ZJXTFj3m2AqRdMxQSWzNJkXwDMc+NpjBRZLB+kTQXt02jdDmm\nHI/x1P+B4vkgYWGu+8dIsxoaWikfpd09X3BkbGg43aP013UhlVl7bAJr3UuJ\n5VyXvoxP+i4MpLNiIvq0iHbVGAiVozfczPOUL/ksmbxBRoJ68OtbRbQdb4Xi\nxFM/ElRY3EJp7CHXOHwuKYAQW5+YbmvpyF9Xcv7Or2Czj8HvziGYxKK/+kSJ\nBTJEh2OvMMzSVVurFUwcpvtE5vCmik+1yM/2wY0wk9aGV2dWgieqfN3CPk4m\nGS6bD1Wys2jNuDXiuVtV8e3+nst9pmdebIjfgKvmUXC2DQCPd3H7lp2oCZyo\n4XxicJ/2bBtFo3RQPI2TSGTKtdI8U056msrnv+juZoGADuK6W6XNBTeyYqTg\nQcbTzGMnJ5J7KnXL5L3NZn8+loYqca7OqSkhlg1szbCdKprAtF+PEElZ2Z5K\neiaL/QHowivrbQJQ4Po0xQfa7DN2oNjhXSOLo5VlkpYTzZdGR3dukSBcdij+\nNuwjltTpT01gk93FJF2lqnc4xwAmxl1n+gzImtu/h2zcuTcJcj9jPTUjlXks\nD6vPDNuQLA8J1jiPcZW1uoUwm9BskMYIC/9woG53f5gi5ClOExUSJcbkMiFq\nbTrb\r\n=TnpL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"98b0cd72e379ef391f177bf4a190f5f117b6ede7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-98b0cd-kl0ywvlg_1613054384472_0.9857704214484975","host":"s3://npm-registry-packages"}},"2.3.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a4bca9b7d7939032b1835502cf28340570a2ed45","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.2.tgz","fileCount":623,"integrity":"sha512-bUZg+FCn6UyQJ7bWdGDckxvyanh/hJlAXxfVGZBd3XQAgCcWJjTX08lQWg/khJNBzbtdBmvYKF716M4kzb0Zqg==","signatures":[{"sig":"MEYCIQDQCwMlNSr/MPpPaWkeHRSS3MrqQwXoj1bWSw3CkXvBBgIhAIui7kILFqAufGgcrMAkt6rUbkGtvqRU76mduyIKEYGF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":703345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJjiICRA9TVsSAnZWagAAkhYP/iYKauqZm7aNqI5jXX1X\nmSpE/N2ZQV7bUZfjXlofQBIFiXY2N0XZaieUKDDirb9ihPey3FqibYzkvzqT\nIj75WF5oDRdI7dpdBUztgJC/A1s7HLPTsnX/FmEyFZOu3a1HSXviMuvLvgDE\nZacLsx+QES8l0uG4Ev3o1cAnUTZUlZ4WC6QxGUG1Goe5raau8F4MRJ+/VtDz\nVj2iTU42DcFJxG3wy9em4uuAlNjITNjWQkrBBn/VZflEHek7bZugH46Hx/Lc\ngXEI5RCkUr2DNYnvme6zsMBJCSE09p8fzfnfViEDiRQfPiW/2W/sKSbFRogz\n0P0TT1o7Hn7iO2AGAxNfAUYRI1x83KjYaR+Tohg0Btqn+u8d5O40GX3nXpUZ\nGwtGKFGh+aMiWXegfs53wcpiCiV/uGArxeKv57yrSQPFlqvc/MlURPKo2aRv\n+gznk0akYVchurUgk4JuPRME9ItiTZt19/bwChsK94lOolInYhILumTBBtVf\nhnHTiOY4k3fAYVWpVkqlSagPM4sUOWR/BKZtIDFENps/apZLddIjXSXuw4HS\nZCikKnTJZEoWBZk/U4TqKiSiY4v8S3iL/IxlCV8AvneUuyBPMAran6gsJSf6\nvUb7N2F3cqpzXf1ELh8MN0IWbgxtyknSc6afyEpi0FUtB7+CzqYvEwM6Tikk\nN5/q\r\n=jMJN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7aa9f159e53a940881baac61738a317019e1c9a0","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.2_1613117576124_0.24321670800955797","host":"s3://npm-registry-packages"}},"2.3.0-feature-27d1a0-kl6g526r":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-27d1a0-kl6g526r","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-27d1a0-kl6g526r","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"26e89b255b9d0e84a88133c95b6dad6352369008","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-27d1a0-kl6g526r.tgz","fileCount":623,"integrity":"sha512-n6lH/l6ga1c5PMgMYoR64JaLeEheocp33ey42yFjzcAwk0oeMxKwF9US2aFwMONS0L+5PWQCRB3sb1QXd2M29Q==","signatures":[{"sig":"MEUCIGKkICXkRfMrAo0mUrG1o1I2h/D5U/8C8M5WOLohnoCXAiEAsQDoP74wmQx0pX9PA9cVYRwl83kWSME3g/UAYJXvLeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":712809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKk+sCRA9TVsSAnZWagAACtoP/2+zjZh68Iz+1o9w9iav\nEFmtxwVvsZ773oZ7Ms1HRebAA14DMhazjsXM18IHrfmkS3j1dpDRBekN7Y6n\nHRUG2kM12IoZ+LHW9sZvRgNoOc82T/qEVHHFAmuvkm6shI/hyRjV/iDN+CJr\nxpHt4VhE98zaCDKtJUqlgPpJuOMRibWu4tqXXGMtViSJ/Dwgs2moWQcs6FH4\nyNWKj7qAEDGQ4XCynPDTbm6F56PS4mNaVGqvyBPz414VPDfjjsmhF8xRaACA\nRMhjCH9b8d5Cwk6V2Otw+hAqe3Y+NDnfxyak8EsFuG83oZn4ZGNwjaatu1Fg\nf9aRrJHZSndxDBrw4jET+yrNaCfGgw6QPf/asfPTjuqz6+zUHB1rBRPI/yfk\nV06TiR6XmAnYRZbrMYn7Wsw0EVXMKGnbsrh4idWZIsMH/xXuvaWarF+/6MMd\nzmwqYLHLDmaIh5S26NDd/cSbddhvLjuNUWmyXKFKqPuoG3JoXC9JsX/QQEAE\ncSWgxo+lOL4qIR9eTRC7caC9VarY0bieZqh8/tKKzTktW5lJOmXhOlCzexXp\nqB2Ne65ueA//zDYEVv6pt3wOqEYVtte000sDXoMm/xcBzWuA36i1Kwpg1sr3\nfEr7f6oXMI0wBKFtW/mdPPcpcmVTKF11k4nHYikI+eRExcPJkkF8qq4TYfju\nTbkm\r\n=Whrw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"27d1a0201cf9ec7f50e2d1eeba637877463db95d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"3.1.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-27d1a0-kl6g526r_1613385644137_0.4901148497835377","host":"s3://npm-registry-packages"}},"2.3.0-feature-9be3ec-kl6gu0rm":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-9be3ec-kl6gu0rm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-9be3ec-kl6gu0rm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b0f9254ca8dde4930526da4e239fb719dbb02f1b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-9be3ec-kl6gu0rm.tgz","fileCount":623,"integrity":"sha512-SEPDmJAeOCy0jLMookoGlDm45CovqVBDIidN+EgEDCHNNqXxUE2lt+07KUNFLPCtsvsT7Zc+u4aGqe2KUr8kog==","signatures":[{"sig":"MEYCIQCCo6mJU3f5pIlDOnPHjjFVgyte3AGMAsa3XRlz0rgfEQIhALveCwpyumj5tsvISu+UqcWIE63Hql3g3GjcoOwVW91/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":712809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKlQ7CRA9TVsSAnZWagAAyfAP/j1mpMG/6c7jXsH2D0iA\nD47QM9bI7D8stifybNOPpT/nmk+SFLW92EvRqONJeak5vFp55bt732qE3MGd\nHSdzDgjrCSBOc6q1sQGZ5TRs94KsYxRr1bNvq2wtidHruwcPjQrhyYT+ylT2\nNkNbG6JLkBhkFRw3M2RarLodywvh61yIY2Q7NC908zA3kBBUz2g0Mgsf5VWl\n5rHBaHTq4X8pTI1+PuAQx9XgU4A+jlGScmixB64frsK+Q/WuhGxbACz9f5by\n6D9315ArhlQzbeQu60p0WW6t4SzJ5vlxT5DzfAKL2kwfXkunw4loEO6XTgHH\nU4lvJ8RZEyq1ouSVNjFEKEDJNXkHfoa0+4ayYBJRn4o449SwoxCghjg4f1G4\n8PmjO1QXFMWa31O8mkyGAyXb7vfDe1nC/UAMuERH7dA38VJi9wBQiBg7wUOQ\nTI/aTDOnLFKTbZ/cmis592TlXXtHmAMOqsc8LCX+q8/0WJwdDkN3035L31ky\noHGH62urZqGznd9Z7Z9l6ybUoFNjc5TB9KtcQmjw3SsuppF5nAKqG2VN2XAf\n3JUGGrATQ934o/6SQDZ+czhUcM4Md9txC4BLfngOGboQuDJJh9AuyoTXrXPi\nPdNjoUflsaqWDSc8mDx6SoKZgfxyHsTHd4SYRdL8NNWkW0natvomohk4n/oA\n6ztc\r\n=Hm5+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9be3ecee8b350376d6f95fae410f5e9e94ceb6fa","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-9be3ec-kl6gu0rm_1613386810401_0.9832198761161899","host":"s3://npm-registry-packages"}},"2.3.0-feature-f975d5-kl6i77pn":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-f975d5-kl6i77pn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-f975d5-kl6i77pn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"81b6536ceb2cb49ea66a570dc505456373bdbb93","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-f975d5-kl6i77pn.tgz","fileCount":623,"integrity":"sha512-OWdazqRscasgj7DiDs+Vx8nENNPDLy0k3LMdRF9BqcxGSpFhj6tnVNctr/A1Rgi1kOWR2/bm97Tyn+CxZc34WQ==","signatures":[{"sig":"MEQCIEldPR+YcSXL10zkJ9+3424e+C4kYZ+BivnWZc24R3XEAiAeGjuSAYjCc0Zwpr4x2UJ7m/o1HrN6oTRLU/Dx9QJPRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":713582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKl0yCRA9TVsSAnZWagAALPMP/3+m6r7pculuYN93rEI1\nSAF7nFm94pSj/+hk/QJMLfMi8S2ohEg3Nxj8hgukEsF8IgTTGe+rXGx4aOTn\nxDsi0o6mdUrdfJl9lrgTMGkR3lBgH1xXIxTpGyWQDp3Mu/+yFo7wIAaJockj\nIe+O2ViyZSlBjwsT0aqF4ryC/4E+VQrhWoW0Nzutoj97MGsBa7GyZp80bL9P\nc2Br7OYWllaIsdG2wh1eb4wNQ1u4nFFGIT8mcyMwqxmVIEkyaPc0ciGD9lP6\n5CDbcKPAb7thjPPjoFY7BqfJc/PhwssiM+d25tI07+q7+QGiAv/fCZj40NAx\nBD4/Wj6MbAVjP3IpYD+X64tNvC60YOaGSQBtIRu/zGh47FOhSnjXDDBRLTwi\nq2DlO60V7kYRTfBS9FIZeldyQi3M3qPvX8tzEFg+0V+YGa11L6MVYUmYQGSX\ngNReh079MgeU4rdfglwNiN1GP/wtPhNgAOmGNN3PLNR0JnR0doIoBKZF1LJE\nUUXPVY83N++hMmZKAMiyLG3TwqrfbhILo1ubWCSZhX3xSg1h7W/kp1eCLItD\niXufkZTnPHqwlQiMYvaueVXE/DjaLVmD3FSIUlCH00T0sM3kXHD04CXKIaiC\nGb2Bf1tJ67sTNILykUcceIue0U+qJIGczrcmdtI6E3Jls5jc9l7/Ygdn5vAu\nq/PH\r\n=qMhE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f975d5fe780f0633094da702344aa0f8e16f94d4","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-f975d5-kl6i77pn_1613389105769_0.3877540963740953","host":"s3://npm-registry-packages"}},"2.3.0-feature-96d790-kl6kxfkh":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-96d790-kl6kxfkh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-96d790-kl6kxfkh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c2762fa6d99389e3c00289f4ee91c370a197412f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-96d790-kl6kxfkh.tgz","fileCount":623,"integrity":"sha512-5GnAwl+4X2yjcp7OjrGHnijP2beRqDVUU2AvvZDyq4D9CZcERX8Ie18hYkU45605YFxevUkn7+OzKgal+TBUrQ==","signatures":[{"sig":"MEYCIQDyaU9rmbk1WAjt4LI4V/WUkvXNFD3rC4eUoiyDGoslEwIhANUmNkXxKdUnPKyp66Se3zpECPJsouUZpqpeXDX4s/sP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":712611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKm8TCRA9TVsSAnZWagAACfEP/3yh1HbA01HvQtK9JCm4\nBxp67Q6konrQQZe+ZgxwL0Mx1pJeFQUhKdtFgO5qHi6oS2P6//lP/PFeIeI2\n5P+6WfF0hrzMEDnL8kmmGZBh/5We8WDGcEzhOYaA8Z2WPyjWhFY+T93+JHir\nD/s8emU93XE21QZ0hsQYHX1n+p+rCPUfIcu2w+vZeul9+BxxLR/q78AeoUJR\nAttO+cit9900K4C8FlON40LCTz7eb3Ozt/u1ZFRYeGvfQKjXtLK3lL/C6Cgx\n/z0PwxssT+7XVsz4yFJor8Ee0d8Ixvb8711MjTq69O07EE9gB2M7zFndlRnk\nXX9ehWTmhvWlZfamlmauFk4l+AjQ6Tkzr4OucnRF/HoeBW/mT2sHTYHy639Y\nLWmHYQ1SndxjFhlnr1WF37qq0NtQB2Vx+UqD5+DBZ+LanOtxXoCj1sX8cpGk\nBbX9t8jmPdA8dy16KpfgfSOMnM86TGxjlzYpG5EGUkDZhjcziI9CchndZGWh\n3KimBJQSwvr446b/0lB6zvjE0O5gdl6deHdPzuOJCIXXZ4ETE4Jp6fp957ri\nGCbvy08wuud0zJRjaxeGeYVKxSeJfYZ4utlN+/sp6N5Ts0IjDWwsDWkfyiiL\nakhPCAQysS05NMHSd7S3QI0FKX6qp7g/8W2Uq4mzq2tXLtZRAOo0g8DitM9H\nXt+J\r\n=USJR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"96d790e4fea80ac7304cd0ca0a29b93eb1404981","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-96d790-kl6kxfkh_1613393682736_0.6343126406938082","host":"s3://npm-registry-packages"}},"2.3.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3b82e0e2d22f4b0c6222c079aff271a0819c803c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.3.tgz","fileCount":623,"integrity":"sha512-DIXrFSZpBO6x4/ciXd+iTBgTZh5wdtR6A3ya88mR8Epl1rqrZIHWXfJ6/Cqg2ZRHgXV3qKxz+LUFN7rZpM1hVg==","signatures":[{"sig":"MEUCIQDHHIRbw3xqrVps3KYGzj4xtDXDhEayJMVoyAygUtW3VgIgSom8HxKtbPiApdGBjqVO/N6gJwabDeqQ7hifmVD3gd4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":712595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKnhYCRA9TVsSAnZWagAA6bgQAJSIGQ9uF7q6lMlNuiJH\nIr9WMqVbaHevB5WS5AfbiesQEko5YihwccGWfU/Wpk8pM0Sle7f7Js96hle9\n0rOkoJDvUcCXgI4yehV+X/0Lh4kTZ2RM03+pDHYp2Y9xS98J9tivO8ukXvXa\nN9T6JXkvLkKmOBFJI1/6Q+0OFmVcW/NwkOdyY9s2ibl7WEUdGsihR4xdOaRX\nqbYT4eFoZK8ff5ZDWB9e2v4J9yHO5K7kWfQM0x8zMos3T1Xpf2lF1n0CP2S9\nNpz8lnWW1AWYsxesA/HluBMT3dyo35i3xNtLoXX2SwSS7WW1DVHrA0W8nVFJ\n21ykzY6eQpaX2BaaxGmywIX7SwX6g52sRPAJ4CcbLqUdSW1eiZoEWh67p5kx\nirc3c+W9GysuSUhU0ZYnUE+HCHMJCxn44O8kRBeh081mImOh2w8CRbfHq/hs\nNJa9J/o87so5RY92QgE/PZlgWXAZbmy5HXZIM7Zx/tH+V6fXeBb/K/3gkzfm\nSg9I3V+LQpGsEwOZtlWDqChHK5CMvEvMk7nc7MojfzqfFix2rld/u15M7Xv7\nDfPmawRCtovazu0JotOYj2WFeoI0sZnGsnUILjcoPKZIszDLLohYA5A32hKf\n1Y4lOadBpbkJt7Qd9iCWIB6I0s1Rich4lrbsEo8falhGywDS7oKo1N8IJ3PI\nx2Bj\r\n=4lTb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cad0cdd3f42867a2e6a1a0c41148aed1cfd55486","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.1.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.3_1613396056240_0.5697662312325742","host":"s3://npm-registry-packages"}},"2.3.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"78b70a511573d8f3f21b1241d1fdd47c137f1df1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-beta.1.tgz","fileCount":623,"integrity":"sha512-ExasQ0ZMAZMjGQSqtWBYLS1CzeqO8sGOmpdJIACMhuSLwSsL6xVAKvbWMPExG87l3tfEWtPdmRW+io0wY2+lIA==","signatures":[{"sig":"MEQCIA6myX4sREIkGk3ciPmjibBYWauF1lC3B//TmuIohOc8AiAsxceZzx++FF+sEg/nQMlVVfPPoa7IdG93KmxIOoGlcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":712601,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK/gkCRA9TVsSAnZWagAAyEMP/0BFv5jeQGy16KL5hWxf\ncoSnfoQl7YKwf9qP1BS0fteQRcdPzdU1kQit+ChNYZYXLf50BciXdd4NAecW\nmOjDAXr6o2BgJ2WMAyYhIBSwlgBlp4ktzkseAWUMFBHlb7eZtCunYA3IhxFl\najF2XXM1n1GJ1BqAc1dR4nXe1Z1oSg/aCUcV2pLfcJZ872tzu25efpl8TdwN\n9+VhHOLJMn1s8VnRH7GY5NW1HczNYgFYLSLxPRqC/3FHHd8uGM26EcQ7SblO\nupueqc1PKwJqpG3XyIn+G2fpiQdR62uKMMkEhbE3OH5XIZKlNBAg9Ts8BSza\nwZRKnQGFASHmm/w4Yp5FUuRvjWIeCPkPAF1LE5a5EpRI8bMGWfkAXckns32x\nY/AVRAKJcwylgOIf+SJz63dahXxRXg2RhTRzYABtoUz5QTZJpTN7Bzkipmiv\nJptHWLabuldtm79bGOmrrfBGkAjAJD4WjaeFyw1G8lBhL/kWKLI8uJsSIOUt\nH+u3X56lIwnimPrGRKWYk6HJIyqJMcNc4sWo2MSia00mSGs4JRdDYVOYHCt6\nTxzDmheIKol2++SNy7Rh2xv9e28LWxFfiONzf8KBmZxfiqSRF1QiYNcECcCj\nPxhBl/9zEOrBpct/gNYTYKfOhduXjWYDksKShfALNmEf717hG1O18ua2U1ne\nDIZQ\r\n=Njq3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5a137ba94c3645f4b1810e8aa51266080de860a3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-beta.1_1613494307943_0.5949722535330595","host":"s3://npm-registry-packages"}},"2.3.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6fb1d58f551f98a10c48475578f4a9d628d17059","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.4.tgz","fileCount":623,"integrity":"sha512-VQxb2Vqr6iUX/y2cFu9gUwNOfigesse1GR4Gfls3WDwbe8J9tCdQwm2G2ReO7+xs4PNgvAs0pfUeQic3dXN9wQ==","signatures":[{"sig":"MEQCIDIFfccFmuZ2P1yHzCynMDhUb25UI6PnoSK4LXGOcXBtAiA7QwClAp2NeMcKrEs8/EVWPvr/e4JHuGhdOb0JxOypwQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":712602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK/gyCRA9TVsSAnZWagAAmNEP/3BybH4KworJodPUyluX\npdu42tug9IW14V6zMsxsqFBxzMa/lfnCb5sYY8oMmxsI8WbhWx9mCMqA8ovs\nkdbEqURobBl2RRandlWkv9fzm1wW3CiR33EOijqMhBRbz+Ta9ztmIfBmSOoP\nsEew8XkzqPV+6iJW9iePNzrDaY+X7DW44peuhd/W9yXshc9LYqSrVlC5YX0j\nd1DqHxw4KHKCLDouf6Ye7szp5cjeWnGk+OnxlqTugJdZZd9Sy42mFxNnDs/p\nWuTveP30KAX3p2CnxFpSvNmkLKg+VXq6n7rz5fKCsAWgOdZc5ff8zGKVQbIq\nlmn5MSzy6BFqd6Zy52TVruX00Z3Qgr7h/HTOAzST+fQB9c6d9i8E1YwMxsCa\n66L/Y8UaNYS2top3UuOQ8fp3lzGTaKd3DmAqVfz4mpQfY/ZA9gncofeEU4eq\nN5gSyooXOCIy2QUvNq3mpaG5bJUG2/KSWbJo66expQ79ePu+5RXoMqwR6KJM\nhxmoFRFEuGDI7UfLpH6mUOeJ4d0BcXlSXhugGwfp0jhFxY4mJXME4246uQM/\nNgRE7kKAQ8unJG6QdMIHqGROwJCZG+qPwAZcwheoNvKw4oZQhaI/I6jc7cDn\nhIqsGTrfa7HyrJLrkK71kg8ctTUjoQWt1zWw7jBV3mDpe6uraxpSvd7z1Dp7\n/I73\r\n=u97l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9f6fbda873b5a1aaf6d374da33d5bbbfb06337e8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.10","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.4_1613494321707_0.5245447972915784","host":"s3://npm-registry-packages"}},"2.3.0-feature-9db248-klc3ebf4":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-9db248-klc3ebf4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-9db248-klc3ebf4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2959fbb7e789b8703c3dbec8d3f2a0654241426e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-9db248-klc3ebf4.tgz","fileCount":623,"integrity":"sha512-McYPWDuS9gt4I99v75xf8xvhCMm/xiDwKh0ZF3v4GjSxTDYKKuDbILLJ7kXFLJwM0QeKZb3W5LmFCVWdI7WncA==","signatures":[{"sig":"MEQCIHKM6ZPEBgAMWeC5qUKPR8rpvv9h9aUBaqplAQoWejnaAiAOAn45WdzpLy8MOttt9hJhcwGp9jPWwCIuiiD1Iq+HVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL4VACRA9TVsSAnZWagAA/k8P/iTznK0vryWD84oS1X0y\nPQQAsylPLbl9XQ7EFr73BvRMB275BVBogIILSOmpaMKbFkfJ5+WUWs8liQBj\nV3/GXzDCjbG9DyKn2X7KlikSKLTXna0SpY292LNfdrfIJflzl3XNXVIYwUJa\njh2kxSaazQzf09hRVdk7LaJRILqquupPStXaXpbCl0TvyTbXPNftwbBxZS96\niNEIsOfsWFSxWQUKrwbsa36Gyl+ifzouFMlYJBnswxVFRdXqaU5FRLiOlERW\nbHOBJVspl48PPHtmGFyxUzKUx3Cfg3csB8lYu1VpbAGybmTmsi5hvdgLOpBm\nfJq+ykRCASsbsp4ulU/VHGCQHgMDLrvQj6D9ErSCRXuILLjShX/+zOTP5PRo\nBuYcX7q+lzbCuskhUVR7DKb8Fl/NoQ92MKBBxY8skMkby9bHV8KSkDSPG6C5\n5IR/yu2X4PCWV9hh8hk4QcgfMSba9tbOunZw2VogNEATkZu0wysEF9W9RwPc\nc4DMQKl70WOCGPW2vKe+Rn4308zcwPr0Ca1sEtFCwAwY+41nwnBJrq2y5zIH\n9ptr8F8E5sel4NSalDg1vYoItDQNErE92RjOzOfDfPHEB/q0JaoTyTCGSNDw\nTilv+OvJF0/zW8xDTRLFeT+zm/UL6yBZCLcMoqt7rBghnZfjh3B7fhikci4U\nRf4/\r\n=U5J0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9db2488586c827bf6ab2c3a1b192d0eea4f88d12","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-9db248-klc3ebf4_1613727039566_0.035920585965167895","host":"s3://npm-registry-packages"}},"2.3.0-feature-911f88-klc4dpaf":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-911f88-klc4dpaf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-911f88-klc4dpaf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7d1c1139ba4ffcb48048c6d90d89e1907785cdd6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-911f88-klc4dpaf.tgz","fileCount":623,"integrity":"sha512-Ig6RzPJIMBX0SWib30Dk+QD4GZ+hOZV5sJeGTgDll2LAFN1RKNO0IFaQOnQixZSlngYBxJHAMEsTX3r98SdjKg==","signatures":[{"sig":"MEUCIQDveEJrmUIOcWX+xBiqVtsSAP1lJN/xpsV4NiCJdt6eWgIgGqsErjo7h9cUie0F78t6/Ls0EqVMB/u6ikHCxleV72M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":717196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL4uwCRA9TVsSAnZWagAAwjUP/25RMMy1uogk+mhPysQZ\nAHsvexsuF9/TbbLB5FwTWBI3yCF/fHYKFWLHLTqMe4/pMYNsBEIVEKQ9fS3O\nEWPTazP2XlzhHlJVsc2GbY6aW+xokNJ4ftuwarVJDz+YU+XNYc0Gru0/AGrU\n95c2T7q0Dm9/3ljb2etFANvxN5JhtaqJINh20BC5y1NzezM3rbqK1VKFWevl\nNj620YY7cNwUmyKGK72Wdvh+QZjCQjtgv3IMLuFnVCf+ciJqrJwnaO/8+ZQ/\nPrGJbyWgcGqX6tjupNv6b8qi4ZRUVnURHopUkNqHIwMk6w2+uUYcfV8Nl/4F\nrKMZiP4Y/Lm4JnL498QtyKWA1iuAZqltyJiQSXtqgtCBM1iPEs4sU2H1mfly\nSbgIbVsHxOiGJ1vniWsVDgdqVzPMdLZfFjlQcx1JDgwD2X6QTBIReDdzgIZ9\nh59BZrZ9ePB13mD3Ex6fdRLrmrySpnOwVMSMMnzR6mcqG+mwkL5h7PyAEkFH\noki2I4UaFBcFywAjUXrRFl8Z7gpqBZKPaaW1TJlaf78hdzNjs5Sn/hH1KGRT\nINiUX559YC9FW4rwPwliLL7zytjOPaujtM6ivgDf6ayKaCn/XXO7nRSoQR/U\n3DXsbHt8OmI5MOIyaJ0ZFKrnahhaavn66IXUr5tzmRuI49R+Vc8KJWYmHY7S\nQ5Ud\r\n=ggOV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"911f88858cb259801f562dd0ba1153116db68787","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-911f88-klc4dpaf_1613728688291_0.16749533798150207","host":"s3://npm-registry-packages"}},"2.3.0-feature-9926f4-klgahizi":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-9926f4-klgahizi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-9926f4-klgahizi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"056fcbc0e299e6bb6115b8eed2e3daec04d087a5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-9926f4-klgahizi.tgz","fileCount":628,"integrity":"sha512-9/mSerO8T+lGGlA0FnBFQdMF3iRr57WqnQO43I89I+HCX544PAL/N8KoSCuBDa8G3esn4GilzVMmTQ1YE+5FPQ==","signatures":[{"sig":"MEQCIFPmXjDzALGOEnpgBbk1NiTJriUCatmpOCPMejHVYt+DAiBFxV0RfSh9g2Jp2xBP5f9f9070xz2GdR1CE3CES+t4Ig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":733182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM2SPCRA9TVsSAnZWagAA120P/ifiNFELeHTO45jT0bOu\nfq6cHnU3UILAgIqheg/SLXMG1aR4d06VNF8LuCPS4KI+KSI3eghNEy4FR1Tf\nYdLNDeAoUZ0C0kTic8XI0sd17Z2AAqNVIfU+iVPbpXDMHBnqdB2Wkxpnc/Po\n5Tx5phBFOasofvq7qqsnQqoKzhW+mEgbu1uf8H4MmuREFZcEw95Gm+vWMgxo\ncpoTLh03kUta8PYhCp4Im1wjTVDbqd8A7PxXJm8LpQIab+G54jSsbUjVCh7U\noSt7VxHTGHl5hLxs8xTul4Dl0a4XLDV/ZMrTCjLhMHMd9zeA7he83JVDbUn6\n7hOBjbIHsRkkWEK4JiIPlE9LDjCP4ChRC2NbUfY/+OFkNl7JQrhTDjpRWrUS\nZXfnOdWAkWjUJhrChUmjT5VKqRVslKPvQmfky5+Sskgaj3g5slO+hNWBEL47\n78z3w1bYos0qBBlSx2yp4kBEPXkZsPdGzMqay6/UujxsdSieThsf1jznFkiU\nGuA58XrA8sk2faZ5o2UG9lTWco712yBUErWic9pgrXU0Vgimt6+LE2lGfWxZ\nlEobNlxmdmseUexadQw4HFSAMKrI+xDEhP08Y3VrTygavhjApjeKcEagHO1M\nZVsDTULa66dCWgLjFK+sbcVvIjmFUVRhMe1qYvmznAY7gSH/RNTmXegERVs1\nt3rY\r\n=wKPb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9926f493686e573ae0735867c5a7b5cb34afda27","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-9926f4-klgahizi_1613980814664_0.28193640392521746","host":"s3://npm-registry-packages"}},"2.3.0-feature-ce5c7c-klgb10fk":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-ce5c7c-klgb10fk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-ce5c7c-klgb10fk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cb43b7cf7606164131847e526983f74c7d2803ae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-ce5c7c-klgb10fk.tgz","fileCount":628,"integrity":"sha512-YvlSWrYZlnvbz9QzKO28grwwTurBhp0F+xuP1nhQiRUZ3GfbeMyejgDmOeJP6K/EWh0AZgpLjDKnF87M91uU4g==","signatures":[{"sig":"MEUCIHWGF7g7dd0pVEz+xTP3gZRe7xXdFMM5DCvkC7s/HP7sAiEAtlB3ODi+H0wohHxijpOULBP6evuF+IcuxssX6qu2TOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":732436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM2gaCRA9TVsSAnZWagAAfoMQAJvsEXZKbDDDAnMaLYkX\nWU+rFTUiwMUwMBogVxXmTqs4Jn4JOKJvFP9cyjAM+8st5ZQ9INmbWL1tGI8A\nraShLwHmfAs5Qk6JyruEImyoesGQM0N54FEVsKKdViiP27GglZJAHf1GmwRO\n8SllvzR8yQ0VY5/J6CwMdQr7/0E1S+kiDUlAjIc495Y3yxyywjXUU9gFenBt\nCSMECPVCBw1lX3KWA40YLip1ujtIDXDGg635qXR7+86PG63+4x8m2l6paxrD\ntBVIBeDHa346m7gPN3zHgZmxIIBnWkFtVnAabyu6txansPG5PXepFU5uHnAa\npYIkIzZn4VZrWWjToFo7Yt37oy3xhxzy71TIZzh3oWP726t/wHPHST+batfK\nkTEyHJkuRfNdbBWHxx/sGoQiBIzlfWTZNW+VPbD4LLWvLKnDbd9kLFNU6Qq4\n/DutB9pXawJraA2dWJR5yI4VWtRCuDa3f+GXJHnBIf21GoVarjGDRgxwzpO1\npluJzpD3nI+RqdD6oc61Pvvnftqt9eQljViJJRLM+Yg6S1OSe9GEuyeHEkri\nZuf3QZuUDmdpHKMO9UyyjOWDj2LZyv82F47rjtX3EVbCclk1c7AUFOFUo5f9\nZKHXfRHfoqAUHQYcHIaqqPT5cEXkn00+6ok7FvTu3jWHZYmZBh1ceYLhYHYs\n28TY\r\n=FSEF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ce5c7c33a9993605c9291c224ed687add3499ff9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-ce5c7c-klgb10fk_1613981721548_0.18704729073099746","host":"s3://npm-registry-packages"}},"2.3.0-feature-6ffe60-klgcq1gl":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-6ffe60-klgcq1gl","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-6ffe60-klgcq1gl","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2eebd424de2b44f131370a7f681f47779ce1f6e3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-6ffe60-klgcq1gl.tgz","fileCount":623,"integrity":"sha512-cVMmTRkvYLPhSoVDdY3Uuf2xL9A6YGd0cHaTW0g3LQhR9+TQJKitIeF5LQsb/BpmisHbMrQWJGampQct+BSX5A==","signatures":[{"sig":"MEQCIEdCdc0qBKlJyTOf34SXUVt/D1D/BDtXF2wzESaWJR4dAiAZqJc+5RjDT5rhQWxA8ezly2wMNZNo9zzE/IEt7YxR3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM3M3CRA9TVsSAnZWagAAWlgQAIV1XfqH1gGtoLcCaz9w\nT3Z3J3C1b4nWOjOaHwv9yDjfhUrhzrQHP2gGBC8iXHcyisdJhSMQdDDSB1mN\nDf3EJuMG7ly9tNw8v7f7/NU6apoFeeMWq4yeJ1KgsRXivowfxzBHg1ak88nQ\nF0CWPHXzAdN+oI2s8KAyWhtzIVkU3ySh7BfuvyZaYntG6ITzTx6n8OAhaUdc\nYWVPVlEvg6q/17ZuzM+k26JVEeEJgXRsOfh7rExqaNgNm5IFxYf5imralzEl\nOQ7ncuODshcI2op5ob9twrhA9BqfKJwKlNPMckSfDWWcG1dJ5P09HCnexFN4\n2/Pc+YO9LFkskw5Lz0kHTTtlgyQHWvyCmB3qK7HA9CqmOX7mMRqARBTSKJ+A\n+p23D+jTtLj/Q3hEQsMEz7hctCxhUc/xr32OmiugZKdvQtee7EfgLdPahIJi\naLE+Trp8OoyyKZE+ULSMWhVUeBbmrEL3xsgwFZw06Y0UCxU+jw/kFcOtlkdu\nPaGlA50CVj599Fab+7bV2hb8G2x69fNBE8uregKICir8WfG6pvXGTTlVilkq\nqHN3EHStah9mRoZVZbgrZCHA+XjbdgttfejAUnere+5MosSpi4BpV85vaur5\nIAhyKmwEoGRphH0bYRzhq81QB6spB4OeD2s0j9GruAUSaXebZV4aWsKkgRZ7\nx3fc\r\n=d9kz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6ffe605991d7a72c4d516b10805bec42a04cb0ae","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-6ffe60-klgcq1gl_1613984566672_0.08103964035844902","host":"s3://npm-registry-packages"}},"2.3.0-feature-dd3f31-klgcrl7y":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-dd3f31-klgcrl7y","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-dd3f31-klgcrl7y","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"eb895ecf0c18ef55aa70491f4b8101ad26858a38","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-dd3f31-klgcrl7y.tgz","fileCount":623,"integrity":"sha512-TWBxCffvgYhTVKP0D6PO4FL3cc+dqCkf4P0TLyHi4BWFE10h5r6dcylgFxQfsXi3stLycqXMwWefjfE/3paXaQ==","signatures":[{"sig":"MEUCIQD8ygrmpLhZOiKXQryFQwLoECDG7sGh3Ej0YaipCxWr1wIgVVTexL6L88kF/soaqPo1t0sYK9Sbq9C1/ij58Awa5VM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM3N9CRA9TVsSAnZWagAAKxcP/0YqgR6CjpZULJm+zPUL\nx8CIyQIarFb/WEKfa5wJs7HUjsqc/+GSnY1EiaKKqv6gXzoui2p+tOaSMW59\nTUk+ZmSvf1Qe3xkEQXtsIUqfQM6W8pr38FtruXG/bc30/uDZYIg+bwpzHiDx\nmUH+1vbLRMVbdMARjiZUCnuw89AtBCI5lL+AM0tSgp+sNYbfL17FNH7dtdEk\n8pSWw6KgN1j0pVfLz9rcnfVH2Lxvl08ggMU7UbfMcNI8y+7LkwyRhC21Da3s\nABgn4wiHQ46/CAP9FjuMiZ0ZfMmuYYG3IoadgLF2i1pNlf7ToC/eo5zmHD8p\nf/TnRgrZwnayX11KUIZ6LYCUhtPAIs6x33E/mFryzuJvSqSB5tBbdQFNU0G4\nC2qxBMCp3QnNgBtHm5lU3i0nGQduxkhBMIni07ajDytgePVBfbSOKi1XWcOb\n/a+jahlCMtt1gVzW2J04aC0niusBZS746yZlOW6Cm92pJnpKwEK+Le0c74B8\n9sfSvYe+NiFKSiH2d1lqr1tRQWpSOuh2Nmwrj3wj1vd3M2knf/OStfFH3o9X\nqkmf1Vi9TksysKdrH8HpfYLFgAjZN6fQk5sYycZLGdrwi5bsWp5bhb+xsDls\nxbM5x5h81NkA7NSvG6BJ7hiOIy0q7IyjfTmTd3OMf+epq3cXMiKYMY7yPQUm\n0Big\r\n=e+fj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dd3f3122260e1f0f8ab899b98d5e09d9b2ccd661","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-dd3f31-klgcrl7y_1613984637072_0.21508721720954793","host":"s3://npm-registry-packages"}},"2.3.0-feature-9003dd-klgcs0ev":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-9003dd-klgcs0ev","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-9003dd-klgcs0ev","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dd84e158e2bad181a9cfc796a9be4a28f1727a19","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-9003dd-klgcs0ev.tgz","fileCount":623,"integrity":"sha512-KHkg9IZJi4qj7vtC3E4SSZeU1Igcs2Nzw6PFAHt+anvJBbvwJ+kTX2NWzrGfaL1lgchlM4tM2cd7TF56I5lj2g==","signatures":[{"sig":"MEYCIQD/FG9s7qGaND0PA7JhVyeR80xmxgi+eq2VYoJcoDqwvAIhAKCnBV/wzkM3+CIjOB6ofWps+u5RRX9ZneQJZTyHC6+k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM3OTCRA9TVsSAnZWagAAqE8QAKCNJmvgJjxROtdKYEXq\nwr+AzytB/HpBEa2FxvsM+LsJPDJ1ZzB33zm2vmSIXt0uAQ5GJxLi0TWlNo4h\nD4biNDAruBbvUT/Uy7lZmhYsDSY2+sT+VYFreXhPVrQudp+QWaXD9i2zvHJQ\nQLsyHEVcTvSfTkw6M8Kdc5ov26R4X8pEkJKSeU+Yz/1B/JucAtokLLGgl+Kw\nVVHfVcQUqy+jeaNfvOnWkycpU2aGvCHCB5K06iFgo5Esy+OfcrQHlzKJ8Vyv\nn6xiO4Iu53uiFVYoAkUi5NVeTVAtPO7vyoZ8F81FJ7jGTZ7OPmhUgobwNSfh\nZz6Do1rbbl/7F/qnfZKDA38SufsXPu+OITd6gxYoH2kVJToYaEYP7sPNkznd\nkSYW4Kz/V7jRlCLX0cQ36EEGeJRUnjBLRWoLdZWatfwauuzEUI6y6vPmmc5q\nF7so4FkkqEcEcldRImRogBBYGGmPf+3UdgrJZx1XlqDNrLeLX1zFYWQqPD2o\n2PDrC53kHFUVELwVXIQCnCKsGgKIibVBpks0Ya5Ht1tco5fhw+QvXguMqQ1e\ngzYZy5SSI07VVwo7olaOmbUG6pr/e4El8R6RMn8bPFJWeSFdSDtjaUuUE6Dp\nUYjoX46I9TPVw+TBsIXlYykXlmCDXPLXzWv4/VnfycVl+tvZ5r34os1LB6xy\n8YyP\r\n=MEZx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9003dd6de41c56f4cdda4546d00404ce079854f8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-9003dd-klgcs0ev_1613984659288_0.8753959370660693","host":"s3://npm-registry-packages"}},"2.3.0-feature-272620-klgctuue":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-272620-klgctuue","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-272620-klgctuue","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7d71d352f3a87a5ac1eefcef9593526ec0767bcd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-272620-klgctuue.tgz","fileCount":623,"integrity":"sha512-BjynOK8aYjYbrL0yv3fAqKyQU8K96enZG78xdCVnmXTNO8fEGEVtAT6tbiu0OcI/shsYnHvEfaptDgSHkDa90Q==","signatures":[{"sig":"MEUCIFMu7RSWDC7VjCQ5GAcWsoAtXh4p0qAju9+io6w7bUCYAiEAqvPgruLYQpT8PyRFR+MR7leglEDUrJxpLQVj7CRXnlU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":716749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM3PuCRA9TVsSAnZWagAADFMP/2sfs6yzUUMHt/oDGgRR\nK+5isvN/nFY1rya6qiAldEU8ho2kv0JeW8Tc+Q1KSR06iU7Qp/gqM5bEQLxL\nDcaXfNu26v7RO4iGiMqPsIFXWvAHpjXJ+wVbs8tjSvU0rKu3DsQ8nrZEwUra\n5qYI/wIyXfLm3T2T1U1yWkmHmzRazn/xjoVXPO/SWxSyk7XwDxz2v/WSUe+Q\n0SjsSSpYkJ3anEtup7CWRf0Wttntshvm2/4s6sMtwQQRKT9UJvbPh5q7u3ih\nizMjU+zOLms8bV+zvO/2zO6ikIXhm5p6xrKNmuNB9MYfj7F4BetKVcnUKMcP\nCH4INEANLnRwMSMGcJdPjP3P2uGW4fdu9sZWqeLF3z78EHOHTPulENtXDLPO\nyOrxnOX68YSCNHIwBI8lP+esLECgQTa8215cHBMqwLE2s+9IcQnEKt+sQdNC\nZhWSA+UklPlbFNje93uEafVDiB+4V64n0LYMS63PbaBzH04YypnqFDvqCWQ5\n46Bxuld8zmaDuBx+oYdrRBivc7HdMJdIMo964IUTNIpJRm3GDc9FXuNtF6WR\nDpXipeddtXb7If8aMACHj9teByaiqgaghVXSlF229hH6fK7VpKzkqKYlg2L7\n60NuqCDhJxqriFS9xv9XnrpPGmyQKonLNPTwfrK2E9/ajqRGdyNrDK0Y6YKH\nFGH8\r\n=NDYQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"272620d8361d2225e4f42415a8a5ce41b40787cf","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-272620-klgctuue_1613984750240_0.01682770831176117","host":"s3://npm-registry-packages"}},"2.3.0-feature-3b4e72-klgj3tyt":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-3b4e72-klgj3tyt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-3b4e72-klgj3tyt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d469b3e6c835a8bb99db30732fc90dae3973d87e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-3b4e72-klgj3tyt.tgz","fileCount":623,"integrity":"sha512-MZvkp86LgHyhSfwy/2gIulDkEQMfIz+YMVi4njt8nacumrKt7EDG45Kk4MCJgK/B+v1IsBlUT4WUAOCjuCwHtw==","signatures":[{"sig":"MEUCIQCBO4mKVKcvVJVW84TN/pRXitgOa7oaJI9tVjq/bRgpKAIgNpZmHnM88wqhjJCTNFLZ9QhDGasMPtdwjSpObmDvwH4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":715530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM50bCRA9TVsSAnZWagAA46sQAIYqJHJNE7IvxgO0WfKt\nS+HMsfv2R9QqXT1PNQEYuNcKjUWykAGyQmwxifcSL06TQEVPhr/A1AUNhYNM\nig6iRZfYnlmFLnGdkwynSOmovO41NWs0KwnusIh5V3sA2U/w9Ds8pkITaM/8\nXahqM0VvvsSj3DfbtggyD5Se2EJZ9w51J+lrEmTWDIuqc8xILxN9YwqQtNgJ\nAy+3W416xR81Bb7u+WW7AumhoXjlJ/XeHisGEJ9cU/UnWhY0YjzzeCcPEzFN\nxJPYpLRXu6krzcDZv/2nSoIH4bMDnbt8YSM2OYqDjm0PaL7l7qSAlbQgfIOi\niHVMOsI8IVWC6r6w9+i7f5lKWZG6X361jxCadxGRO6xUCG2s6Jj20HByhqAC\na3yjxnc0iR8lHpjOvGtWLQfSOIDhI7xgIXQUw1JUseT6dUY++y9jmoVq7Brr\nOITOHFwKDTHU4KF8GHqWJbSSh5SHz+Y2DlGUklNtDUCXeyQwycRwBcyf//nz\nj+dgtg6Mrf0sII9HT0HwHgGmpvQu31bhm2Y4Uvd+BSjGRoUcxD/WrkxQpXeS\n25Ubht7as9hO4swsPIzQo40nX1jX02LdRVqe+Tj2JT8YC5IBiyAKTYRiB0s2\n79xMuGuEZMXfAkr55E+FP1zXdWc09k04YycPRvYPMj6uxFzZ+CBNwpYir11y\nUYuD\r\n=NUsU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3b4e72e0df57fd91dea19880644a1343e8498fec","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/http_client":"1.1.2","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-3b4e72-klgj3tyt_1613995290992_0.878470869944425","host":"s3://npm-registry-packages"}},"2.3.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5702749aa167b1bb9d83e170b09df4ee44058af5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.5.tgz","fileCount":628,"integrity":"sha512-ktaUyT3f7LAKow71ziIVpfIDhy4t7CVpjiBlINqInkygkHU7AexIW4MERYO+2GQMPAcix3nEo1AkDqBYPHOYBA==","signatures":[{"sig":"MEYCIQDnD9apUoQ26VpoKLfeL4K+ADVmGtFlac42fHUiT7sdxgIhAK0AeT4/a0mjWz1iRPG75ExLHLAUyP5/m5RbBAuIUm3z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":732420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM7JQCRA9TVsSAnZWagAAVrcQAJghBKURqpxmg2PI3F8y\nIeNomt1oZMiitzE7NzGjg4KcSfBvd+6vPlaQJzkc0ku7kquzQ8UaorfGo/rI\nh96IRIhFbyQ2MSXuL/5Rmb+PvxfiBYnOHttwqqQhDSW76ivvgsugg47McTOy\n/e2g2siA0mlV23BiJmY7lZM5WXsJJgPGwDkaQbwooPsfj0BRwCgdAydy/lW+\nmiV87FsWgviFFqA6H2G0XNrqKJkkhz0cFzkmxjvtR7ABtyPhoBDFjc9iVIw2\nlCo6DMkCCdlsgRRW4X/CX2uEE0rXg9mXnAtJigcD6dgJqSpZJ6SGnb9hadCb\nuQQ8ZVeKfcgqh7w81+ScjgarhfUnjpHMlWSVlNYKjgVPMzd2n69+41JKMsII\nmnoIUCtTNZNYDHiPhQlVKm4uV+CQlPViZLr0EEX4O6mmASrsGFRJbsq9jNp4\naTUW7yhTcc3a9GfrfYqViVVPdsZcS3Zg+pLqStmNizJM3DZY5wBtrSsMGBeA\nnUyt5vWGHRjL5JLDc8/Pbv3fNmTHzIh0lRWzrh3SVLDg2Xh6956SRYJ2v57p\nSzSb5Iq8yO4w3wdKietKa2VZeW57VF1GXrT21Kif8fBSbiCQMBhe94TvYEAw\nHHKgbxbgv5fEY/aVD5opOLHhCJtZoND/Hwxl73slLCGsEPJM0OuOc6IPPb8J\n7Isi\r\n=mGRE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"890dc999db2b5ddc3e63f99b84f06a701031ea7c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.5_1614000720009_0.3692855241848796","host":"s3://npm-registry-packages"}},"2.3.0-feature-8d02ef-klhrc2pj":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-8d02ef-klhrc2pj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-8d02ef-klhrc2pj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"403805188727421feaa4827ea02e54b91bf26229","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-8d02ef-klhrc2pj.tgz","fileCount":628,"integrity":"sha512-24jTtLrCBa3lWoPoRqGl533o+rCeABz4Bzp2kxmP2Ljlo4xCJEpXqQdzrEiDEogEezlxF9EsHmP9d3iw7X4SnA==","signatures":[{"sig":"MEYCIQDB+gNjf//XMOypWI7V4IXCvJAGUvr+SXxkyEYGFqB2jwIhALuToSI4szX7bu11Ti3xMwkoyomZ5UcdHL+j3cYzJkz9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":732436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNL9KCRA9TVsSAnZWagAAYZkQAJPmQNWsjbIg+G+3h0BJ\nqhmWe9I1HK2LiwaHz/aU9Vl+BpuN2AB+Q+/7d8XaFzpr5AI4aSz1V/B5mR6g\nqhCnHTgylOOtX5zzmt9B9wPCQGhT3uRqZtXeKLBuwAtylct5ZSAUSpwC/qSN\ni4ZCqGaM9N7jh7d8RI3GmSH26hToLU9pPM7JdL6pspGLAp6AVjzo2/dsfcoD\n0LNzfVTVNUXP564OmU0djHJqQDVQdKpyw2SgMJwUAY1VEEkI4UjDyHXtirUk\npMmCIEOFkCTdqXgGopgr0+L1KwU2B8MOjnEYFuYxb8D4HzaSR5wTMe4Q7chZ\nNVsnvvrZQlydSnQP1J5Tzft03mBuMuM72HGkHXynZMpDNMZ0MNXL63bLv48j\nH0p9lN2j+7EcC72QGGaD7xKqBVk26ffXb+E3IA0HN2O+XAdxm4vbZrfuwYRu\niGQckhiAkLl1fs5ZHIyUcIwmgU9UR1uAsZHSg8t1EsIbyb1zatBnmk8ziQ1/\nUV/d0efXLynk0sL2Ov4ssTaJBBMXhGo1d7i+Pa0Z4fbS+ZifK1UGniN6TzuP\n6/o5hRBAylHU/PhMZ7sOQGJ1aJ4xNefMyO7pcEshVHq9UcD3Mwgek5Ob6cst\nGyu85mDtLMVvnFKflgkuzqUbKz0S1qlp6KigwW2maaEQopNiGp3PEHKKl530\nuQR8\r\n=S1lr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8d02ef5f4301c1e51f3dc66e279c7075369b51bf","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-8d02ef-klhrc2pj_1614069577681_0.2244061054980655","host":"s3://npm-registry-packages"}},"2.3.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"486214177b2fe8131901713f72e03f6418e7cad8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.6.tgz","fileCount":628,"integrity":"sha512-/327gUJOHeAU5OYBYsYWSLO18ZUZHZ4Gn/2fzAK0BomsUa/u6XulNN4ao4ZZJOm1q/6frmX3qibkl7HAn9vCvQ==","signatures":[{"sig":"MEQCIEXq+Sk2Ewpq3XIa0DWrg9H+KHy5XSA62z6tiE8VKJ1kAiAckCv+69aAEmTDh6XIeJTPjdW3HxDd0xAzB1rMfZzuhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNNNxCRA9TVsSAnZWagAAteMP/09edWtSmdk1epWcdGlQ\nKXgULo7IaU90kZu4aq0APQUNw0cEfzkARrqA0kRxZbFWLh8z3INQBVh/BXWr\n1Sp41bP65qa1NSvLWtdvkAx6xFtKWC/YPQfUAG5Y1wfF+HKHaGd3Fs+VGlBr\nmnwNfOY1stR/3z2G2bVU/7Hx+9ENHLfbgOLJjgUHde1FZ2L6cXE7ZH04se+6\nlbKZYWi6Xx79qFLc7buG/x8/Ua7uZa35+/k5pOKGfXgd7M+NloDv/RnmRFL4\nJJ03TYCAvqOmXVrbY0uCiI0hBbXx/bX1ZjnN0oh+k9y1sEnm+V5o2gEIe7xx\nOGW86LRVJCDROiba7yMO0Wmm+eGsVrG64XNmu4xNfTn904gt3k5oumlTdaxu\nSA5t+OkDAaCHHbBwbVk2dNNjVKm1B1eDqmzi7p5Uhp4AfYtUWqRk9f2w7oki\n1ee7R/kukfXcVAmIgtfW5j3wiPq0UvUsfnPj0Vb89TZyVHO2om+P53z5c7Cs\n1h64b7+LIyqOYivZlxC/t+mPYqH/QH/K9XsllYbGlZpTelQJAzMaHqmcfzHc\ncdrGUgm1qnlZC32qIzamHXiAip5jEAqiiR2X3HW3t8Jbwuk89T5swXi63Ttu\nncH44f1H0z7iFouSpFUpgQ9+NgjxlmZW1lRBUv5Na/3/aoe2EtYECVpNm9Aj\nEq9k\r\n=ol9P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3052562b30e5b85e185ed3bfe01c5f0babb5ed3a","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.6_1614074736559_0.9224743599815655","host":"s3://npm-registry-packages"}},"2.3.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6075ef4874d90a11794dde0c8bee3fc1cb7faf92","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.7.tgz","fileCount":628,"integrity":"sha512-SAoQph9RqbfcdZyoQcIgH3DPvDlTRsfLm7J9O/12Yc/v8XnoioSPvzI9x4uZw7SqEVrlyMjXBYN06Q4lrANhpQ==","signatures":[{"sig":"MEQCIAIjtGCWgle5KfsDRbsN2gw7HDf56QvkMt2yJI26gzTuAiB2ODsEHRGLAwrJcis3DfPGTwbohzXjrvyQCod9H8EpxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNQF1CRA9TVsSAnZWagAAvGIQAIHMd4Py68LmH54BJ/M5\nsKBdQy/4VY3kPE88Gls6CwW3TiSnTtrFCOHL1YHd7vlQ1yAaJYmOAwg2JiJ3\nsfVR7aTB/kZgb1w9jhH9uehIwbd2jUKN0dArt8OKCtJoa/bTNs6XnPo3iqFh\nD/lncXGt0ZXjkRQhy2V2syaa8j+r9uxckSZPRpKsyu1lTjmU/GzGr+8WoIje\nPgZMoPbuZYfKGECtdvh5mLoK9VclCibL+Neb3EsjK7NpLRv01Qn2ja6qlo1K\nCs6zwOXqwMWomFY6zb1N3iwypALpqQdig4+2RLd+EAlfalwPxOYGI0h0sNL7\ngo6Z2MNVQ+dSw2guUVimX6Ea6srcOlEEL9n6K7JzADrkCwNZhrhVdjatS/c2\nWnuQTFaCn0SvkbzEnBSN5I/o2aueYTM2bDFqtGv47qnE9SfYSQONiXhccR+9\nhQ4sYdZw7I25MEMR35bTSfg7uXYRuLDRqSNqTx/81gvpxgnviWuzWI7ENpUJ\nANLR+2AYOtYQLMsgYxaDBeBbTdqigP52RGOICdiH5lsXvC8CNawAqKUk4NXb\npmE8Zp8UoUJXuJ1T2A9WU+SLL/jNqIOUFQGIeddxBma3X5dAW9Bk7zTn4v2S\nvX0HH/8DCC5J3l87UkDHi0dmQMTVrajbbA1CS7GGV/GVt97LIkmqIQUGOeyF\nqjUr\r\n=dlRT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bdc2bc3acdb9f4496458e729e5359ca9a42c2592","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.7_1614086516517_0.7829687230379203","host":"s3://npm-registry-packages"}},"2.3.0-feature-fc343d-klj86w87":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-fc343d-klj86w87","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-fc343d-klj86w87","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f96b135284949da16e8e09dc98ad27a5559a7455","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-fc343d-klj86w87.tgz","fileCount":628,"integrity":"sha512-2Gy+i3yuQZPDUXmuV2FJXD6w/pp9ZWUwFqNFZ6OrRWiedaDfkufI0QsFQ+5Kdek0Nu+kEQXVFMuw5t24b3nTfw==","signatures":[{"sig":"MEQCIFw9fjktPf5B5LvCWpq3k2ztJ0JXlJSKRlhIdpaH/PFFAiABZbfXI57F5wyft2nbuOgzMenbi1suA5B8u8EBSOMaNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735358,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNhoPCRA9TVsSAnZWagAAj9AP/05QzfG50wHs9ir8rE58\nzX7AzhtgiNod0w1ZjoVlkz/M8gjdpGpj9mFqYvqKsUNgt+NUKkelbjIy2fpo\nJb8uRaNK2qmCOgqv1wjtpQDI6tIXqq0cB3xfGTT+e0an6hXDn5tf8g70ZK7W\njKnAefnDME6tGCrBT+721GZHvTsD355Kw1cD6HyCWOdOBRVAgOK5RQh8l2is\npPZh9WOICutxvLFa1rjepjkpNVvKiSy/3mvG9kZ1Pw1pyNUa/BtXJV6X2s+h\n9NyYw6opERmqA+HwOwVRhlRAObVXjLi2MGdwm8SnCjn8hSeJD7cXLULdVPI1\neUMHSyAOY3D5mKE4V8YhijDKtXz7rmFidQeWBCgmxlbACgPNqrJjn85gTTcw\nWjqC9zcZgRlX91dALEbfJ/fze0e1UBC7TQ66ApZilegPsoV7RJJPuRiiYwSG\naAXXqpB8nIgehKmhgjyCFvB30NV1swKypV8eINWU4SBNwbVZfilm4x+wD4av\nH4mXXD5xuswJ2VOAQpFm01bUjTJnVzL5Bk4g0bz7RC33wBrep3kWF7+k52Fu\nUtiyiTGDSpSAaaS1Mrq+T15uCcO/NdVOwMsP0gUs0hWJ2Wb9zTlFEIVkvF/I\nD4dSGvtZOXMFJm3wjVB/gK9+KoSwooSuSI0ISRWuBYMTt3ab4pnp/+3o/NgX\nYNfL\r\n=WGdJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fc343ddf693589f18fb413ef04bf248558976496","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-fc343d-klj86w87_1614158350279_0.26026014469781233","host":"s3://npm-registry-packages"}},"2.3.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2db8400dfbac7721dc24e37306acf7a7cfa5a25b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.8.tgz","fileCount":628,"integrity":"sha512-f57RvbGlmZJk1PkH4cLwca1uxikhabbTpRDjsb5iGGfRRcpBt/JMC2IxzKtVifqmqelT48V2qSOAdkJXFNTu/w==","signatures":[{"sig":"MEUCIGnSvcRTQ6381u3Bwsdp8LsmVhez/Kwlxpp8EgV7Ai5dAiEAw6Xz8A599EGXCCKr2h9meUorpWd1H/GCoaHPWKQuMVU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN4l2CRA9TVsSAnZWagAALp4P/3J5fWQRDRR3ZK3/WZS0\n+hvW8ZmhfSHm75xF5S26bL2YV7CpXtFeevQU/9foiCPlDbOhGDYTfxQxWUGE\nqxmEFa7k2OitEB44k2dIorOfPGc50OB4Vd4J0dXigt+39F45Nymad9Zm7o7R\nWKuAyW0pDql869m2kDjtPCYRrAgyCZGB5kwIDiguiTcUm9uLZFj4JXH/khr+\nUP6JZ+nTFAZNrInCQJbe7Fthd8XoMarABZ0dgIVShtdB3TF+fwNjGY2dHeVG\nSCOWkAB0RyBQlgdSF0HnKlTSGB8l9dJ0uKK2XNaaExY2OqKSIUGlWWP3E6Mk\nR2WQj8w0alubIEKgQ70LGsyE5ibJ5cJUYMEKToX9HDZhlswvNtNSOGyiguGx\nW6Z8p30O6lLD9DBb3t6mSg1R7x69YNsNIhWzDRaDV4tIQkYTVWR1ROb7bQUF\nSWx/k7RjdePRest6zMnxBHYGIRrpIllavSvrtZl3ius5CXGu2ZsceMVzmX/O\nmj7lyVyMuSirEuBNyfJCK31hS9o++KvtlfYqmkatVXHpYAG517dBXHbvbaq7\nAU4fXNOB1UQ0ibBjD5OgCoFCZuKLT/mnhDrnyUJ9b6VkdWqDHVowXZnm9bKZ\nIP+DoMX7SizoFkEXT/8lAlnLyM6oScHLF8vcJTxXeVi0xanDNPHvYU+1IdfP\n5UIZ\r\n=eUha\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a1bfd34d4b37b0f54b1dd525a8e61c734e7bf1ed","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.8_1614252405953_0.527767353837681","host":"s3://npm-registry-packages"}},"2.3.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1507e3815bac9867777111b81bc185456e94eed5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-beta.2.tgz","fileCount":628,"integrity":"sha512-8mgsFyY+KTcE7HV1vIKWQZQcnlvhRJ9xreme85YnRer+G3mTO6sdfUDmvjZexTZcc8gN6YXU9BaqbVgtgQIInw==","signatures":[{"sig":"MEQCIDYqmIk4cSaDssPI1d96GRn5TsjOW+RKYLigwKKCuO9hAiBnxf01XVK9mkdt9be4eV7bRYCwchK3HDNBUP31fYct8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN5B7CRA9TVsSAnZWagAAa6cP/2OHnKH+qSWAHLCAMuOh\nKoITmrNix6VgdzxB5iiTSwuTnI3np5Cjn5i6Dr1k3EwjaYc9Iu4rU+O50cav\nhfcTY1Rt4HdAa8R9vLRLPElqQxxsRUW3QVPUOdioZdaIUK86BmtKvULH3/xZ\n8Lgm6IMUYTrphuDhvVbLF6PcL78M1BREfw+YdbzMNCXtQA3luBC8bL2LxPrA\nYXWSPfsEcmGtbijowr4/8ekiqxUnmDxv5jUbY85sKzSV4fE2VT65q16IE6R0\nqzkaq5/aPBbhyyhCujoevJfL2F1tU6NhCQb+Y8/vIjQYFU6AWMECph+P4+KC\n2nlWCpL6cIFIkc0y2oU7B3bqJ3DQXY3p6llBUvk6aGfLbijn8U8ZU3m7Osmm\nP+NdgVCk/7tFptZ0ixHlxIy2PmRf/zr5n/Z1A8Q+hDz6OngzUTA5OVhsw/6V\nRBmXeDgDB01aBnTH9eoXHS5nWvcJdd3B98CRnm+BoAFyHnGvVJpsrmmzwkd9\nVT4Fk3148R5jFWgcCXwv2OnCPEBeXwzdnIGGuCj8t+zgJcExpbtr/7VbgETg\nO3KcIynM8gDnpBjaknbxVlZDtVCZLxML/tqxKMc+wtMLOFFKmn+LquymIP6J\nQW7YQSD0A48ggrKBqP9ffWxURV/hzYVRjI0lDZO6jOZ2XSAuhm0QEDOG0quS\n90aL\r\n=/VQ5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5a5e3070a2f2f2e4cc2eea7ae52f23bcf0f589c3","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-beta.2_1614254202695_0.7431329751898534","host":"s3://npm-registry-packages"}},"2.3.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"86b2139b27ffaeb1c6f729d54a10b27ac3f86321","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.9.tgz","fileCount":628,"integrity":"sha512-JrBmpzhXmUjUIurbIlUAf2VobLWZigdDcyl2JUhVWfNdmFy0g/b9WcJB1/t/m02dx/da2xrVKPGvxl7/7hcElw==","signatures":[{"sig":"MEQCIFbrGirzUT9IrdlYHlfTmndZxa7Ab8pk87ukgFqQ2zIlAiAD8BNAMgV9syQqYlXg1uFX5O+2guWlSYI5C/uYoyyvdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":735342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN5CUCRA9TVsSAnZWagAALVwQAKRhxAy3XIjTwN3nxqqf\nMSuX8RBaKd9zgRV3kPixxpMSJR4oisGZ6mchEt7Hn2bhf2X+Vw6cqFAgcXV7\nWL8M0YOxN6he1GolCpAZ24WJCSxNhlXSMT7FI9VHvZsKthGYFKx9shP2TfCi\ncgrzAVqEt2h5+9WknpR0YtDl411cskSW7Uh1Wp4YEwAhwxpi3mqSbH1qiI6H\nlrMWKvLGOVnz6p+L22rEDbT4i95ldEYcjtj8h2iIDmLbqLtCQeMhqb7AtDDV\n7fITbz7mjXfsiqE3nZcD+DJ1hy9cz5oZo6ppNcabpAmi/eAJhlmC9Q+MZXwJ\nxwYCA8NVlM25W29ERJPL6xEqapPO5gqZpz8RFaEOA4yjUByriwEiv6J5u7V5\nAfpVaf7FVZpiH6klT9dnawzrEvRPratCe/JenbQFWR2yAKlbqkphJ4Ghds2p\n7r+LaYVBhUlGBs1s6b57FNGjkdtKTPQ3bXm8nl6Qln5e6u3kYPiHUEEdAS1L\na9UTckwfOMuyj8mqImSbIVSGPT/iyRTozH9ZtLxPUI5kwYOjY84j6uWP6beb\n4GVHhYP2CyYeZYULEesDnKYYCoKqOuVmpqtuL3TV4FNiRWefUmhcBOXJ++ph\nIR/nk7DcrVSu9XVhgOvirReKJpVa8+egaFIz8SFGB3dWRWr+CvfoTrdLwKZc\nZ6O7\r\n=0wnL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ac5de26d89ec06f1a39045a897b19116b23e9610","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.9_1614254227497_0.7331554057045795","host":"s3://npm-registry-packages"}},"2.3.0-feature-b89d04-klkyln1s":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-b89d04-klkyln1s","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-b89d04-klkyln1s","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3848b7b5009c0b5b8cbef3a76d61e39109be6eae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-b89d04-klkyln1s.tgz","fileCount":628,"integrity":"sha512-U0UVYByMRu3xdXE9c5/hZ5gQ9pzc1vBZ+t29ErJHlyprJXhxmzSp/W0H1qW9W+IaFKeq3UA0GYiK7jgaML1mkQ==","signatures":[{"sig":"MEYCIQCFlaQXJFOTEQvHTypuvXtx8Yd9w6eOx7kEOlQiO6FtaAIhANMX5mvXOx2XUR1abAo6Cwe9yWQzMrHeM2R2MIZtKR+u","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN7OJCRA9TVsSAnZWagAAdncP/3rhiS6G2iOV0LjeMaGj\nsjl1IDR45Fx8ZKSM0R0eEhhaXWzS4IkXgTDYMIVEMsZ+/A/c9ElX0QV9KpvI\nebUoUSyeCZ3boiPo+uryqLPCjMBh5RFmwIq6QQ/Vp8gN8Ds5vQ4yJirKUXd4\ngBnz7T2Zhm6oJqbO5YT0fQb4WitQ444o8WIkjTnnXlB052NVoW5v2GPG8W+7\nlIhlhJQJQ6kwpmKgawEqHT+UQiGIMYaZVdDGXPdhImZyuSInGI8DSlVWwLHm\n+Qyu7OaHWkPCeqIkQb/IwSJnoZwNUkmco9RDY8eQt3m83TUCvL/MWNAU7mQC\nSVg3VZ2McQ0fb1u//NF9Qtb0KaObvbX59Y2nHWl88dWUu9UqPZHDqLEEoWZm\nMLIUFy+iy1+JpDWhQprDeIsCnMkvkCvtZ3BD9bUT9KTGGgVoNDFdqyRARG3c\nIyky9etn0HiV31aZfuouPVp46LO+FYqfRJK+Ri9E/XyW9MxEW5rtOxGaqz/T\n3cHUVIaislMexvltEjSX2Kk91MGqSG0ZBrFVFVOzKQk3XLwzlrheFiU0CDf3\n/wRqBoUEyIKYotukAM/n7tLYeIqgoP2iykaxbexoPgPjvvLyQGNMGb+bA3Mi\n1Xfc8qaP+yJ4G1NUQrCPiKGaaLhSid0vI98QNs3gQ8RjQsQnMyeIPCPLf3gG\nxxDd\r\n=+MIN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b89d049351c709b1b55214de996c131f0b05d0bc","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-b89d04-klkyln1s_1614263176854_0.9072018779140016","host":"s3://npm-registry-packages"}},"2.3.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.10","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cd201dac4c1fdbbdb90aefc4e7fca8992c1586da","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.10.tgz","fileCount":628,"integrity":"sha512-d8MI73K87Y1c5MZrXk0Lu+r0K7MzwgFTCOeLeyGtie/7bGVn+3yh89YDZ3H9mxvXmzGK05DNfgS2TY0aEf3ryA==","signatures":[{"sig":"MEUCICMj/vFGOJUzllp2aNy3kVSpWDqhCeoptlbWyg+xsW/JAiEA1/9vrEqW4KZAEJAAkgosgAM+6C6NuZO9JZ3FvqEJims=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgORo1CRA9TVsSAnZWagAAI3QP/jW8pq/v1gvz+YxUo7+t\npIxOapQ2TOCzOSPo2KNii6OdC7xElh1fwHm0GQSjX+cFmjgyjFNEKP4XqnsQ\n9Re+AUOSyOtxhyoWmh1CS8sHWKZbbcEkuSLKM7RiFZLxjeMiCArIwZXiP3H2\nPctVihIYBYwQiOxJBAJbH7n6xgH42dpMebBthGhfTFNHC2UPEbVWhShb3wPS\nV70VRH5hyYYXlbyr9QbzMyJTrP+KIKbvODuARhkp7yRVCclPS89zLMKIDrNI\nVwY/wMNGsttp1pq76+NDHC38SDNl6DGq+3YrFe7orAxFTwvyLr9/N6K73DS1\nBhToHLCktCgF9fPk+jElKDhbD/3s/Yi81fUtgGnIogDEUaSmOQDnnzA0hxSm\nfNg0o59AeqF4ZMfOkVUViiWyf++pZRHZ4lnVO+LR6YXJ70vq9jk2oQA/a11R\nF9Yymc1vh1ZVIpPc9iw1pl0lpkm5PAkw/3lUAEELZw4VWhXKirf6Qxu96AnY\ns6Ys4uFeEwpaa7cijJZkKpSfddDt2Dzm0gC8u97nh3cm8dZOeKGRMC2XBrfM\nLPIqR3DYWva+Mred9scKn89EyHmpB2/D48XJ76JGthJZexxGDdJHlErwDz3j\nch15nBZEYsYHtpaZydNQzS5b04eRfSXxjaLlzX43y7eT8nMuIawnktTw+8n0\nB0ky\r\n=CsV3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"824f126aeae286e14808e60d980d176b8d137105","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.10_1614354997157_0.6558380703260576","host":"s3://npm-registry-packages"}},"2.3.0-feature-24b1ca-klrr323p":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-24b1ca-klrr323p","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-24b1ca-klrr323p","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c1fd97e57ddf05d1b6563c137adafcfa1a704075","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-24b1ca-klrr323p.tgz","fileCount":628,"integrity":"sha512-mTLK6MvkBmdoBVlmncfvmgO9XmG958tYMiSILIkG3e6IbjjF9Y2L67G0Vo0QmSm4ua9mG9oUcWDe/HXr0Xzp2w==","signatures":[{"sig":"MEQCIFGVzbRqiFoL7VJb+B2bXqQE5TMoE+CXaHGfYRIGjYWJAiASDO+OY0suC4/gXRynLX6zb5XiuN6UX4UQYIzUuRodLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":732436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPfeYCRA9TVsSAnZWagAApPEP/2NMffV1LCTg2Q2zHwuQ\nVmI/LHslZxZD+WkQ6CWEnTWJ4P0BX4suZbpTdfM9Q7WHztCDxFGnQ0940KCH\ngrtaN2lhN+x7/Ybyyahj9rVGyUnLBi+QZesLxxWuVscbPy071QxcZjOJ3Aq2\nr6+6Q5RkJA87/DtVnEtYl9VgQGhf0Owbs7EmvMB370eI8hRXEqnactVK9d1u\n+S2x1IbHWr2jWKAg+wD+x7d/UZk+7ftrHOj8rd557YqZ84jHhifMxOEHzhon\nCjeUa5KKTw1yYFwtKNoh9LJYeRzhDfO8rMbMcndl/ZZHP/RdQG3W1EXMK5QT\ngC4m5Wl5/ijGKtiZkxCBTOe4OUhxBZ901IZ+CRr4WwqWslF0tKHzQArFtODY\n80NbJzsOm9tQF5f3NVd1uKg3DmfAChWNau1jq+GwMvso4/JXH1lcfKZ0PW4Y\n7gkFURFiL+hXfEs7PzKm8NnGLpNvYm0aPLTQV86KNMswLhs+8y+Mdqliqldm\nX3+NukLt0AhL2iA3REpdykR9xv8nTqxL70vP1CMycO+Lwa6DeMxh5YN/uYmW\nssXpbQmHYhnQy18qFL1suDXW8ZjeeV0lg6Ej5iM4YUtGYBAjpTJZz4qazEHU\nh34hShaD+5OUPwV4tXz0avmc8sKySs4gDBPQeTu/oQaHSIUYtG/JBrPH8rvI\nweO5\r\n=fp/G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:8000';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:8000';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"24b1ca5063e86a069c58657b19226efd8393d113","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-24b1ca-klrr323p_1614673816080_0.9879488674209385","host":"s3://npm-registry-packages"}},"2.3.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.11","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bb27e8fe0ee64b368c233f0b37eca35fb2053836","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.11.tgz","fileCount":628,"integrity":"sha512-l/iUHQ+mEcQ82zqgmyd9byLagt35IRhTTrREgDUogxdECyFSMMcROz2BjiJWhYpn2F3VaeRlPaKho9SfGwyeWw==","signatures":[{"sig":"MEYCIQDL2/yu5BxQOogpeHubXUXo5ZdVDIB7RTe7ZJ2hrt/O9AIhAOXF/p1MuNLlZaEqHkwt+oEdpVZU650gJSOZA4K3Fnjy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPfiGCRA9TVsSAnZWagAA18wP/A9iUaDQpDrcBSBKCsJ+\nmFEWlnnVZ35sLm+gMcYTqfB7bz4PZRP0KbgGx4k3wk6bTa1m0UPd+Y/o6q2i\nx9/dHlbQHiIk7Y50Llnf8sZ2BWtOZ19DBG/ghlTlFLH40ZzpQVwDXE0u+UZO\nrAPedV2aCoHUP+Dw7wuK30R0XVQ2IadeqZPGR8y1mkE/AscAGuQkT/5YqIrQ\nEUn2l/IWzfJYxXat6qyYv2s0JyJoERW/ffxwgbynXVUTjBwkw/6H4zJkZFO+\nzG0/n7Wulh802YhMs35k89a+9zEquhtQR5TC9+P17VF5yBv56KrfsjaP8t8J\nDBNyr6gLdsJ/BcTds2WqgB7GSCrHNkdPjvs51r+APz//ZZI/ym6pS8nXSjjk\nfoj/pAeeXsF1ZKQgOn9tX5qIzrsybQarVaG3G6s5lH1LBtJQKUoRa+bf4lxB\noCGkjNMh3iMAepawK00wu0uy8NfZxsSberWKJJhXNpuoLMMq2BjFmvNsnOEi\nKiMPJ7QWNMzCWH70WwM4zJ4oa13SpcTyMGbpHzFzH9AyHekYYbNZtKOc6mnn\nLV6r1jCUC3PBVId5rhGuXVP5EW5PPTEUPTWGnpDwCN8ISkDyUtf59gFBXIqP\nUdxcpWYEBb/Q/sUsDOYVyG+fCQ1MvO6qR701BDSJDONCH83hYRs9lrONB/nD\nqvoZ\r\n=LB4l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8a4ae3448b8dd60aa0ebb82a7ba206cbd81ce6ef","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.20.2","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.11_1614674053835_0.34756245191993806","host":"s3://npm-registry-packages"}},"2.3.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"836dbc4dd73b90e05e19778d45a624aa8ee93403","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-beta.3.tgz","fileCount":628,"integrity":"sha512-rPAwk7LEJO8gH3Qu7rRkyzSmZn5C8RlAn9Lnq56AEMRYYdVLL/+1COfhkR5v2wYdMgDKw+ERoLOXJniZCc8s8g==","signatures":[{"sig":"MEUCIADz+rolIeIKsRgNLPunvbcXEOENaMx8icZfvSrl95pRAiEAkSipT2Cbnus44IrnR4W8VajKjSNYz7JBDt6tEoCwrr8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP7B+CRA9TVsSAnZWagAAbV4P/2tPGVfkleQz5z4lqmbG\nLojpfB+ltFT2JYYQYUtlyNJHxZlv1G6kgaJphWvlV7eGMydUKJHn4TFNOjCg\nyvf1CWOO+vRxa/tsULXTZGebbZn3e2kSQ8OdyOj2qyN/mkJXiH3Kv9kCOQiL\nIVmEGx2Y9JX4RaS/BeTU0cHKTNBbdObvFseVppKzJnIxE17XoO8TBfcSFSG3\ngGseGf81Mu14vY6bOoEXlbsIX7u64BZg8nPHuJnatsAaz4700FdbnQgP3fCW\nutga/PkR7uGDL1p+voU+P4AsNNzhWJNHP1bVWXb09zVHghgOb6ACOWpGFzZ0\n0kd5qIPFBt9FYIabHSAZ+3UiPREXxfriRdqNzFvSCZ+Ul5n0AILCB3Hd1Yf/\nYzaa8u4rzZ3Ddmn+BNifITFN7EGri273X7eeyHzdTzUu14x5ZycEYBuUKmHA\nsLTSA3E1TK4m7RDIZOWJ6mCbi2v9DtpdLuyMz9VWTQ4iJ1fycFKkezNEC1i1\nS5siCZ8ZKrTdCQ/egGRzYIfHnWipqhnxN4K8HHxQ0nXCbHH/YYWHKkgmfh+9\nXQ63c1djLZqNHb+nwZo0oJAgRlT3oK52ATgQmVttk23cYUgw9CItswSS0Smg\nyAgv+uPbT+DMUhj1d+0c4morV1LgNkeAdt8wJ/RXPNMVnyWAlySyGqFznlM3\nTdrp\r\n=NsXx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aea364af61205e377e7974745cb2499864e4054d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-beta.3_1614786686160_0.6194245746606648","host":"s3://npm-registry-packages"}},"2.3.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.12","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bab5a2d11fb162cf0d58d3a7df6333c26a6ade89","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.12.tgz","fileCount":628,"integrity":"sha512-ZOpoX97wBV+BmeP3qdk3nbgYTk15Jqdrh0nTQbJBZQOdER+4102ouZMw5hQyNjEwlPZ7pyLDoGgHLC9dtuLL9Q==","signatures":[{"sig":"MEQCICJej7uYoT2O4LO7FubCP91RaUD3yPTLpAxOiX7wENVwAiAsjM/bh8UyHOYdVL8gfnLFkOV3nqnvqulnIald6yXQDA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP7CGCRA9TVsSAnZWagAAdFYQAJJBg7Abf244k7xZqK0Z\niJVO/pVhH9HOW0uvXIecVCnzz+lzEbXZE7MTG+OpsJjwIL+yuoA22CkG2pq3\nXhn2u89BgDjxUA2Jcod2Yc9KrhWBd1DQdMeSm8AtlIC0Ccibp0Sv3DQbT4Y5\nhjukUPms0Hjw2yBb2KEOYqND83x/dzbjyTsLr18Mn4gVKEvaBQtr/VJyO+D0\nq/oWd+eg4D6qyKr2+KrMA/QX9EXv0oREkcOmykUyJPwSpv6h7WqPBK6iAYHN\nqkIteD/p0tPKx3tZnc7TO4wMGadSaeHqsnYME3tAxWG/53janp9xXch/pTZs\nZhC6PLWGhxVlF4pV5UJ2IFDhjbQzDXqTpNDR9sKbIeUOM4NKyXXJ2UrHLlGz\nR8gz1QuUYd8sOtqAfovvXY0xyDlw3xWjsqzHZOC9A9hF7MA6PJ7rqx14vZCr\nsHSqbFUKM2W/Rb6SmHhQ53CaZ3N1eSCM94C/V5/f8phenPxncRdzuoaRQ/R6\n2tMCuuxQokaKSATZRXZpHW9Jz9mYD7AXvAznNw17sDyoiEcq/PSOfn6Iml3a\ndRFikCu9KwVWg/6sDxFTZ8+/mtU4Z1g7x4b7fZt9rFB038IxVwi/ve4wax2P\nnvnlN2b3qSzBEWKuzhoV60njSv2t8O+ivjzxBZKqrRDq0XhfctMaoc0RRlN1\n9tx+\r\n=j0Bf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"69cfa73a4142d899ce3cd003379f231d61e4aa2b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.12_1614786693790_0.4212523210493997","host":"s3://npm-registry-packages"}},"2.3.0-feature-897d9a-kluiyqv2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-897d9a-kluiyqv2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-897d9a-kluiyqv2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"92e6b12dc5fb245422f38fb1dd74697d2cd09633","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-897d9a-kluiyqv2.tgz","fileCount":628,"integrity":"sha512-j9RbL/vca1DpMX6CCc0CElvx+14/gNIS7I1g2qErdQ+QjC69wiSg29zrCdLUO9p3pSb1z4/ORy2k7aTYiF43Sg==","signatures":[{"sig":"MEUCIQDzMgRx/druQG2Fmf3c9iNdjn1lbT5QGq43cgUbRtiJiQIgJ5Wjm+l5e4qfqJzkF49HHEQ7/BOuwc5BpGYgW4zvfLY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQIbsCRA9TVsSAnZWagAAMg0P/iBQ5WdY4ocbBgiWEswn\nNPAsY8pKRimBVBae5QiSfxa3bmpQMW40N61baqkXhilKoNWqdjMwHyRat2uV\nJBT9a2ltY89gggBgbWOmh1ZPELnDJSB6BWSf0o3TviWnYVgyOIkBbE6H/pJB\nKSBZP+fxjEcJimHs+ZAcauWzrtu96GaSTd5sq3FMGgtVFx+fL9YrrQHmhH4p\nw+JrmxTBtn3SISTaYP0Les5wA/hWyNrLdUQDilaLCzwDfgm7hWyL50qL+XFY\nG+xwNJ5L8oWaBLbpUsNljAqzh1CX8//QhbVovByY2093fXpUqBiSq4eydV4B\nYxoCwoHYpnECRlrHYYBds9TTSJ7zvERo3bfyZBD6f2MR3uHVk9/BHNgxZQIX\nx+VVjc3NMruSUcEV+ZaDtLZlUTpE1KJcbzeoGZA+dBC1e3VKWvO4nCf3zWZP\nxdKJvfoDw1df67qDy1T++3AENn3tZq+BvXQcK3PALeZCFP+rO/gM5AYsEoWA\nGP+gOEcsyxv7wgpXDv0hfjh1tg3J/KVyceKLzwq8pYldThnoTuM2KyZsaecJ\nPA8m3srAodY85/iqqv7esUDIqq3XbBR86cUSGZ0sCmF4YFmP4nxCNZZkcM8P\njBYbYs8dLRi76AgGjJyiJZtIx7UjuaKtgadqIUhhOXvv/LcdvbEmD6SZa3xw\nwMAF\r\n=4XU+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"897d9a5571f7229895c0613aee21b8e43074daf7","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"feature~terminate_process-instance_before_removing","@atlas-engine/process_model":"feature~terminate_process-instance_before_removing","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-897d9a-kluiyqv2_1614841579619_0.056567976373927076","host":"s3://npm-registry-packages"}},"2.3.0-feature-b948bf-km0yq4ii":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-b948bf-km0yq4ii","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-b948bf-km0yq4ii","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d6e08d1154485f9319ba8f8f0af9d4865d1ac066","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-b948bf-km0yq4ii.tgz","fileCount":628,"integrity":"sha512-hs+pcFgkzy7J5pBHHpMgxEDILfdGSo4wfCcjscmMQmpz/K1kTUGxeey6c5EKCd9BzHEjNHRCAJkirMPcR6CucQ==","signatures":[{"sig":"MEYCIQCqew6GVjKx0wSVeITpd3luPB1Nx5t3CRU9HPCiI8NzUwIhAJG3k2tXEt6FmwtpOuaEXZ6xMZ+PnE/FOtIkQKHDM7d7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":743577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRneCCRA9TVsSAnZWagAA7ToP/jFl0PDvf0GWt0ItmyLg\nUA/EuU6btQAduRXfdCNL0H1JOw5iLJFK5bnbxeNOygEhmkg/ru/RNruhEutU\nkO/hr8GVWqr/aM8qqmx3E98nnNod75eJgAz2Ywl1Z4JtQYQje5Gyd6b4syxv\noPFWGvA1VNpWeMxn2AS3tQ52VaU5DDzw72I+6BhBv3eb4BFwkYhgVRXocPt1\nKYCqVyBa3hrNe2SfOo6wkZkz3eRSefpCCzHnea9JSawRSchwusReKdj/Ni/e\nTTWAnQeaMkLg3mfgcaMK5y884pY2xdlpu0kNEa/D/KWqBQUDmltRzybCwDyt\nD+5FFgo3NZ0UXabBEYGV33dMbr6sTPe+M6+1vlFw7FcBQp2M4Wd70FK9lMjI\ntPiYx3oVp/zVH5Sf/0VrPuuMtSxXNA47vEspvQ855zY446+pgm6a6fEqluCI\n1RCzM4sA0psTXl/Z77+PKahasfoB4d5z4paVp4X10C47MEH0jSzUo3R30Qj6\nxPUK0wwf7Qf5+hnGMPTmEVnDKHqiWZDyWjlzoKpg9tOz0VOJg+1yo+1taYji\nthqf7hZvx1s8A2UfS/P2x6C5GSXELCuLmOMLo4DJRNjJ1PjcIcFPFEieeqdz\nn19zoKaoJQT6Ml5Chsy8AurUdkL3lCJU79Rq3qXaWafTjydB8E6LoLyTK2wk\nryIH\r\n=tc4e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b948bfbe6e60b93a23f7bd26baf0ad0ca2c74ea9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-b948bf-km0yq4ii_1615230850077_0.21609415619503025","host":"s3://npm-registry-packages"}},"2.3.0-feature-cd60b7-km0yr826":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-cd60b7-km0yr826","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-cd60b7-km0yr826","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"579b3f24ffb79dc7ea6e8ababb3be1db6be2bc8c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-cd60b7-km0yr826.tgz","fileCount":628,"integrity":"sha512-wvdiW4qKwEudoVbO2Ac9rEfhd7Mo6s2nHK20AAeuDiA4gakkNGES5h1bXd2gZ4q3yosOsnUOBwFcEoKZr7TUfg==","signatures":[{"sig":"MEQCIADa1IY08CaGRc2cjSasXe5+vvK0ltmukq/Xwi9rSH5vAiA0diV8+wBG0akdLCwx4sBF1D73P1QJ1pb145gTEKdS/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":743849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRnexCRA9TVsSAnZWagAA/VMP/2L35D6mtnfCcPySofh7\na1xtvU5PzHZ46JrGQjyIZTxAuJOJtYMlN41/qUDipHyXm3O+xT+2JlUq7uoi\nw6OmmomIxkhJpt+R8Mkt+38jwfGXwlg7vTuP/4JMo+d3p/sUV1AIB5aqWF3N\nhHfAgbdvbJFvpiCLSaHV88Nsyg/6zhSYgAYinjwbhYIAhcr/17tFt7PlhJms\nmuQtVtlyJbLUWdIUuQxyUiUMjiU17nh+dWZDgL0OhXK2nZ030b7OCFZQGrOt\nTLYnHvncMF1kNiXLa8ZSGZ1kNCZRMuSo9u4uS5WEcpPXAMYTQhaCDgNsPV28\nbGkYeOsWA77sUW8Gg6sSdixHCCpL0UdJPWFjVPFGThD6/KyL1+DqEQP8hro5\n5BUafRNkt0rvdWU1ft+zzoWEId8xkpFrJ+5fvzDEAAq3P5wzkbV8Q5pY/wpc\nZlZ3BgZ4Hm80Zdu9razEoNmeFFoVzv0b7JG6mkfhkBwYKLPfVt0/TPhGv9Tg\ngFomHRE7bcxvkxTsAixThoryd3zJ1VJ2e9zzXeJpEo7Ak4V/Rn32JybrS6lT\nv4upTtE4QVsMcMWGkwLyCQObmrnV+qMtWIuAFHtodLWQvnQ8ZW2EhXL8JRGr\nPQ2BsOzaA6GmjgIGM2XVHlSudrZ/ebQJL6CgHk2iOtDlCxEp7Cn6ywduYlc6\nPzgs\r\n=+UNC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cd60b7727b69c7e784d2ab3bdb721eff7e906600","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-cd60b7-km0yr826_1615230896738_0.4138054006794405","host":"s3://npm-registry-packages"}},"2.3.0-feature-b68307-km1uoyyn":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-b68307-km1uoyyn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-b68307-km1uoyyn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c159ea06fea7b41b6fed9d9eac4e9bb789843ab6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-b68307-km1uoyyn.tgz","fileCount":628,"integrity":"sha512-XExUkP51Yn/twUdQOMir9S1K1zpkAAODkQEPYGxwc3Ll0u+fbEsKtfWKv61xwyA0+BgtiWaYn1zdT7/u9QZ1Tw==","signatures":[{"sig":"MEUCIBGkI5Ce2Hr93aEvMeivB157yDtRaEpmF7KNqayM1HfcAiEAgDYJ5exhwuJ+dkT+FTtxxc4esp8cQAyDTEcFtp/gIfw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":747694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR0k/CRA9TVsSAnZWagAAA84P+gMCD8peFHaf+QzooJBt\nYdsYwhx7ywhPwwEU9CY7gJj1JRXfqCaAijZR9CWXD2GwOVi9qs8ihD3ebE6G\nOHKYz/4E0IpXPROgaSZavWmfGEaJU8KZ1Il6yB3xlgH6v9fnbsSVckYa8/5d\nR0eN4XdKgc00a+LOtiUnJTLglDxWCNHASVwnLb4XIJ3D/Z3mfb2GRpIlnrH8\nrqvny/AB4LG8AkP8VdpEtfXLRTYd1dRGT5nfJBKRWSCwwP68eLYoKH4wPHxS\n8IKgHFkI60u29vOZ3eRDBC24e8BZAVbjmvqIj4jixp1OhKoXTOt3/wVmb0Ao\n6CdFiP57fAHP0DAl4q3uCeuPn76OnJNVG7YEUNtU7YJ4QjV7mDdTVJ0Rs4cm\nESWn4+gtFBwUG8FemP8Eiknusu0pIukLu8txV76Lx8MSt7ByoLPmYXfIMLMS\nqBlr8tNvChJP1WJ5QxITKNboYQLnYwMabJirZH6NYIBXJfZON4Ct0MtAbqwi\nkendtCBm0YrFperrozXXIGBfrpByt8Ujw+hbvZcMy5UeQSNL5Nyi7rhAvVxg\nP6xy9bhVKLB1lgSIjaT3xqwTuuIBu3AJx5fjhTY6RVuCkPUcI2+DRe+Gyo76\nltLrtFpS2cZoc36xumFBP/73LtLQYcbJOb5fG4MzPQr5lm0C2wSS8QA8EFIW\n7ABH\r\n=jH4y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b683071d464387840e41d41be9bdda4182532ce6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-b68307-km1uoyyn_1615284542681_0.19441194469384104","host":"s3://npm-registry-packages"}},"2.3.0-feature-74f5cb-km2b1kjr":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-74f5cb-km2b1kjr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-74f5cb-km2b1kjr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a271f58ccd13f49de3fca3075efe2801fab12788","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-74f5cb-km2b1kjr.tgz","fileCount":628,"integrity":"sha512-PwXTkWDnOK7NEHWwNhxJHrg4rRVhdBzxz3iwfO372pru3eHwXUdy0RktNW7k+t1FposQ4RrYOIKTcMolP4BLxw==","signatures":[{"sig":"MEQCICN5hbNjkvjyblDxAh28O+SNmNp/qUnWXjHG2CnDAQv/AiBuj6UvLhoG9E81OOJAgjbBzMvRqxBXo1Vq7H4ZbBoLeg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":743891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR7SCCRA9TVsSAnZWagAAjgwP/2SDILGuc4P5jfmCu9tX\niOowzzWk7+IVnnmULnnoe6dfW0AvkM8Pl5v2lWvyNfJzIgvZWm5D1z+t4hOp\nDKCjBEyN2UKMhT+xsoouqWL0k6qarJSXmVUxZpLER8cirF7wb7mrgGZHHD3i\nT8tfQwXgyBDfXUj5ckv5v8PGbPXRLbqL8JHrObV7GKXyY+f8DCFAas93jGHx\nqyybMyWFoaEHJvRIiYq0zYFmqEJU8iX5yjlVnCA/c8lkxmT46GKf71UhU8QZ\n8tEPovgwX3N7qD27jn9Pej4AqsEgAh0bKsQ88/PhyQCqZ1KPLVggo3SVzBzX\n1HcAKAbzteAZXhmMMNOtYJuk+JkTAs6cAMpLzqETJo7rvIS8SnFqTckDYSbj\nEVVqppA1hE2VCl6iuzbr31NqD7J8vBPUsqgGiJnAEAN+q6KKdy9TtCcHwOW2\n0/aOuu9XSQrshsfth6IcMI2f02jDMYnCC+vJwYgq4ihxsKT3ecWsfQM7075W\nq9la6rFqWYqFW0BPErJ22FTpiCVLI9G+xXXN+b5L1L108inGe0+x2f0LFoTn\nuSCVhWQ3IpOmaam9zZydMWFZl9xwV5uCv0pse0enXD0Z2MZRMnLOw0Ep+G/q\nbEXTkC3duqRat7q+tWNEuJy6Iy8cD/ACkJ0vlKHRkkRFsOzcnTVUx79OywBX\nmeQW\r\n=qptI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"74f5cba77413d04781842f8e433f429c21bbd9c6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-74f5cb-km2b1kjr_1615312002035_0.7633825462914701","host":"s3://npm-registry-packages"}},"2.3.0-betafix-c74fd6-km38zltq":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-betafix-c74fd6-km38zltq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-betafix-c74fd6-km38zltq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d6c717d253171de5083e7f4db21c9ae8a37d646d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-betafix-c74fd6-km38zltq.tgz","fileCount":628,"integrity":"sha512-BOW7WfUU6Z5ZatyMiXLrkNZAZt9B8bN/PWdCeWgzgRnUrbnVCqhubNk5DSWaNsDOa4Y+XKrSJLxHImdMtQi5NA==","signatures":[{"sig":"MEUCIEj6uQrmYBQdh/6SnmFh0DatHxblon5ue1dmwU+sVytiAiEAwpWVXDGjT//16kD57MJHUl0nGfoWI7A4j5YeCyDezlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":744755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSJNCCRA9TVsSAnZWagAAGecP/0kraYVajdCEyhKmdFZz\nWMWI7y21Q6jSaM9PsUPWeKlrPi1O0p1zZnY85uKbWlK8PoSOnzOLlhMWLVIj\nt8yhCsBilvbhOtscGTHYB3TuEd9R5HkFvlf+IBz2LGTpe75BZTPqRJ08ufI4\nMHgN/mMCWMrXNAEndagKO/e0OFmbexPyndb7plcb4AM4vrfyHUpbxTPyJLNF\n2PCC2/tPXkESsVSuaaJWBZ/qVTTOHObVtW/BDYf1Npg/pV1k5Fy97EOvgYQf\nAeu55uXm/g+0QvIyATYR49KTMZ1OcyqLS1iDDN/JZO+FTgE1rNtREOlqhWgI\naXtnVvZ0NI8I2CPA4O0kOfKuAtRKeNy05noErdUfPPM3OfvfytU2VF4oV4X3\nw1NaRDKiJ/7CmX59OcAQycDk7BPAXfPfc/zoDukmareuZGV/OIquThy3H2xY\nck8p8JVc9WCiG+npA67zzIyy3odGcsMWsHFuwr4lKEqYkD7M1zPUSAL/fLNY\nrbgZqBD7owEBvd9PU8+uL8vF35fcTZU8/oFVDtFvx+RMFwJ7PjYYvpDPuHwu\nuZ5+KD3U3INpaHMyLWHlvSbJbQva6gAl3PZjmGW0FXPCb4MJysDOyl/AQlYG\nydfBb1JOqzDfYsSLiGwc5Tw3/cmh2zPaGXk4aUXCTxV3rhv8Z2V9VDuh0V3P\nrSXg\r\n=r5HF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c74fd6885142734cf5f46458974d39e70022b786","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-betafix-c74fd6-km38zltq_1615369022595_0.6887161414345684","host":"s3://npm-registry-packages"}},"2.3.0-betafix-c875f3-km3cw6d2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-betafix-c875f3-km3cw6d2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-betafix-c875f3-km3cw6d2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ea9e101aff45e2a868d4f2a5886bd289171fb470","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-betafix-c875f3-km3cw6d2.tgz","fileCount":628,"integrity":"sha512-yZcCnN3kciFvmidscX7US3mMNviDRbXfyd7M0yKiutHtZvlcUzJgcwOsCkV3DDEsdWpLtyYM7BQrZsjG07npRw==","signatures":[{"sig":"MEUCIDdcIEzRxaIzkXJut60ojqWTCskmyyxfLH6k+q2yJYm2AiEAns/yqJzTmCvxw1dVZpt0xwv60NK0gW/lQWB5VskxPok=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSKzYCRA9TVsSAnZWagAA7LYP/1V6g9OyklmkFHJmC6ZJ\nEUcqoOem2IW//GJvgB67CRMlYrBX14dHEg7NGkLMkd/EQD0D0Kg0ZVw/HKO/\n5YCmTkg+7ssE+Fn/fnIGd3azNDJg8oZZ5JWGDri1w8/Gf3tK7jJQf9JoZBTu\nC1wJqPILImvkmO+8/O0NxHCbqTRw7IcnXbFj7hrweC59BnPsEeQXQLcIo/4B\n5lvFEQ1MSt7Gr81UgjBrP1tR8Eo97L37SXWxN9QucMvCDnuCxtYRkerXRR3Z\nUv5cYg7sf53K8lrfFJN/+Rb0gWuJ2lgrmPxiPGDc1w9+b3/I68wgoErOjHQv\nbI4co0pMcrcRV6N4oQQbhIZTyCHNWH8QR5FL4dFV2NCJ2XnwQRyisheCwEVN\nI7m5YbaTNw0f2xQoskLKhLlvb52x3+qgXC8fY8iSsmX9LyQZJQEuBFw5N+aA\nNGirEye8zr7xft63BBtmuHIyZBFMQxLTCT9ViaU2ZaZ1qJoUQew/SloH+il6\nRvNJn/rM3mowjwd35lc2iSQf5Kq7I2bHrOcsdjN9AzY6GDoTsXz5BWDQzYvk\niqfF7JM10z/bkDY6YuR8qgcxuEWkDao6yN1qAgr4hwFELBNGetYU5xbWOoXe\n+kPJE5HEackVTGjzVIPboPdO6octaTSuWCJzT0SIn51cAq3V8gqzU3ygkPK0\nypYA\r\n=TqOf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c875f3127bb8a9262de1f72fdbf9f08c119c0e7c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-betafix-c875f3-km3cw6d2_1615375575939_0.5527154602417561","host":"s3://npm-registry-packages"}},"2.3.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dd2a0d2faa63789d9c432dbeeb071e937331a903","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-beta.4.tgz","fileCount":628,"integrity":"sha512-ocycNoyE9TYLJIkeVvxqpsqc1szwJtwNG/Hce6d6qVqGCtGveVTx5CCOyFpaNzT3G4vkiimmxkZ3U0N5Zk45Lw==","signatures":[{"sig":"MEUCIEIW12YvkvX4ucj8Bs/rpu8Jwmg6gI9FDBERNzlHP7FGAiEAyQnBn6l32YfR6MfP+WhKuCiRCB9gf4p/yO13Z3PIxY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSLDkCRA9TVsSAnZWagAAFSEP/26W13K0wfznynz91XeJ\n4i1K1l5Z+DXDIezO65OHSSfMeYc7ujb3AfOraf5mPq8+sqJsZCDq3+A3Kn/z\nwPJc8UiPMEQNcrAmKWPGCRyYPyYxRCfDk6eIiAlS5akQ2xfM9r6u0wGF98EU\n2pED0cEsxhdYLV2uSJFOjTw77GjNal8RiC6XKfqyw7wp0YID2MZ6j3Da19SI\nZNl5ViyPMnINQX9w0gRvuLhUi7D4BlAdPsjWri7C+g3HFi59MR86UOLCRXjr\nEltzyYbYMViAjdOHZYgG1rsBrZP9dupQWBOd9yK4PaNh5Km0bWpr30xp4GGQ\ncJ3qYEhapoHQLPCMp3RX9Gv7kNcACgln7gfFR4AhZ0n4jIIKPBBpHupcLmKj\nLb4L6Wckz8gmuxB0g04iV/ILmofqaIKJR5AqxeNWKmRMDnNM1kcJHMOBO6m5\nGwVU0QI7kxYqTZNHvOvrd1ulngC95jyFV91UOgdjTUoIDCKZZHT2fCOzL9yA\nMYLLgymHtZt75HTX94k9GcyMLs2O5sSLnwa2iZFoBQ3aXXC+NzsQvUyAYH6B\nKHbN9cujLuclLu9neJSNi227PEcaAjrqvu15ewk7TjnAhI/CLxqVqhE3njgX\nXhG/Ip/nY2Azyr9IDQlmU8MSUTNFsaA+BspIrxAIldOjcg7bs+ALpkoDAlg6\nu9pC\r\n=w3F+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"96a9d021a1a739bbe1557fc1fd367bf497dd79e6","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-beta.4_1615376611868_0.9475296035772383","host":"s3://npm-registry-packages"}},"2.3.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-alpha.13","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e7a912aa4bf2e63db04a3c78e76be1d99a99cdb6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-alpha.13.tgz","fileCount":628,"integrity":"sha512-6uiELaQWkxWilWMjHrQzclq2UsT3GxOk/+rOlX4WI3/GJxI6HtiigrksHvd6NvSi3NoxKy/kwUf2XpGjsCBz8g==","signatures":[{"sig":"MEQCIGQPYOkihNM4xa2WRfNN3H9sw5SkydkYv+WYeEA6FUsFAiAIds574EFJ4I0FCD7tD/0ZO+7y8XGNzmSt1HFgl/hndQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSLFzCRA9TVsSAnZWagAAaCoP/3cSM+xS/k6axWe2S6Lb\nVhCc8WHeEKNtFdW43zueXF72bPrqsTlaODOR/Naf9tzdmdcmVXtvOFGjg5tK\nOTB7NO4FkPRthdFwyRnbrhhmh8dt8Z6aDnZSBcolfdZ5qvP/0XE9Gumkfx91\nZWubMjXDPUI7iabVT4bAqQ1fXTyqDDVi3Ygit4Ut3v0hGaB+uDhvorU1MvOp\nccYkpr4GWSR+LXlhDfOvX093O428FjDz9+W035kmvE6QIbtWwWomxSCh2gdk\nk/JhTnx83aN+jEh5i9zay2kDWDe3CfPU64iMbMT1ocLSas1+Gf8nIRpwJ78L\nCkI4AbHe2cRWd40+m84P29Zgap53XJxMuL4zdXDulDb17ild88P6rGN5W2/R\njRKvnVhdEBpDmwjbguXfk6QNBlokWSr+gydSNDRyuoAF4Y5AjNrgSv2K9pMf\nkza/h7eS4ZPX0fKp3x1dck3SXdFLCqfInbwRDmmTiMU0uumngmih8PkaNxXJ\nDVnLLsTrVDo2/T7IcwTff186+L6o0yOzLjcwBCWovymsyH5kpgDjQZzNU1I0\n8UQuz86smJoDeCY5tEpIAlo/7oFTcq6qFY0CZzXGKUlsPvSPKx0BTS/Icjxk\nusY2xPhu8zXCdkgJ1NMRbV0Yqi5fvQ5t26rMvYdIDmzf0zuQ9gFiJPRclbJk\nvTwC\r\n=yA6z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e46fc89fc3e6943c109cf40e00f4928d90718d4b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-alpha.13_1615376754971_0.10867597304788856","host":"s3://npm-registry-packages"}},"2.3.0":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e9baaec301f4bf0ad14d64eb0a082b3aebd4ca67","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0.tgz","fileCount":628,"integrity":"sha512-1/BFG35cnecJgDzARxPfEO7eBjA5EnzjgFgbxU4aiCdmit0G5ta6kYkrlUYMzu+iw2kHkVCE/AnNYe6xoM7EeQ==","signatures":[{"sig":"MEYCIQD0s+FZ796fU+mf54IiScBH3+JyLoNV3wzRRfUOqA/HiQIhAOwRN/rnIKXkcpJu3kj4vdmJjyOueU4yPtHuveb0HM1I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742021,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgS2phCRA9TVsSAnZWagAAKiwP/A7Y9mjhTyQHxQ9dxx8H\nXoG4y3LM4OCMrKEE5zBOHU0lp/K6lMrWLOHUbGFMVvl2dqCyhqCGRlFuc4qY\nocKdKpLBo0YlCItl/nCWKffoAhCYgGh7SjeBRQz6Rs3hObJm7yZKc3Ief3vA\nwrZfMLBDSa3ist/t8ZT//dTqj6Nns9S3biicgb8gelMsQa0cCw87VGPMo4Jx\nHySVxsvUc670rtMZ4XwOxVyAiDxISxEvI0v9jFguCyGQ9jk1BgXN3KaM7XNw\nxU2f8k8+HmSSmE/j2QLD0Ga7PBx3fIiymt9ekOPwAOk7hx02yQwNuAc5bzRZ\n29U2QG5p7u4DkzKvyZROYJ2J9cwZ/saNGd8H3gwTCqGoqp52HvRrJheTQ/Sp\n7wS3MRk876vgtMn9h7J2wAPa6lXPaVx7M9QIvp+074+7y/h15uEK/Mx+h1tZ\ntJ5I/XtRIp++NyuWFB4OzJQb0wYeSZi0Qz8KoC+LNuXszk1S4jhrRY0kt0v1\n78SsPXOPemHtxADhNG64/rOSmv1qchHh5VqDZGq42jpt9jTQoFLDIxBHeU7z\nj0Ai6DOp6U1mkoDmGJQq7pBtbvXPP6KZivLEno7D+wGeihbShjdccZ6eisaj\n/jtYpNFBftZq0NiwzO1KyfV1AYE07rvQL3m7r3B2/KSHW2Ns/9j+QAjO9unA\n5Qtb\r\n=Aih1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"b81849c400031a95f313b24253a28f113e68a39c","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0_1615555168448_0.28658010837716286","host":"s3://npm-registry-packages"}},"2.3.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3366c3e1bf1126bc5e90f68ff39479d16e12eafe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-beta.5.tgz","fileCount":628,"integrity":"sha512-u7kQuZusiptcBKzZD7QRVOlLGi/rOgjT7yhtPGIqDLzZKskNem2EOR7l1deF03jSRgIkG+sCpJ9JSzvxDXgzVw==","signatures":[{"sig":"MEUCICJ7t3845EXxf9eY6cGQKEydhVrpUnM45+l7L4FzNBQbAiEAqxK6sei7/evk1O12A66Uv6nHcIYbOuC1QRjzlmkrXEc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgS2pwCRA9TVsSAnZWagAAqhMP/iAbhpGQGSWYSzVuhP26\nYvZDF6UxdDOVkl5N3bmY/dFgybP1Anqx6H7zY1Kc8V3jqxoB9NbeUDut65ji\nYQlLPW/K69k4OU5d5T6nkrefbPx7Gmy9Li/o4QnLZ4w6oUUOpiqygpxnrdV5\nkP0P7/ziYSJoBsT+22rv9C5b4+sZtSxSoFE7ygpgksQfJd5YhO6RFASFk8aq\ndkH5bVMYGqKQEG0UHsJypIHlmBV8mQDQgNFT9Zl48L8Xe3eg/nioSoSs5x/D\nOspu7BAOOZYk2bakkn/oreGW6WQGnQkKz1OeOOlvM8DceNVolFBfqjUf2hVG\nb5s3jhiFEnd1sBcGNmgWZKRJhI/QygF0PsmnfMkW51CcmlNf8TdTF//Xiw68\nBfPc4TyAarciDfIh07YCZNzcq7Zw8RMLrXdMetLqxYbhOOrh06sF64O8I3P1\nzLLeqXpd4sIuCB8lG+ZmWwyDuqnsxl4eDnbySHZNBZd1/3jUub5BZFCC1Vm/\nUeiTuLgfGiTfLsy6CEgs+W6FIEWFgCL8i6oJG6vTjyYrp2Gs6dYNkTwahku2\naUcsLdkgloKnxp7nKWUjcHKeY2d01QyTrD3H18wM9Jha4+Dn4beqn+ok2xd7\nXeHqYR3/vVmo+s1/S65zCPZ5Hao8eU22mtU8KYGFHu3kGNydAwu7zN6E5+DC\nTIg2\r\n=t4OP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f91ab3ef8d9422f822fe1b257c1d549f5fb7ff22","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-beta.5_1615555183398_0.9379978533603777","host":"s3://npm-registry-packages"}},"2.4.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"823ba9929c4e61764a333a5b46850de4778ba42e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-alpha.1.tgz","fileCount":628,"integrity":"sha512-nKvXySZ4+obfiAViYWBg0Vl/gxMF7C945WGV1YbZ4ZpuWbmsDcFGNF+hJTIKUeLcUVmUZUN74I1vy9dPrSxJKg==","signatures":[{"sig":"MEUCIQD9KP4j7azFLGA/eblh7M9ilZNEJz+Yc0CFcGWMPsaFAwIgGb2N/Az6ZYflTuTTfP/hW3rRMhmLh+oLrdQfQJH0m50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgS2q5CRA9TVsSAnZWagAA5b8P/RG1BwxUJwoBsJhh46Ay\ntf+0tSK0OD7/HUUJPSBZpj2nf3/wfft1q0Pkr/rDyYymNdWcTGMo0coVkx0W\n5bYQrWENngEqhU+sQCN9zW8KdCl4id1lM46pvF6DzCilvnIDw33v05UK0mbp\nLeZF2WsiNZQCkE+Is29YabFcRLGzgT4x2H7SR34qhWv3foZmcEE8P5OkaxWa\nAUQJcJbWOuNegL5+RMuX06e/okgtHUWa5xf6Rhp5IIyYaDWPmGyov7WrUAHU\n+ScIUDgye0LNkmP34hWBESHpf/+bo2ykOITwNpDfsZZYAAbKGmFkjAAsXGAI\naRIxUUzhbG4ekvsx4Mo1Q/jGPY8p9yJ5EBvZPVvfnJg6NY1u6HbroDMdi3EI\nGoItM3yocZsxRaPFOv6CZAGjuQjA3KNORPlMgpmjAUaNMG414Vb+B9qpYGl+\nZGlNgwbkFp+JUCohVYsDKKmkhXrbFDEqpc8pLrutYPe/vTZG9jqqg8F+IejR\nerAbvgIGWOBmpShCh1ttBfjoHhkWIWl+5HOmchQAYuqE45lFFy95UFNnVCC4\nNQL/jvCWzg3qVTO3bepjL3H4qPcQVIRNrafA3D+vY5G3B+uHdmd1JRSBtuIG\n22KjmBUxVm8mOqJav4UHeU81QlBFPhn0rSMj6U1OAlKFE9TWVx0lM2PDTPzw\nplyX\r\n=YGIN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"718fa02aff7e0489b11423fbb1d1e2d542072b18","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-alpha.1_1615555257186_0.3172262434952995","host":"s3://npm-registry-packages"}},"2.4.0-feature-2059b5-kmbtkqnj":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-2059b5-kmbtkqnj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-2059b5-kmbtkqnj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0715c3f51bb801becc8c3c19b49c2618443b5959","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-2059b5-kmbtkqnj.tgz","fileCount":628,"integrity":"sha512-t6bb6OEC0n9bmW04a74VIN5ZBjjPCG+3O6rOzPuP0N+vEfrTCeCX+nlOQmSIjyi5iDuVcHAi62aZLzI20FG7Rg==","signatures":[{"sig":"MEUCIGzlXSFrvkvsUJjc8PKmEblTPBvgh4eC3HWsSU9xIzTyAiEAjCo0GjM3R1vAYbb1ydUtsQH6qKClvTy56gN/x+coOJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":743403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUHvdCRA9TVsSAnZWagAAY3cP/iL8m7s6rLM4mp6b7S8P\nTqIylokTAY5RKTqbpel2YXYH6E+4t8UZy4o4dXEw5YYlFzHBJ1M7iLR1eVwU\nmu+BCHLM98thdVH9VVmbrC6WX5fNjG1GinuCFRUwdFNrW3IZNPXc2MutnMR2\nHC9OnW50lUWqqlXhOwN0YtsNeoVD/2qR8vimu1/M22ys0CF4w2XIt+vJ9X4S\nNhLyiVuuU6KJJfoV+ySP5mo2s4mizrcxNdIutUdsuUrwGJs/jwb7TiwLkcfx\n0YLMg6DN5Th67W0wn/9HSr2noW2YzrAww39VScD/RUokA/Ve1BVFZ/K9me0M\nt0tc+mSfABTs62UCGP4cwb0gC2YjQhcaC+dRCHl2Rk2C/UJ9HiVSr4lSW7ps\nXhjmXSqQGuZ+Ax24y1zv3uRLVVxy/LPLDywXv60t8XQVuueQn6voUBsF9cL8\n5eJy3pXJv1opOx2xfzEE8BOXQLtGPs8yHzTftgo17s8QdH0cc/jujErG2tcC\nLK8ZK0/nE8HYshY/0/MOCg852hhADMwsT5KLy6+GdCUgKEyxWHT7NPYu80wC\niOxg0e5FWTBFY3PiAtqU9bRg2v3py3svkPJciFHAfuFvpBqPakMHQpJMmH6x\nvn0RA/O/E/nj8tPENwU/qb5awpeGjYo2i3UVD9AltL1hPb7iYcb28IxyE2nW\nOcTo\r\n=Grl8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2059b597a165bab5aed746e4f0d23f1ab80fd06d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-2059b5-kmbtkqnj_1615887325362_0.7916693384310245","host":"s3://npm-registry-packages"}},"2.3.0-hotfix-ac48ea-kmc5snkb":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-hotfix-ac48ea-kmc5snkb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-hotfix-ac48ea-kmc5snkb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e42d0b37f68614485d70bc7940281ac28166555b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-hotfix-ac48ea-kmc5snkb.tgz","fileCount":628,"integrity":"sha512-joi6mhJCjjn0TD3JTDk804LpTbW4Y4+8kqGWkU0/5aiLJt4En7rJESs0cXSUo1OmJSmhgRCHzbfxSmRlUJkQVw==","signatures":[{"sig":"MEYCIQCbHiyELiQaXu8/G2vfkm50vg++Iks9hlwUmJqc9YQ/XQIhAL0TTVY5SwoY+5PC4sYaaBtZDdGJkYa/Hxo4YVwC4TAV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUMwMCRA9TVsSAnZWagAAiO0QAJg8atwJH8h8mbg0Qy2b\nTybIMMXkChkaU/A+BTekg0TY4IuO4SY/9jszemwnGNZjmsSFqHYTSS/RDknj\nIAI+smsvt0SAQ/jGltRwRbsDBz/BnY7CgCCyWVfrmrirduJCuwnMf1bv/LZj\nKsPRY5s6NdMRqX/WULrz+9tuRKJlYCzkxRRXMXwgC1aeQuMZNC2AiISbxGAr\nz76OuyNfjdgxrlc3u8W4CfODuCCNT0S4Y+Bq0hSPWc8bsexzs2hHigUR/mxo\nEH8/fLFFtcVvrrYLXtbJGwZhnwESIruw1ezcNZq4kEz3hz/Np6fT7MZgBLJz\nNM53p997nzbVEg+q5SsHkTapZ99l8WloDWqQeMJl7TvpyF628FWVee+LLXb3\n467Ogo0dWtBHdN7XwpzhaLVInh0Z38X8Jlpj4d3KKps+rqVC6t65TJtOUAFy\ndQdXQtoNa7nKltoqeuZT9DMoXVMu3ozRxtZB9/M95T9gGe0crnaBYi+2TFUX\nAXFQWi2aM02hobLAndiCCz5kPPK7XcAG0n0z0NUIGtavOxpHvE4WpqUiASdD\n8zwaFgBbuvAetmgTgmwi+ZH8d/VMv5Owa1JW78+3CDsye/tETtBbjba1km+5\nCEP072adcF6U1052Z3/k+nVMVFhg+ukaGHLedlTqdEOAA7jiLP8EYctwiB26\ncOHz\r\n=cGVX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ac48ea251c6b33b21558fb7f5fcf86b12744092b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"hotfix~memory_leak"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-hotfix-ac48ea-kmc5snkb_1615907851561_0.34814945327553026","host":"s3://npm-registry-packages"}},"2.3.1-hotfix-678da9-kmeotf2t":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-hotfix-678da9-kmeotf2t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-hotfix-678da9-kmeotf2t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fd7eeac4d7a19a78682207ec8a9fb3151870d33d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-hotfix-678da9-kmeotf2t.tgz","fileCount":628,"integrity":"sha512-ZPdgU9Ix9sXdCfxfGtCNExzEAVhBYHzvpk/iF0wOaCHV4WHPpARZEWxYIToJeHuj81qP8BUTLFg7/jvIHoxLPA==","signatures":[{"sig":"MEQCIHVkkk27LoXbw1Kixe7/XucFPVOUCPCfj/Ut1Tf8rn6dAiB5fKO3Z/6dUQnPF3xVhuuk8qI0sLMZ9Uxs8/Nz+Mruuw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUyE4CRA9TVsSAnZWagAArzQP/2JRMBiQB9NXqjIbSaQ2\nN1l2w1xYVqlyBxnphaOQw3gvrhsUwf3bSp122km7SE6Jb8YhU/DZ3g/7knnh\nBxG0EFVGq22ow8dNfp0K/clfiYi0n60x92DhQq4JewdFlwagtYEbYBJPTt12\n8T5Liozt9ICYqctAUG8WVXneCDLL8Vj8MolC9ZBAmPGbNIdc3cOE+mjUsor3\nn/FbAFCUCVQbYrEvYN5QgXRtH7d/ZiWFv2gFF1/8uleD9+1MnGU/M7NKfGtK\neRyFXhXqxjwtxuvyfPiS9gjjp1mKgc6mCjTvKWz8mXKWp0REkhooAmFOH523\nbVdFfpd94hQDL10la/hfHRkMoYcZtMOZLLjEsLqDNJEHy9hmQSV/vMmWdU2N\nqJrhIQMphrgXhMvRj/cp+YeD7OHDxTALWW086eh5Co66w8ebXau+wabmqDyB\nA6JJB69wA3sp0YfRFLidEstk7LROlPcmr5+apIvreA6iLLqvB1ezO5nwnn+t\n2gutSzaHm4unuWwuDuV+ZgquLIfZ43y1Z9hOharFAEPD4CiDeGDGW4TqVYZS\nIi1BiJmlDoSgP4hyTZ9S1k9o9aWPACy2qkVgyPSDhS7zPEBYGAEYQTKpzSeY\nT0n1EqaJj+mf34n6bN4DvykeQ+H4J+vsVu1uNMHUVXQRpVKkTvTuFkVgdcJT\n551q\r\n=I7H1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"678da95a6e8907a3e1a1347cfe3ab333b7b51642","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"hotfix~memory_leak"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-hotfix-678da9-kmeotf2t_1616060728398_0.8243558588927993","host":"s3://npm-registry-packages"}},"2.3.1-hotfixes-1a397a-kmgdwhti":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-hotfixes-1a397a-kmgdwhti","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-hotfixes-1a397a-kmgdwhti","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"96c6d1456012c07cedd7df53d851c0cfdb12aef6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-hotfixes-1a397a-kmgdwhti.tgz","fileCount":628,"integrity":"sha512-ch9vkL0Rzovo5uCFbc22Eba18qttbG6hb+8/MQwJL0nVDdjtkx7Wq4UJpuzQgd5UeyOw3hnJHEazA/YCQWXrlw==","signatures":[{"sig":"MEUCIB7SC5aECGQzSbTV33c9lq0brQfcguzbkxggz9raHbMCAiEA9hNiZO6HbKAts7CEQfUdgOvQZpzoXGIjnmekjMVejK0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVLH/CRA9TVsSAnZWagAASn0P/3FnnTEcm45MTLZqngs8\nF19ieE9Ch9TaMcbEfzLeYA+6k7BpzgkiL0KpDcLMpjWbySCCXh1fNdNJoIMl\njbh5DljobcgET7juI/6H1B5d3BXQAfeACATYAW5/MZolRvyhgWmwHyetpr3t\nn6JTF72AKN4rI3Dx/28wID7VOhy6VNeK/py9oVuK/WykZN0DdNloXHDQRWeh\nVWTDXb1NiVlTgYssNuUW2xofHrIMu+Xf923R8Ov008DPszE0zpMH4ZGqBF10\ngmj6yFvOwkwat775z5Ul7NBe4+qOjK99/mkG6x5ncjWcDq4SxHFpES9nPxf1\nhzxquL4LUBS8/ZVq+74YAQn6RTMJFrmGSNaQAoUvtftiZiS+bYs8YSf5nwgP\nkmZ+Ku2s9LwrtSbUbWjLX30nqfpGPhAhcRnjS/wnGgi1AoAoPoShHPaGr2+G\nMDPZwD3H+966aXxa7pVJ7aqubQR8QIqKxete53jtoG9eKGWWQuM5MGySpE9s\nEGLAtvRFo5Y2q5n5/Jf1wrm0gRgZ26zVacuhj+d9NeEKKWFC4NdZR2Ht9V4O\nKXzIZFk1fxHesBKq1+gSrGc859PUUrvyKmUS0Q40w8lNFt5TPaoMWpKeh4Eb\nohj4P/0IS9gDmtrDeQ/14vNK2K9j78L1LRf/xEyTjrgrpEDTDtFyaDYQ9/FY\n4ca0\r\n=It3U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1a397a022e9fac20c13b4d217cbcbd944f8dfc9b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-hotfixes-1a397a-kmgdwhti_1616163326950_0.3640854756893517","host":"s3://npm-registry-packages"}},"2.3.1-hotfix-dbcb82-kmge2lwb":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-hotfix-dbcb82-kmge2lwb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-hotfix-dbcb82-kmge2lwb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ab7ef85b03eb5836933dd0a0f381c145e129973e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-hotfix-dbcb82-kmge2lwb.tgz","fileCount":628,"integrity":"sha512-H8P/d9p+5oGi04F5CRFYmqHOOT4NHSDvbEK/683g8U2QdiGWkf8BW9aF9I5EtLVcugAClW4eefknmry08vQVBg==","signatures":[{"sig":"MEYCIQDAGIBpuAK5X2Vp/RJqaQ1ANIz7J6HcsK91Axaiggy3kQIhAJMff++OzzzaSeOXnv7ZKFpQRSDKENXARPUQjvw5Dl+f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVLMkCRA9TVsSAnZWagAAs94P/3Ly7tcJ5KA/kpdFHAc5\nmgC81XWlyWT8xhioThvPeDe5ngn41aIQDkg+TDrzahT5MrwMCKhLko+iXeYK\nmlMWuY0ZK65vUGLYc71pGTSs2mYKULB8C7m5krOPqscvkHL4WA/HW0/jur5v\nS7kk7qF459el2NrmLh76GJbC3iJLlVxY0ntvxW6uyEVxjjodIdFm3AG9yTvX\nXbPtMBa0tPtyhtmtBL6o7t7VyHjtWLkyzkKpKnBA4ObQO2LE2uK1yR/liFX3\n22orzaWmCQ5ELdIpaDL5VcXQzSmA4b2RAbccW6DTqz9J0X2N1gC1HPB7LvwW\nvO+zn1lUCkMc4qRp9OMjHlakNC99/cHkcXDnggD1004uegz6BfMAzrR6TfMp\nN/FlJfCSY74g0q7XaXtbR8t/8DKcM61RAq8HI4t/OiGdBr9M8bjYNzs207f9\n5xGuJ9/BkUPgVc5h7feiPReGYtNKBKhXKbVkZVbQh90rSnCoU2ISHYr//xj7\nwoVYQLVccNkcqCnw2uPmOCFLpSdD9L3t+mEwk2e5zXu+5NzLUkPbO280SbH5\n8Ft43jreg45g/cG06TjZ54Cg+cJomWAn6iaGcoFbsWaH667G0lhOeO9omtRO\ntDYvQvpKa/j+lpogHsRpQn1BehRAkUWtGrhPIrfRAwjTNE74+5eiXB8Lu9Xv\nYFob\r\n=yEhN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dbcb82d6d25d10f5d70795ae1934447d78d9859d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-hotfix-dbcb82-kmge2lwb_1616163619563_0.44755828077219695","host":"s3://npm-registry-packages"}},"2.3.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cfda0bf0a56db9b671601303bd402483246ac2df","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1.tgz","fileCount":628,"integrity":"sha512-TMorfqHtxSvNPYyQbEDcMj7rIu5XWmi0nDTdPzVWec9cW4lp/uX17GcMZYZz0Pd1nkTU+4AqrxeL8aM9Bl8IUA==","signatures":[{"sig":"MEYCIQCSkJTh2RF4ldVWMN9hQ+M0OPFEGnfP76nXK4usCvO6jgIhAMIW9n3Js8zN8VdZB83iUSwSZtMHiQWamlrhPBpKpR+E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVNOfCRA9TVsSAnZWagAAIgUP/0qB9iauazKd5d7zN/hR\nCPNoqbPteDhPHftsS3P9LSYrJU/m3BCS1Fhp+HRl5wENtFN793p272u4uf0l\nIJAUjTGQ2tvbWPvbdo6LNxbvKcFfBwMNf34zFS1dP3VK750MhayBsFrPBDXu\nDlOPtiZxGsqpgn3rZLMgI7b/XmwMMPkkU5x756G9+TBmkzBJDHCbrKO6d9Ra\nA+d0TzbYk4rrK2Z9APAtQPPfFxEGjjogYp08QrOhgpXl3cmgrYJpRUue6KDX\n37USkc708xuH4ZJv9/BIjsuXLrLFdZNFf25u8NG0V5uohpDETwEGdsdiqj/l\njUcmkey9z+yktHIQEZi6P68U1NvMxluQkNj237ptA2Jj0hz3ravxQclGqmRK\nk05wYGa8hshjIA/I18uCh8n3MYzjlymYPL/4l2mh6DNdIPVqohDp1vlCN8Ha\nTEqi9/Hm5i0muISQsIXqiFgodbXCDI8Er889ZpFj9aHSl8FGSzZ4oSUBykT0\nH3Gci7WOZqJNRQIcQUi1TcQNeXNMy6+stYxLop3pnH+JDsHu/pqciwJnh/H3\nSWqAAfgsuKFUyB111+BjLBJ4yhjYtzOH9TdaAli95dVSYXU7c9aehrcsHFAX\nvfyAx0xyv2fbV9GilAznLAo7tlIpZGiQriAQKSLVTq8r/k9cuAY7QGt2FgKR\nhFS5\r\n=utRK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"1b2dd1bab8cfc726b22cbad910c03c0ee3c5dcab","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1_1616171935038_0.20425472327787153","host":"s3://npm-registry-packages"}},"2.3.1-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"020a4d3edb4d855d4c64dd4317dc01747b76c9ad","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-beta.1.tgz","fileCount":628,"integrity":"sha512-kR3dHaE2u1tOFVgQGvij+nxE+KLlHO96FZnyo2P8kkPTjW8XUWWGQi6U2DwUd70W+R45NILY6hxppp5ohQo/SA==","signatures":[{"sig":"MEUCIQC8jvvXJ7OjWoY137UFDRewNJpLZVoUbA0O8kX9fyul8gIgSqLPdfNzymvtUTzN9I+k9frKuvgvvVwdlPg2kTtyPJw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVNPVCRA9TVsSAnZWagAAY/wQAIJDNqrN41u52CoeOQs2\nzdxBdXffQPtjon1dzKhkxyCHSNb4QdiaAL9XMPJTzMWlfyQocKuBRl83UetF\nZH1SgSejjj4ySi4Na/fgLu6cck1PGQl4B0a0Z5bxaYKK7VUGHwnU9NGqK2SG\nNx0vDeo3lywzDo/kc0SnzV5JaDwg0YKjj0sck3yj0A/GLnCH8aRElvGp6k9L\na+BZLWHRF86SvEHm3+6ba5kbwrum9c9ZLeBPN7fjXPumorBjtWuprfQAmI17\nQq1FpOMAam1b1vpAE/Nqf6EAmIWUh/0f3X6Z+irtz+XVWblGfh6CLShQcIWi\nGy9krRu8rDFyUp3g/3meFYgh2cY52igJDduF23l2qdAX984b0qn7DI/dYorw\nM6rZxIduAlofYQ/Q5imsFfhTLj5Oj99hJW/0DPrw1oBYS1VTwISbBc7V68ov\nmj3jBGzFzlGImLQuPRmtJgw4Z7IaoBry1adW6FnNKOjv/fKbyl+iGoQ3Bdqb\nqw94GOuiB4GJ+O7pjDCFnLGWH9E2KlKVWog4z2as5+NL8bZAt/sj48d/Jf/Q\nufpcSCoP3u4QQadMFbmAeoasXHyihIwJYqNY3rWE2fwYaZNe7i3YgbYKmwP5\n4quMDNLkMeFg1Kffany1J0Z1VI7ZFuJb4REpk1dZH4LPUer/ogAyVHZciFH/\nc34d\r\n=XF6W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"57fc6f81ba3621873f54e5be2dc705cfd3ef9753","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-beta.1_1616171988166_0.25055007071395985","host":"s3://npm-registry-packages"}},"2.4.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bfbfe13d1959b1a183d4b163bb5f534d5fe9095b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-alpha.2.tgz","fileCount":628,"integrity":"sha512-xYUKJadvOZ+0C+viQqoVS/o8Bio4dxEzeEGYYEIs9CFLTVCNDiqNXygHGhrzYGjlYWTtLfKW1mXsMdFrDf25zA==","signatures":[{"sig":"MEUCIBXcNxmXqisanKYXWXrFkh7lf/UL038HTPkE0uClgBFPAiEA8f0BNmWuJPZLEI8Ka4rbhm4LxgpfYGvbBMyp5A7OWUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVNQUCRA9TVsSAnZWagAAvQIP/Au5EfSeXC5cjA0+bcqa\nubEOU0lzDDIsqkltek7wH3TsLnXY5vNoQOvdoxL82pYi/DrzAddH2A5N/dcx\nfjTzui2PIwpT9pni+daX5Wy8oDZWcGdTuBk5DUyBb3DNk+EjKBudCdoNtT3q\nnvuGexfHi9eVPj8L5UrqF2P1VWx3UCSe4aAIk2m0CBSVUedQ3JunABQnSyNf\nIx0Kw4N++pV5TVqnETqQn2C4wgJkDgaLFbbosazqfrNS7dCWmeY4mK83SIPt\nsFnzlQcZTYrfIY79iaUqRGqb+7+jC1/+5HYQyBQykfxYoTUvcZJO6Ka5eYki\ne/xeemKXpB0pD35zMSoMXKGZmqyQYo5IHbAxTDVxHNG6sJ3yrve1YEMfhy/b\nC3XhkPzw+72aKdpYdNxcydvPSchgkQ9RpxYiQ+CxcbIXXOUEXtZIy5KsR65w\nDXvwdMbctcCEWqFRYOAWeO4ZbZtTRy25No1aMEWKWBMRFYN0eQSAzaWwZ8vj\n6abD0jfkqr1/way6ZLBQYT5+CKNKunAepy6HSBT1w3K0S1zz/BZu641gH9qZ\n5/r2mX8D6CJ4t4/TKpLBT/uZ2H2Kb6TGVP8Yd3Rfx0LFSLwqXwW7h4UaCHQP\nZnyS9PjhprwCsO4Sal+CwpTbe6KTpcKs/t7WOSXW7Efab4wy7IkIpMed92YD\nhksq\r\n=errz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8c12a885fba63d150b20c49c8c549d5a882db4cf","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-alpha.2_1616172051464_0.47211608615033973","host":"s3://npm-registry-packages"}},"2.3.0-feature-ae4949-kmkb41pq":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.0-feature-ae4949-kmkb41pq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.0-feature-ae4949-kmkb41pq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"190e6782dc805731bf8d26406b2b6919e994516f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.0-feature-ae4949-kmkb41pq.tgz","fileCount":628,"integrity":"sha512-NkymG2qiF/QwJlcskqHDRCS6jj3N7ON62rwnWhY7sICEsoh5zpw3IeL8HdO4Zl2L5kMcOZevKv16/uNWWOsY+w==","signatures":[{"sig":"MEUCIHEgxw3KO9zM9TF7lrrCDTUAwl6izJDixioB9jwNp+GIAiEAohjhpu41WgiiAVmPtpFMVbZw8zxeouUUZfe74a1v7g8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":747605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWFB/CRA9TVsSAnZWagAAi/gP/2QWoKaNY5x5LZpWIs4X\nsrbGZ9D9BNTaeZtqzmgPv8qnbX0Ga+pnpAqWnmV/9XBH+Lkij/0F503kefHV\nacua1wMZeCUkYLxrkfdFsLhLr+CDObY+zoL3CXIxOhXIOId0DMrkfhrXoSyE\n5LJjel/w2+hhstzR4KVM3vsBNIJ1BWnLbcBLR5mar0W8mdD5LBDdk0oZyi4c\nI7nLXsELsoG5kk+GXHVR/uCKWifHaZ/HkJLwpJNr7Bm7sgpqhinqL0j/Wi8R\njjUQnPC6R0Q8C0EqjI7hir2tXJ7Z6BdY/YmL6viG5ZK/ZDOvtsUjSGml+fde\nXP/8ehSgR+AeTIZIMeKxGruB5dv2veinqWZBc+LnDweR4SjyCvAClI6OE0VH\naiheDNFeZnp8Drxof82qQGvyxChedifeIDK6p3VeGHpvTIKFPkXOzcEEAuGU\n0IIqV90sbQZs7dEXgt5HMvAbNZHMrT1VfYe/IQVOhgSgLo0g6luAOOxXOMEX\n0xZurNnkf1gxuYi71ldnp2CDxjzgOa0FjAPNY3gK+WUWtaiePx2oh9oSCrIa\n+CufJh0uXwV5GLIFO3pM9VsHoeNrkhdWSEXw6Pi4Hl/HAufgtIDcTqhmbNDi\nExqmJPUXm5QghMddTWrquuaoXVhWKB1OgkL34Wbo6cvQfD9cCEmocbLrc8tR\nzWTk\r\n=+jxW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ae4949f5b71d82c6bfa45513939886ad36d7d9f5","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"^3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.0-beta.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.0-feature-ae4949-kmkb41pq_1616400510505_0.4135098352536235","host":"s3://npm-registry-packages"}},"2.4.0-feature-27ac61-kmkcmp8q":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-27ac61-kmkcmp8q","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-27ac61-kmkcmp8q","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4360e781907fe1bbb5ff39cbd6f169144e99fec6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-27ac61-kmkcmp8q.tgz","fileCount":628,"integrity":"sha512-EY5FJ80zQj6pD04c3QbkqnCKisi+1jPGUDcv9l7kp9VUZYYtT7AXJGS/sGMTmAhW6tQA3avhER3TkD4lHSGcUQ==","signatures":[{"sig":"MEYCIQDK3dbs0NXUh/2bY2+3VogaaSU1AJqPcck/hGI+MdbmkQIhALVEOzpcfDHvSYcttJNuoxu0I382Pxtynlb3+SLZJz62","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWFpzCRA9TVsSAnZWagAAOrsQAJWMGKfUFs6K0c6wU9UX\nPw5sdPWjGYUDCL2W/2ZGBTFmRiFnvctvijaMHki9mrpc6c/65vmiVJIn7rVN\nB0JOEPDC2bIZrkaspKGWukDvbVSU7xsW0KcyRpELup1g+zZvrGdyO1fGGQqJ\nWRCDGbzbr2pEYrfzeKTGZWAwTDomniLc9DGDd4jBA851mOd2WEFHYXUy3Ics\ng+MYDpnLyqXKiIiOsYlVjTAEV7qftPFoUux2J6P+Z6ssmoSx81s6b4H5mXms\nUEnTd34gD5xqa2qDwhbzeOSROPas6pbDADN43xbUBEByxkRbYhOM8UHlblXp\no9ayXqdvlk0yWdW9zNL/ixpqpN4Q2z/M42dt/eNEQCB3ilRuoePyZwBoiud4\nru4HnGHJ6dm85E8Hi24MMrkg9gvKzB3MRrOK8/cfJ6Hh8Gz+w9f4y76bpGxW\n5YXMCmpfR6DLvxKlTSRXC04lispfi89v1dqMlT8e4lvsOILg9btAwCnfWuSP\nE7qt1ua0uCS47fYbKjlmIRG2MzVqCfUm/I5/eflN3/hk6uEjYvBb4aE/KOPk\n1vf6It2zQQ/qkjb3YnlXKHN7TGpkLtD1ROpUed+W9GCscKOk0abzZmrYWe85\nK3IK+bxrm46ipMTXAJHmG1u5tUPzBefULFqULqLz3QertIMEjY1HlWkZDR45\nQd3J\r\n=g9yN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"27ac61c1e90e22df107401e8d119d163936fb988","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"feature~terminate_process-instance_before_removing","@atlas-engine/process_model":"feature~terminate_process-instance_before_removing","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-27ac61-kmkcmp8q_1616403058542_0.5934638142984123","host":"s3://npm-registry-packages"}},"2.4.0-feature-8ea21d-kmkd2c3m":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-8ea21d-kmkd2c3m","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-8ea21d-kmkd2c3m","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"307d2d84a651e74acc30a2633f29434fe2a6a6da","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-8ea21d-kmkd2c3m.tgz","fileCount":628,"integrity":"sha512-Og+P4w4H1zxfHGOjCuIdgQzE+zJDcib74tdvuR6GOx7o66aqiUHVWtqDIz49UGElrudIsA2BDm56dcENe3FrGQ==","signatures":[{"sig":"MEUCIHRve268UCxNnOsKa60NPFz4rYXI6crTvhKsdbnK0GAJAiEA6ZvIfjTVmAJJskYAyKz8cm1Zzkox3D9jlh1loiMLFTg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":747116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWF1NCRA9TVsSAnZWagAAvDAP/1qxvt17GXF0Bo3WRbp3\nNMFt/QlbqtotTNQsiJvMoaFXA6dn3ASDg7Idr/XlzsZA08uM/3lXv0vWJm3/\nFeSK3HaAyWrRpiFDljeT0V3QP+p12c7zBqOOwXnhW1mS4RaNUrTjS1pWxIql\nXFIPXFBoPE0UY7JuZzSny2wfGR7UgmOaIB0+ZO79eHlRa0l3u41tGzljSVLs\nH3a07/QXhERrCIuXTYs77tzeXn6Kck/gqvta3VjJLzCTKzbgOtvLPP2W9itb\nXiK/C6TV61S/irF+za90/WPIo4yBDS34RaGwM3f3cXETIo887LTaenEe+K5w\nUENxrzm4ZrIGG2WcJIOy6PyJQuiQwooqGdZtzS/2jJtVgecU5Hj9qd5OipgR\n5hQ4qdVDKnEqdbtDZjFqcpperx7GOcDbVuts31iFhou4+V0FLHrOhk9OwIun\nf0C6Tfkz3gDVSrKbiBOYL8qfh9/DV/YgFXUd+YkLwksEgOW3hDPAWb+9K2LO\nrPrLiluCzvMbccPSD7TBkyXs7jaAgsC0vcQXpnad0uYRAS3rZX86+puknE3c\n14HEIA3WJB1v+qKj1fVZS9PyBv0tugdZWoMKwPrJftx0JB3knTkZWeWZ3OIu\n1QSR3/zkHqT/ZrsdstwTu73INFRtSMKB/gfJ2jUcqYFcTqPIgjC8rJOqzOWr\nrAoD\r\n=sHEi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8ea21d3b069a3f337162dc259b35504164eb0611","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-8ea21d-kmkd2c3m_1616403788642_0.5062579504431373","host":"s3://npm-registry-packages"}},"2.4.0-feature-0940d7-kmkk776p":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-0940d7-kmkk776p","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-0940d7-kmkk776p","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"17ac1755b16e3831c12f15381027293d34fcc363","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-0940d7-kmkk776p.tgz","fileCount":628,"integrity":"sha512-n6Yi6KZweXD3DkybU3sW14waYOnxWR5wmZVD0RdXB5rF4iGOMPkRdrlTPmGDTDt5KnXWE+XRBFR8ko67+lC0jg==","signatures":[{"sig":"MEQCICrFfdGbZqYxG08clNC8eEXChYZSgjvx96AB6FQ0jLKGAiABOqVqPrUOrp5MdxlQSlJUIukB2GFZIwAEHg8/1DaK7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWIweCRA9TVsSAnZWagAA9nEP/2GZ9X6IwtmxQNgir11l\nFgj2wha3B+jyjM5IMu+mEiHAc3VzUYHEn3lb1DxYvU4Fy1p849YMVy2IGP92\nhH3SJvC2sunDx4Q7TikyRmAtj0ZDcY3GaZGvTUt9klF/yjw88LjcwEYdE9/b\nmAZtkHw0DzuIG5EKsG68S08IpoRapPrT/hJnSMxAmx/Gk/12fjCse/l0alpD\na8Pqm5GdbNaq6AnCfk441/c++drfEEkWanmE5v/ibPyJLMZ+ftLXveZp1aF7\nH3NKKsjM+1iO+YQMT+2EJxF8LsKpDyiOPurcpeAQEjhWmpAf/+IVAdExoImm\n/ZLWtRL5H2GuWU1znH+A1dzHpVlwgN3pJUxMTEnwyfFzPx2YdDsINHvOa4bE\n24fxHMWxXR9WpnPRzaIGVe+3Uiv8V79iPFQAKyWFTUt/LetNPXh1tPQineiT\n4S33wkI2KAvZrvxHuvYPClZu+STSZLZszvnY7eqEq8JMju6Fc29vHU1B+kPm\nhRSAQvm4TEzOJyeKdGwj5On62JF/0hDmc6qiQPVRyYCcwdvLrw/pqr1kzEGk\nYv/mEwDtCDBta/rrxoudHyCMyVehFtDLPpM1Ar+wEZIQrzei4Iy7H1eR4uch\nESQ9y+2VhG678FQov6jUouf+mJP2qbEnmTI0oGfiKo29RWTF6ToIfYpVIpUz\n3age\r\n=hGA9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0940d7ab0142b6fae14439d257b732d082037a84","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~improve_deployment_error-message","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-0940d7-kmkk776p_1616415774490_0.7183360284659115","host":"s3://npm-registry-packages"}},"2.3.1-feature-6692a1-kmlr8pb2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-feature-6692a1-kmlr8pb2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-feature-6692a1-kmlr8pb2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7e63db1dce7ac31e20bfd174178580ba4e512624","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-feature-6692a1-kmlr8pb2.tgz","fileCount":628,"integrity":"sha512-Q1zsdNlQGJYuRGBuF1TD9tDLVQk5gMNk0cOVGeu45T3jgLvNrldLE6Cnk8V7BqqpQgW4nVECpBCs41BZ8gDH/g==","signatures":[{"sig":"MEUCIEjkHMI0fJJjgopy5IcbRqlQxx8B6jGkBX5hqZ9yigkvAiEA9pQhit5W3nGDxS/xcGb8IjF/bdjBPGQCIQqBmxfHKOQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWaaICRA9TVsSAnZWagAAFRIP/j/vwX6UvpXz5qDGj93P\no9dUIuEhuPvljF0UTu4tb/2tblVXqzb+ZVV+Tde0OfxraRSwXo02zDv0IluM\naq1o14Vx7PSDBWwZkNyYtpg/htDOhWDfwMrVO2ysuJJWFF1G31G8Kx49l3Pu\nkl4f4I3TXfJ8ZSutg1nwrATJe7JcaRqYM59kS0AfLUXkjK7RRPONNNHRXp4h\n0ONMlraubCapnIn+q+8h19XT3jndB+rRjOPIzqZL2fk5jTlbb9QlkULMSEu6\n+CAD+0+CJ43zR5BS3p3gTaWQsBk6GQrL7YTQsWtsfxAl/qowvmyuXi3oGch0\nP01mUPNRksCStyZ8nadVRNjc4FL0B/pPJABUGnbPiZY4c74bCdE5OzjfSaZ9\n6mWXvCEg5qLoJ9VkEXVaYcW4vOz3tPrC8WPc0dOKh0/E+JvauoAiDKz4wLjI\nuxF2Oyh7xSTfZZIjnaV9XQagGHGpCafhCb1f/kmZexF73HrLCYQ8t7Il4T3U\nmhKIKBteElD7oDbpxCUt1Tr6ew4bC/vhPSeHoN9giozxL4sPoYKWxgC5Crra\n4xdr75iQMRZC7MXgMQDzrAh++coMpORlpgNU6gti7FqZQyL3YrDnp/4ZOOTD\noLdS9GE6NsXSfBSCT+y6A5o60O399DwHQJOOnuL2aPo5XulXw76FtF6wHtTe\n5DtR\r\n=Uwbs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6692a117abd94761e955823fc5f6ef53d03e0669","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"feature~improve_deployment_error-message","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-feature-6692a1-kmlr8pb2_1616488071986_0.903066365300162","host":"s3://npm-registry-packages"}},"2.3.1-feature-0c81bd-kmlsuctp":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-feature-0c81bd-kmlsuctp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-feature-0c81bd-kmlsuctp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7f1f10d8a5bf2ac0d45a66fafd6fa76ddc4749be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-feature-0c81bd-kmlsuctp.tgz","fileCount":628,"integrity":"sha512-+9cb9F1yS+TWFwc3Nx2tj9ttRD5naOG6nB4bIr20Pjp7yNGuK1iGjapSR8FbKlfPOMmQ6/W2DVo9SS8onc0S3g==","signatures":[{"sig":"MEUCIE24EymLwR3xfXqV311oCOeT+0xqdIJbmYPEUgLvAyAfAiEA3BKT84EtyFXyQJ2QiL7rAvD5yNaFT9ywPgXKIwcSWTk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWbEHCRA9TVsSAnZWagAA+HIQAIiGgg9r5ARGozh9DLJO\nTG/Vog1NFu/FFCQENMpoH5FJM+wasDH+xlipWxTfSYdD+Xmi9hWpZcq7gL8+\nfKD8rO7WsxdxeE+xlGzCaDNqRhMzFEQ1xpHkwLUZ8k/Pjkm7KjRyyKSzoAAu\nMKjA2mRbKodIUGDaExNM5wJgpV/4Z0LBzoN5FpGpUVYEW27S/TFtQKrUFa4z\nAQjIAfcrudMWNI/Hzt+I47hVe8R4jD8/lDZq2vG9xk7BghaeTSBBlYvpWcEq\nqpDpMnVqXeNlnkv915KGa0+xWhASSvFeLBrRYF6PCutkVRo/4lIjUmTC+Iah\nare1dmpiYN1akTXtG57fKAhuLupJAn2WI8e7NL5Qt2Xla8mxYZEES+ujb2BK\nGFhKQgArak7RW71AsN5wiHOEmKMdw8f/lKf2jIT9330GLBA/Zni534UChJjd\nC2gsyj1vlepE6bkmkrZk1lXhOpnazcezPnTHdSKSqhqlAQnbgrh3WhObSwGE\n+bf7EMC3f4YeqSVsdoFCfDaDnH4LOvEMuVE09FoSJETDQLxwOD6PW66WB3Ki\nyqPKqSLjQtgw+ce8s/TFhYKdFPc+b1q5bXM8+jwk3z1r1eUxMFz4fdL6FY5/\nBy3yXb2Eqiuvf6nmn8zXfPrUQTfZj7KgSzRn6TbVKy/vqKYUYu3Ek+KORJYq\n/8V+\r\n=pxFd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0c81bd19f251d7ade91affbc39de6795f316888f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-feature-0c81bd-kmlsuctp_1616490758859_0.8924337527953208","host":"s3://npm-registry-packages"}},"2.3.1-hotfixes-2a2404-kmlswu51":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-hotfixes-2a2404-kmlswu51","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-hotfixes-2a2404-kmlswu51","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2aaddebcdcb8ed01c161b06737995d9e984d88f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-hotfixes-2a2404-kmlswu51.tgz","fileCount":628,"integrity":"sha512-eXFpDG2zhklUJxj39ENttKXTYWHYqbeJSTozL9mmMn2bHac1niWM79fcB2y73iYQ+oFzi9qeMU88LeiP3X1XHw==","signatures":[{"sig":"MEYCIQDyqCMIX9M79THGmoWhWgZFL5C4V/ciTD8jhLFbWE3cqgIhAPxkOomtkwzUF0/+YIXFJqDAjYxOaIjq/UaiUFniRro6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWbF2CRA9TVsSAnZWagAAwA4P/0IOiZeZApUwCAviupSs\nzUGQuLYtkZYWxXgvtmanTN5Fn6JAK2OHogO0Qmf95w2WOXmQcHPQrK1jTVZ1\nemZR6H+qUOIKUP+3wh+Q4OK5mXIeNUTqPjhhd/eBJGHjmdUVP4zTim/vjARv\n4rX+3qjXESawOelAparGJyg2k20M8Vt0OM30jAF3RrTdWCqhuW8yKaL9Z9k5\nzktWLLgg9ZZVcfpfVI610HYfJMH7bL8yqnZ/9AwOaMWLgL0DioGboma14mZU\ntgz4tf1ArnRySF9rT11B2jwG9p6gf2r+rca7yqLXvn7A7u39xD0hYaZilhrs\nh4ZfnnE58SJz1WtFE5doJG/H5bya8kGncbk4ki94WNggpgKHUZUlPkajClDt\n3EAIsA1toM4Tyfu4EzJcCU9BKc4tr+vZNEvdDjpN0+ZnhlAITgC9Xcrj64OZ\n9jlNpFflaALjJAj+hXOtdxpYAPuinSULzhgvBZgXcSI+ohAr5N975UrfI393\n8mKaQkp3Zqvx+q+wQ7/qFDJEuf0YfyD+zw958JGf9AuEIJg3gAs9CN21lHDK\nfOZEbAoPPq+fH05MToyIEZKSgBeEVmG11X2LYCCoDvpsMpAWQ1LQ0KSV4Fp+\n8Ewyqtrf7GMJjj5mOgp9E91+4hyc5sjQHBFpPtOaGpfRQA1Awwm4xqxR4V9H\nbN2q\r\n=BM4K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2a2404f01f7db69af9812e9d3e81ceaa5fc9162b","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-hotfixes-2a2404-kmlswu51_1616490869701_0.5616078076402522","host":"s3://npm-registry-packages"}},"2.4.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"48b3f422579a4816af9aad3b884f0489b3bc4a92","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-alpha.3.tgz","fileCount":628,"integrity":"sha512-s44WPjsUhieaEMmJgPDDLhf0mi08SClzNWDXGgGHKqbNMncCPPM22+4fQo+0UU72fCZjrlzrk3YzBGYebnwKJQ==","signatures":[{"sig":"MEUCIBeKA0z7QH8gI4BbG/Ge8HgbwHSR07K96NCrgya7wI6jAiEAmdewiUCunjasF98ilSOv+CfEACDnlKt+vKMPeDNtOB8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":747100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWbk+CRA9TVsSAnZWagAAlpIQAJF7MFImRddUVHwF0/5X\nLH6CQzvK6/7aKAKgu0BXdTOR4a6RkplMNwK9apnoL/7xL+Q9ktuRL2djpkkk\nASW811rxlZuDceWSZZuJMGKZRfTeVV9WRV8+acO8NR8u+He/LQ55P6Fn9C2s\nP3SVhSo7hV43bQJ8K8gFYfB5F1C0JzvnfkIfbTkyLiiMtJ3RVPMCgzynXNhz\n6eCzLN/YXX/BpZBqRs8q6CmpaGBKPvk48Ni6uTOHCxvyrwiA1F/2V0kZxvJX\nHerFpbTJYvVZjJHJE0kMHcG8br1/WWihOmwBhg6rX+hDhOTYSyMwAG9yD7xd\nI30GgOAIYHXsDZFgGMbfHh7SIcSC+/K7b49rTxnkIvmBP9LY5l0U+6vEljL0\nDOj64j37REBMQz96QCLv/MmGnCa4qfdOoz/CUaYv2CNi899T0RgQASZq5t8n\nMDZRF63/Y3CxF3MBFkdJreu1n+EyCt7I/g+XjCqYaAjY1QiZGFRM2mB816x2\nKuRrueaOX7tECiEu8qiwailSn7p52Eo3bOME6SiSTv38KrzAD1aSQeSyMw7L\nYtNH7cre+C/dw9zQZmP4bRW93ELCTNLroujGZGaOxDuKYYlMpS6GJYkdB7X8\nZ3lWVfr6uBqx90oNYD1okDXC/NQxTXiPzUErIccsVHG7eRIcfZ9BWyahwfY3\nmIFr\r\n=ORMa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3bab4737beb713527d719ff58dbe524b5f0cb644","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-alpha.3_1616492861723_0.6001559904775167","host":"s3://npm-registry-packages"}},"2.3.1-feature-3c704b-kmlyfgdj":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-feature-3c704b-kmlyfgdj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-feature-3c704b-kmlyfgdj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3cb91c71833704206a7acc20ecc1e0143ba66033","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-feature-3c704b-kmlyfgdj.tgz","fileCount":628,"integrity":"sha512-n3lSZ1xSEoXYoXDzfWRFm8FJEg/jfZ672EDz8nZ1F0tcMoYHvYK0aEp8+DzgGfxYDNunOy25Q4ACMaMlbhSw2g==","signatures":[{"sig":"MEUCIQCOkuIyckbhwdNrp58l8Nw9s+tkCn13Mmtk/6mvXcu6lAIgQkv319TxCXVaIpqmfB0YO/E5RHtBD3JYZL+bwCaiKqw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWdWrCRA9TVsSAnZWagAAVZoP/0X6vKdaS9IDGt0PgccK\n8CVmzQ06DYmDtXHzQv/uoaKm6F/27h1k5y5Palzv/JOtTBQS5MW7xK0vfamc\nZXdnSmYxKhuuY1dnZOO0LhI623LY1VYvoQmXYgPlMtwoIB5kYVUK6zYYzb7J\nULMyE7n2bqKfStzErsbkM2fkdhlDwconK58EinjZHN+hADsOpfqxR/OtCrta\nzT6QqQ9X1oaREteJWTGJK6V1tZcDbrhGZSjO6E52AHCymXGJgscrQXG6PXIl\nKSQ0zS1SWE+8a6XO5voml1ZN+oSEJLdyOxq95B2tcUYl7vDg31R+H68srbOh\nL0d0jZdPrDE47Jf2FIg0gGcc8HHZLNXaTVpl8N/plFvCowF0PWMAyJdnkY4L\nl5LTPIr/e2IYf5BNr5ohKI14lKKkjGUSgJSbd4k8vxS5xWX7hR4uIyMej26f\n2R2sj6ZCUB2o+YCF0TPyCd0wbmTM45FKaQ/N0Nwm/Ws6Yq9NPtZ/q0VGKPKK\nQf8r+ed4tLvWaNSnBGMsT9HuFF4s+2GsBULdvDw95giJPYwOUclcr1xY3iea\nOT2qGwDXtUbgJ0TB9h1KvRY0ITDBhGtj+dDvpDB0ED3Ppsn0Yw4ayIMQ7PEy\nR1G6aQ6mFagYRO2oNTKY6U3UwmIVl6G6USjwdL0ZOOzkd2LNcn/IF3Ofdsld\nXkZF\r\n=LW6I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3c704b67cfca0751502498a620daf41a05cea3ea","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"feature~terminate_process-instance_before_removing","@atlas-engine/process_model":"feature~terminate_process-instance_before_removing","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-feature-3c704b-kmlyfgdj_1616500139339_0.1712011548649277","host":"s3://npm-registry-packages"}},"2.3.1-feature-547f71-kmlz6h86":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-feature-547f71-kmlz6h86","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-feature-547f71-kmlz6h86","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7d7354f2d96f6f98e8bf318f0e24fe91affbac4d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-feature-547f71-kmlz6h86.tgz","fileCount":628,"integrity":"sha512-RKH8nqwha5esizYvxoEUeUsYOJ1RLQlZK+F9hCC80t/t7mivdBMqdJMM21rw+eIy2rr15bSNMygnB2oNSOLYYQ==","signatures":[{"sig":"MEUCIQDcCvw5konD9qwA+madvA6/UXYflUJyjdsFFnFhDZjIOgIgPN6ZBdyArrrwU1OTfO2zYXr/EoJ19iy2HSV747NiTOs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWdqbCRA9TVsSAnZWagAAWG4P/jh072vu/r76DgkOwUzo\nnDpUQE8KQ7PgsQhVN3pLg9kXjs26ySNe2l5WHzRvkdzvO0krEqGGQ/FNqNMT\nrkOujZL38W9F+qC3F4PbEMLne64SZPh+fK4B4tOkamInjz0SOuCz7lNNS47u\nDNFscbLRiP50x5ZGytGn+W93QOaix+/JmZHj5yfpNVrXECszW5Gp7bOY2Oi/\nA5Kws99UnSqqfvV7iAtEMVaJN0xt7DxkLguZ9Ix0V0+2fmaPDLEYKdCrOYFX\nQeJDCh0Qw6S+f9l/Vs3SBORWEa5S6zFfsRpitlxbXBwRmg0kGIEB8Nh9v+F0\nBOH1SJRntQLmCJmlO4JVyy/5B/Bo2d/Y93bzWYFOCVXpjQavUuS6UdAfg1JG\n/nqW1SWCOo4cSvYtVLZWfCdzXsz3trwSme4ubrY1Z0WdPVvXyL4UI+NtU6g6\nyt0CIcwNjFxBZtjl+0RIHOl9vInySdn+Eqd1VCbYiLGXw6ldV+MV/DGf5kq5\n6goHtw9F9Vwd1g5sNr1AMGbRWa1Tk3F97TudWsPL2eAsNXZNMxrGUjg4XGij\nLSTRd+l9y62keAoQeDL5Ru7bxM4+NwIos0XIFH0P+0PSeZleGcCjWBQvDy3a\ns2P6/2cH9XLcajXajOGajtW76Gha9hDF1wgNPQ0UsGq7V1EZPWKLmg/lkMLI\nwcQ5\r\n=HwAC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"547f712161118b685cdb36d7367e2455e06787c9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"hotfixes","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-feature-547f71-kmlz6h86_1616501403167_0.9061556097615711","host":"s3://npm-registry-packages"}},"2.3.1-hotfixes-8717de-kmlz8sth":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.1-hotfixes-8717de-kmlz8sth","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.1-hotfixes-8717de-kmlz8sth","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e4cc09661c72bed2a463777c679206c5a2a5a1b0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.1-hotfixes-8717de-kmlz8sth.tgz","fileCount":628,"integrity":"sha512-NkSvVHb8gHKhrnkD5tLS6OdwzIbSGwl8KESXSBv9CLijX1gS6z7HZ9ejMfxIrXM+qg+bQeEhrAapkovkViGXDA==","signatures":[{"sig":"MEQCICLuWDWEf5tba2iSr4c1FWNgArrYeM2S/LYAJQ56eceCAiAn+tZdbS9sPLXSBSlLK1befstIytFKBJse6llnRiNXpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWdsICRA9TVsSAnZWagAAkWsP/jNwRsNRuWTadN33lEji\nI3haTbpyG2CHRdpGQc2C+aM8UBTiHILYOVpCstMwud1BDfMsGqOnLnsjeb8g\n4bVtOy1LKwL8xG+vKSZPWtiFh2ISvbQ6qOLggwgwfeinIDcD+lCINo3q/EJ8\n5MJ/PsA6uJYs/jhKdTjOayr2tVtyy/jGkzcLR19XihmTC9Z76c/u+9g60UrR\nyS6+xO0duzo4uQkQSi9kZ4nQqvexptMfv0ACuvX/VShNSYgsTWpAE+JjT7OS\niebaXUDtzEEuNK2A/LA0Gs8ruNOKLOF1RD3ZkNazVD7k3gY9TXvdGpR9mcCX\nsQbBd2QqSoKo8o1frWvH3u8Wxn8XaQyaePV0IjxW+7doJQQFeGaUAygmVDM6\nqpXIVYKalYUGSAwkBNh/+WP/yG0ual+Yhhl0iTzwvfyrrcF7dxr86GUVSaoz\ne5v20ceuIC1ZR7IPYF9JuDafM6zxFXnFHN2MdwGhWjUYOGzA4dwzApAbiTJU\nG3Kr8uE1xrHQ0NsY17oD/mYRFnoVRIzDXi/pQTflF/p2Oj7pwi0CI3Wi27N0\niOsJzQDkrz2gBLi8JS50TiQfQLi+LomK6I1axoml5rCOOrr2MRkfF0OmgSUJ\n+RA487UpFbwDDEhNVHSO2Gb3xxfQmJYT8iEGJ3pWz41drVVBnZAjSxG7b9YY\n2B5v\r\n=Dfn0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8717de0a4e48019b54944de3ae75786df4af91a8","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"hotfixes","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.1-hotfixes-8717de-kmlz8sth_1616501511769_0.10647304881360964","host":"s3://npm-registry-packages"}},"2.4.0-feature-6bec9b-kmp9a2oh":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-6bec9b-kmp9a2oh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-6bec9b-kmp9a2oh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"68c1d2236945c711bf8d4c5d4e278af4c99b2c28","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-6bec9b-kmp9a2oh.tgz","fileCount":628,"integrity":"sha512-C9EFKSRIuTFPKvtriOO6pKMJOTM+3MJf7HJU08gEEzVszif1cedJ7IOD34gcqcdYuhDGb7c9XhSCRu3kJ9i2PA==","signatures":[{"sig":"MEYCIQDlTetCxEfjpzFI+OzKIZ6Hna0JsBb0qd/Mp1Va1RHzUgIhAJBJ8P1CM/+0CTbgKmHww2Bfy41IRrVcQ3OsaK8GqEc6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXOFxCRA9TVsSAnZWagAAayAP/37xaNh2RBkjQSmu/oqX\n6QtbhFutoWpfFEwsDaWwrbQqKmLZo1vyZKuCsJWF7BsfvBTvblgiHTrbpaM0\nK9OVpNhq0UahUBOIs8jH4e9yrHWgjSFf/fIs0mkIN25AuFB8MijDna+HT09+\nmxgg2qGAGI6ITjm4QJJ7dE8T6GzS0bmHDjLI7vYuwBtN3X61o0Q6zQYTvU/8\n5s8wJZiCkHry69nVon1QQDcxOuDEq1b2A/56OjFoAdreXh5Yk+1oHslrtdPM\n1vCM6fmnI9oYsiY9l4VswshmEXh19MgaXG+o9C+lb4fOstrE9tAGMUf8qGqP\noXzFTtgIZPdEz/u77b+c3/Ogyytfc4RttpduqC6YC9FiJ3YwzSuXQuelW7Bs\nuDagXnVDLAlU+Hr9lPLpTd03WokPhiREK8fIHKTr6dNkhNk9bDJx1EzeJzs9\nhd54N2kjKCdDHPV6SaHesNJSXyHsFxrQQ/qx7ugo9zd4CvfB4cFkaUpAwBI3\nlzFG737YuwGg22nusenrCNTayQz9jnymjTdUPBTDuOSkWtzvamvBzGkiF1Qo\nNxZoVdxCjIN6PZjkRTdx0z13tWMt2RVGvmdyO6+96gcVUGctYTO60dn3/nuX\nfaL4l+269mnUWU1qIRY3eEnhpDxTnp9iwsWSk5dzsqJINg7QCGwvb69mKq2V\nyXoA\r\n=SoRY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6bec9b8386c12d37a8a5b6cb4bf9aa34b528a83f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-6bec9b-kmp9a2oh_1616699761187_0.48711494407682787","host":"s3://npm-registry-packages"}},"2.4.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c9e752bdc8104d7348fb6ffc3b2f6c667f2436b8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-alpha.4.tgz","fileCount":628,"integrity":"sha512-Z08+3klDgEoae4JgkQbhcFVvKATtDhAK/U7UlfWkK1d6iOIJOHasIpRxrwULlwPaY+asySPuFCfZ4+38SG1nuA==","signatures":[{"sig":"MEUCIQDhlI8ugpPnnJzyvqgu97FsQh47KotHnAPSxpzw4UqyAAIgN1C5dQPgOjS9L2EgqhYtp3pYHyqfTC2Mp0qrMMFeL9A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYu22CRA9TVsSAnZWagAAnc8P/i78jl0m/5EDnFOGkDBA\nlcDlJQUdMWQS7HWIVse4oefcdIrv6UmyYU2oNV0OmXKD2NT8z0dUYmtox6Oo\ny9ABfxib5/ifjwBfMYYeeXm1BK/TL0fB34Nz3pSDGunzFPdsb+xM0W0OFK+B\nroAnmrQFxaFdi1F21nFMFDRUc+3ZBpP8sSqklLCiyVbM+Hz6MegpT/c47UwQ\nUy8BeiARlRC/rBc2sM1MdKvDv7aPlXOJMqpvdTcwd2ScSds1yKLMSO9HBj19\noLDgOPrjb0pV8AqfHqMD8hDfCsS3z8SyZpfi7LXYIdTzuii3k3zRFdL1E0a/\n/3TajFh3hQauRIUr5Y2FFMMYo6uJB3zQ8n8Wh1JUFHU6d9+63G71p2IfK526\n8iWPgEmhWo4PRGYVLvsrjzgQjnoI6J3aEoULfwY/8el/erKxdlOr9bYcn9n7\npYvFUF1lanz8GhuDcchgNbw9KuJ/IxX2zB4zDLIUWdU0TAgoliEa1p2ONzbW\no8Bnpo7ljKjcyQtfLX7YnMh4R8tIrS/ONYSJJS76zLRS+MLdNtlZ0v23a48C\n6Sva1AFS+kdd9BdjmrPlJADhJ3GMSyklyp6QesBEgUwzCHJuJyOtkDi93TI7\nh6jCDJFgkgpK8axQFBwHgGw8Zx/DdpwQmg2axhVl/E9V2432O+8IafFFoKjD\nK/Wd\r\n=CZ66\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"da0ad1b3833fbb5d4a42120fc63e2f36b65a1f57","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-alpha.4_1617096117669_0.9136391162641526","host":"s3://npm-registry-packages"}},"2.4.0-feature-4fc2ec-kmvz8jl0":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-4fc2ec-kmvz8jl0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-4fc2ec-kmvz8jl0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"89b845c8669995f4e10ba2a3fa5e5822d94476c2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-4fc2ec-kmvz8jl0.tgz","fileCount":628,"integrity":"sha512-9A3kIXVyODNIEBGgHIgoFV6ftofWHlLJ0drUqbLYlot+/lhMTh30qgPKJqGoS/xsWtLiCkFnBhb25oFDpXVVxw==","signatures":[{"sig":"MEYCIQDqaM4egPMo0PypuL9lra3uzeM2rEK3ttAmRko5l7EvQwIhANWBv2tOYjkpDAWOhYpLfDw7E52IuYw+IEmfvQvKpDnW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYxTnCRA9TVsSAnZWagAAu8gQAI8vGUDaCeCQY+dKzJm7\n0+dix0QVWzPTO+yf8pWHynKUrJzITXD/9pYtzzVl/65J0WMGfMJOFeL4smL6\n11nOJ08jzWDM3JekMdDi+NyoVwOchtWacwBf4mjNswymKN/DjSNRN1KODOyU\nzvTUZp/6k1Ccxq/3Tw73mj3cj39NT/KXROlRrbUbDsvUV653/6wHMeFd/a00\ncHExflhTYYRDOhNBvglRUyYsnnKYLBxTQoTlCWCbFbS4TTVUCJPRVY8I3nNo\nmOOqB21t1PxqoOgseoc8T8WApyWsYAp52HDaTD/qbuF8wHRnpwLtdtj/i2Gt\nreBgTUT8pMCqGbPc4B16cb+OoHIJwzm7V6Jxwu2rIPwm9Ooht2aKFB1KbIGI\n3JpsJEPJml1PzV9H25lKPXJ35vLdW/uviRLj3g58JBfCrQYMiGHKTlWdar5g\nWa5Qvz+szt81/+5tqG3fZ+rwCtVcDAcWhPn4rHkUg0Tk/+wxhKE3EF4DcZh3\npQnb1NPs+6JaSrTureHJN8NkWl1BQIzAmgxtoND0K7URJH0/z2a7v8GhLJiE\nDef+7nZJi/xz07UBiphToBrk8exMvD9vt1zoQDRShBc2XLJglBE1B2Ik/t8o\nBPN1+zGSitcPzM/O9G5Uh7at3vV/7wNaIdXmMuR2/UCIiz9filsBT4t8KEok\nWUoS\r\n=hsKd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4fc2ec2ff8d523ed5dbc53f2a1cb030ad181a7c1","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.0","@atlas-engine/process_model":"2.2.1","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-4fc2ec-kmvz8jl0_1617106151037_0.3100979662570411","host":"s3://npm-registry-packages"}},"2.4.0-hotfixes-cdf151-kmz3cd51":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-hotfixes-cdf151-kmz3cd51","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-hotfixes-cdf151-kmz3cd51","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4dcac120b77feea5df43d5ed7c8a70c3a6c2f872","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-hotfixes-cdf151-kmz3cd51.tgz","fileCount":628,"integrity":"sha512-1mc1IV9RhL76BLYN/p9HCphkRd6KDYDHM/oeX9EQY98l87zOS0x8IPfNyID3EZ9buy30JH/4KfyZO0yH5uIofw==","signatures":[{"sig":"MEUCIFYnIAjxdCuVa28I2aXQIi9ZVNqwzcb61iHFUsnQ8zy0AiEA7iXR/cCE4wyFvAEFeG42llOXn/CAMOFe4SZMJwad+Qw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZfR1CRA9TVsSAnZWagAABWwP/3JG2UKXWynO3KQeNH/n\niykFHTc4EjireGIfBFFQq5nKrhHThT3T4s3m8kU7xgAvUGeJ7LYlWRMPwDuW\nQwxFVqYoGVLhVFdXM6XnoHVtaxb8vs6EFXBG9fQfN8YmCOXsIPXt8KT3yfwC\nBYmSRfD7dUW7pYyN7JMgzelca2jEOnDXbwNQxPZr0DLiJPgjBh2VipHDxFQ1\nl4aC8hWBzCvKc7ShYDrNlaWx8g4Z9eQ5CBb/9dSC/0Yc9MO5Tm96I8Q8RTAQ\nTubi9vR1RoOodKrtte418BRxdp3DdAyfX7+vsXHrRMBz9UpGOv5lzeUXxWhG\n3Q7Hs6HyhX0BKrnJxXwi4y3YuwRRI4KQTTrmayyavFy/Iv33SD2eAJ8xMYOr\nTlgdQ20GRwAz+X9z9HDdIRf8k3MvAwNy0s365YSwViael8gIVmT0GNuZLSGJ\na3xzdslNG7Qu7gnJw2r1lXfTB2TrMssV0oNQqKVAxKaJzodIh4CRJ++kGrWk\ndvcR/BOHrWYcyTvXy81613JC57dMd2XdOxob8puaZt7BEH6nE0MF7cFTtfiP\nNVGixjDi+Gf6tdWjj4o9ERgvziOMPPuK9TDahfpwKyaH0RZTWOeSX6v0VwQc\nk/VtJPKQ21GOUER+wV3Ksobk9HCLm81tBEVVdx8RB4obxThhENJ03Cj41UrP\nV6uz\r\n=UWTf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cdf151801a0476f5d4da4eeb61857ea3d4301ec2","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"hotfixes","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-hotfixes-cdf151-kmz3cd51_1617294452088_0.3813307737675209","host":"s3://npm-registry-packages"}},"2.3.2-hotfixes-06cf07-kmz6ntql":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfixes-06cf07-kmz6ntql","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfixes-06cf07-kmz6ntql","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6046f8b6651cc538171596fbb7bc04f030bc6be5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfixes-06cf07-kmz6ntql.tgz","fileCount":628,"integrity":"sha512-3Y19H8yYZItR2b5jXRaV3tntzxO0OprEYJygTH7VSySdeRCU2NV3eJOh5SUcU3hbj3X+d/MWNqt9Dqh5mL7keg==","signatures":[{"sig":"MEUCIQCXt/mLt6kglwMnKLFAHHxlMa2x1552NUw0ZlVzPWVCLwIgL0THbC4flOxohGIMEvLVz+w3jLB5Ttc8o6EZ+MmEFSA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZgo6CRA9TVsSAnZWagAAOgMP/RlQvPyi0N7QXunka93M\nBBagnb2uwo1bKh151xUaWfMCIHgW8A3qiKuDaErCC7v+/kp2tyw92hWC9TU8\n8iOsdkMAJQVjbmBCI+eh3eiRXXuvTCWBKUuK9KcqL1v6pvUuScA9uJeg7Gsh\nOc/Df9udbS+2x0hZP6cq7FNVE6RvpBTYR4lIShNDfp5YanO4ET+2rkO5IiAp\nnJfGAHDAi1lzJq3XNf/t8L7LKwP54C0OV9FXNoTEyOxLFJhd0kNgG47Lfd3H\nSKtoa0YAqiM+o5byflBXyLgsyc0w67QLDwzRRsQHUpxtvGtQXJqcOSXxxBe5\nzedahoG3aLyENDARWoFTUNSr0nJDfYIi9pO1njUy0e5FfjaNO06TrP+F0hdG\n7f1QjZb1mvKWTWJXe/p8n9e6ZLNi34HgEF3TTB9+vvSdjCNwthUnYl6uAFEV\nhx5+QsuSGGj122kEE1vJ/80FGoU9rZ2M3KA6hu2OpW122cpn8VAMNBA0avmg\nBYXm54d2kX1HwU/dKYIcHrb+FcEcuTR5KzpvZfHWlOKKTho1UDCn8MWUxwKM\nWIeAlYlgPdja9wUw/Xj5slycBnLwBH5+nbJZupcfYC5mPdO/72uQLeE0mgy2\nAlfMp6idqa5PPaJplsq7E3DQVzUMVg1dUPsVwXxBNucz6SlY4UZMqnZXaM5Q\nPq2G\r\n=A5o6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"06cf07a8b712fe80e2d941a0e636841c35908124","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfixes-06cf07-kmz6ntql_1617300026140_0.3885237753552979","host":"s3://npm-registry-packages"}},"2.3.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7c69fc43b092bd0a3db9fdc3adf3fe41af38cd1e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2.tgz","fileCount":628,"integrity":"sha512-MYMeueUr+JM8Xh49TO/T/RUpbJzEyGXb2wca3hiGhndn2Us77q8ELOTGd0oWig5/VmqOXPL34+O6seR6dx25mA==","signatures":[{"sig":"MEUCIQDXCOJdO3lBTXVo4bksAAosekBnoaE9UF93d6R1hOvQeAIgfF6xYoPaoxU9XM11bDRfn1haUURvCEDIrKhi+KD/JZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZgo/CRA9TVsSAnZWagAAQREP/RLHGflbMVKAI/ethdjc\n9qRTiq5QcnwF4HzMfx1trQ0qkX+yHqnva4oSUJUSTYHtBR09qe2+d/EdlNT/\n1lRaq2Z4tWuVZ0YOCFJxHJLgZvc9yOaJK4RFn6u2ZtCRWW5FaNHf3PdeOlRy\nz4kCTPAj5hRdZTnS1gTtIgs/zi+7HTrQnu5K2oAhLafs7VnQaVDwCAn3I4Dk\ncOTzXekyA0O6rivCvRASgC1A7wDjYHB3h8hyPv7dQ9Em3JzVM0abV26FCqYA\nVOtjPMccCPAFQIQkvCFtKlZ8M/RPe52ayQCJWJy+o62m8u0bGcrRF1N+sP/B\naY+ZUP5gA40xcw4a2Y2JCkvqaan7064VV5yNawWf/83a7il/Q+hGnDXB1a4n\nAzHF/Emly9tde9HkStjZtgZOPQkQCflzyl+ASdHBeVzfo7+vuGsP6RKxkirv\nSB0lk3iMJqJ2qWQ++JicvemOT1k7/hupRyxSuCH2JLhRxwQoar1Sq378r/Di\nBkyizhss2gR5jqM6XhpQxIP+pLdeRXwLDK4+P8eI3VbsHH+4QNlzqoa2RNaV\nMEqH1jbktDh4agNFAPLUhisIuoSD5wdOo1cEVP5yVrEZhh4WUx+4C7qIPMYc\nzfZ5roAJeMUuunBBlxewpZdz2Vivd2IzdJ66uIsiO6P4nqkCO9aJnsY7juqr\nVKFg\r\n=gRqF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"f858d04836dfc5f3015328edb7386ff4fb684b5a","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2_1617300031374_0.7526966861065889","host":"s3://npm-registry-packages"}},"2.3.2-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f9519f444c7476d1deaba25238394150290c1549","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-beta.1.tgz","fileCount":628,"integrity":"sha512-6KPYhLeXb8REXZDThDpAClxSunQxB7WezmR/Q4q9svAU7n8lDss45XSz7btXJusSPuAKfPPF1fMghAqiMu0hfw==","signatures":[{"sig":"MEYCIQC7wanj6pIbg8wsODJ8+88Krvf3/TBPUhQYwy8TXKkkPwIhAKfXEkfl97FHCoIL8p7LvnmfHxiw7l31/HMhqqkNN59Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZgp0CRA9TVsSAnZWagAAK2gP/A/BH8/F+L6wCQXBmRSO\nSNGwic2an2r8ECzCQgRuEy23z6zWuEc0rLmTgq9iPiPn9+mZ0Kz6u7s/49ut\n6tvd06SylNp5qoAZzVJsYRyufOFSTtyRy7CneUapTaJ6b/NRwK7gHkNZ3DeD\ndXmoyKC+z6tYwqEHFl4D/x1sdbB1hjhToN/hMn4SzCdDiJ4YRU/S6NKsM/hr\nMrFbWENnOCBWiPFNCkidRmpHNU8nUeGYftOOaZMCRz7A0RlKsWB/z5tGfggS\nuiCGNtBA5VJ7uha+yT++NXhuGJLZ6nAQVP7yNP1LpNZxU4RLouk4mnlP1U/r\ncRlnF7j827tXnyd9WU3EwOfBx4oj5oPoc8pJA77xHjxuyZdBNZUjfVOzBHzk\nslMT+EVskbkFdj80oKxA1Uz+7tBZ6U5u7ed30NMEfwAakuFxUcCpJ7c1qNse\n4+j8/oqjbK2R45Rv35e90PZdDx5EHDseM058uNiO7pmUDLgK5PRUablSuY6G\nfKRmHZ+pDyNnXOCsXObC2mo/4pbyLlxgUjQn6Y2N8wb75s4umgy9ewvr4Kiu\nHoj90BMfgC1ke/IVbYqwJcJ365yQcxYMlQNyTF//3nMkeR8stXNnpwakXGbo\nH1QDrG4d7BECbr4emMe3yfBgiUAo405FWn2w/cZF3c0IeGBMz/pECLl0W1cF\nQ4Hw\r\n=Xw90\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ce103f9eb2a26d2be18f96345492e88c0ea0542a","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-beta.1_1617300084278_0.011610589197082577","host":"s3://npm-registry-packages"}},"2.3.2-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bb7617fb80142955d8b24861d328893462892d51","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-alpha.1.tgz","fileCount":628,"integrity":"sha512-NBTvuOs36REK1NZ56lUQikXuHaNtdUJ4dNAqC0gKDxichwFDVj7EiPbFTJQXxgmiNueyJ+5bVACFx6iZDa5zeA==","signatures":[{"sig":"MEYCIQCkQ9fKW5N2TN/nVIj1yDjS/L/DdQRF98sqeE5VwjuQMgIhAO1JW3fIhpBNBSjGcTFDUnDNcCsDZEy54noD5iMGphd7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZgp9CRA9TVsSAnZWagAA8ncP/jpZaWWwd1wtKsgZY+/A\n9rz6F1sKKEB7jF/AeZhDUM8sST+oVa5zVigImsm9rb4oQRWhugEa5vKGCEVh\nse+9osQxDjDxpjgCmsDqLlWWmd1Kxa4LxQFYAzHww3ZfyjhBLlClNKlWxg0o\n8z0PyHD+SnYI4nJUfjEG5Iiz3tT+wF8ZMycBL4gzCGYmuiErRFH+fcI0GqYK\n464AfqwDT362kl25kKOlzTA5t3Cmh2QwcDbSBQq55b2S5Ph5NtVFZsLOGqq2\nnG4BAWP0DTp+nd2sIePncD4kyKuO+9oQCwMeyE1RmcHdrt2LJrPl9uzH2a2L\nf/5KshSgG4yNSko3IPVbDMALrRXoxFuJ8Bjfzr2Iiob8+58oIRBFYr80Xx7M\nDDoscVWhrW2aM+bp7159Le66sf1EYxxDGVrpMNN69IhWk1Ln9XQLqSZA6O/W\nYYVB4WYmBZtmDano/FrbxmlyCMLK/stntL1pfPGWbOXRt4NbxZRlgC0w35Fo\nVbMCWXVNlc7jZ8DGJTOZZ1HAzb1EKOc2/5yvBfLRhrsfqAgbj6D47iq2kDbn\n8xT5vWmPUoFLgm7tPpS1ZZE7bMIS6FQSVhoX+WZn0YKIviNhg88lopK+3SKI\nEefdh+DiWvR/ko7+mbMesf0NeJWYytno+oNj6doyl4bMB5rYN+AjHycLCb3p\nvr5f\r\n=ZzER\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"704889129a7f1df1b8e03151c3d1f0067d85baee","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-alpha.1_1617300092609_0.15855492499173396","host":"s3://npm-registry-packages"}},"2.3.2-hotfix-78ae2c-kn8tqw74":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfix-78ae2c-kn8tqw74","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfix-78ae2c-kn8tqw74","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c4ef1d60ff9c4988244c84d39fa21082c07e4345","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfix-78ae2c-kn8tqw74.tgz","fileCount":628,"integrity":"sha512-jadMldVegjCpjygK1K27wP+DM2/co9n37eKn6raJwZ4PgCmqsGpK0HU4WGw5awPkfJxLdnkBh3H0KL/t+Sjwhw==","signatures":[{"sig":"MEUCIAwuu6VGJfBiwGZqPBnXNHs9iMF0zAeVgvE5ergZDw2nAiEAxuyQVWLGY0inRKuuvKVBAUBTzx269dMY+SULNErcsRI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbu94CRA9TVsSAnZWagAA9fkP/3Dztp8YrhG6V6BRnlq4\nmk2920hM9PNwcODwcKS8xgWlwxUmf7nffSwVu+S0vtD521kHZidRegNlJhRK\n1ZcdQpMN1g/399jUvE9lyudC1dQqaFzJYzsRKbY+nazrleGQLZii0+Cuc/w3\nFurYOUnFh+HzSAKmffuTZVrTI/aqRXwP17FzzSSsccoW+ViYqGBBPVvY/8vX\n4azJLEGXlws/RR93SP6m0dh/7oqJeUiuScHKE/z367/2tPv6nxjvru5rhbH7\n5PiQgk+BaD5RbubecVmyUDmhb6pu6Tdb6aBLrE/SrlgbMkOmJ5iBKaW/vrqB\nUeaoBEx8W3Fi/QKqR80BAedgimZEMxMoMEAmEKY+gW+FrO7kLndo1EQqIXup\neXr8Wn3SZ3QPcS0lGNEF+AzPeR5rEU2qd0RYYvF50W1LMhcVyNpCLClps7eI\nUoj/r8HaGWTw1grHTKjEo6ZHDTtjqRryaAXlb1B+HSUu24816vS28koGzz7L\nS2+9qwWYiDHLB4bxPZdobn7ckqLaZ7cyXfAQT/QddXBzyMQSKeG6g7Ds88EJ\nGo1jtaCxDjxl+i4i6U8Ah92F4eP9XSlOHTMsdxgV4bxVgzlAD1b4JNsRh0Z3\ni8KUjJNJz+SQbEluV1gEzi7IOXbL7JPnCsKlfpE0pScn5dX3qhAAnkkBGVX8\nj+KJ\r\n=i1rQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"78ae2c9d06d67aa7a7052f7d69629f199a826f03","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"hotfix~fix_error_messages","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfix-78ae2c-kn8tqw74_1617882999383_0.3043880166878947","host":"s3://npm-registry-packages"}},"2.3.2-hotfix-338bcc-kna30cu0":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfix-338bcc-kna30cu0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfix-338bcc-kna30cu0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bb67a013970f991c16f06de2444fdfe05b05df2c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfix-338bcc-kna30cu0.tgz","fileCount":628,"integrity":"sha512-6lcmuP3Ws/V0yfDsOL6Lx81JYRPnxl1tdV4RN7pxQPPs3QLBg6AAas1FDotLWA+E9j2mm9GnblFn1Ve13B0uKQ==","signatures":[{"sig":"MEUCIQDv2UsgvJ/l/bfS724B76MkkHxfMCCDNqNK4uaKJcSTYwIgNYsspQ3c+DOrs2ifVD0rrUimheRWeHK0pSwQzb6EyUs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcBhtCRA9TVsSAnZWagAAFTQP/0K0bj7Kl9OpHr4ttHOU\nkzACbZWVmLkwN5y2C/zr98GNg6g1HUih1BgnV9Bmm0Q6ynrQl/9uikX6q04g\nyOz3P76BFB2d+kQTg/Jr7/MyzfPMEG5uug8er2PxlKYbJNoNnDaB7ZEEp3E0\ndA6ZfvqocknM7oftN4yWtXJwAci2CMWmFq2PnPw8IhNd42CAvJdhjHBzrmZZ\nGnr57fyV2VXD4AntYmgnydeFFqBUzNdD73W77w3ckWXaRbf/MgBiI6GuPpNw\ncObeatuuEFV317gvA8uwsbjuoFCXjME09hWSHYG83FNzmX6WAsbR+x4z3+Oy\nKX5zAsd8DUrEuOKLVNarz+IGURVk3+lKDjyEgTdonlJb9C1pv3ju8sLKNjeW\nQ5qKHFZyPT4kO71EkA+QbFfltQZ0twoEy7xGRWmhMBdWX3NEKceKURxtiroU\nomG65U5SPTjuNyl/KG0zyCE/xpaTnKC+ZtnftcLSJv0J9w+ktgz2o1JUFCjU\nAKdN8klTAdzbrYQ6W/1zTV47HGVEOWbqzDraXSrrN3SDyein7rbYt55hIVaq\nSoYbGIJrOI6mhBqtSIrrSxquIuImkp9WZSnp/XbRqqs1pcTetDCGkPCJbTO3\nBZPowQqpmT1FFIqEpVGVRDccLRX9w6UNYH2CxW++yJxm11heZaxWWG4RX+hr\nKz6j\r\n=26TY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"338bcc47cda0eddc8981adc6baf2ee5e9bc7a42f","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"hotfix~fix_error_messages","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfix-338bcc-kna30cu0_1617959020904_0.038183525262263984","host":"s3://npm-registry-packages"}},"2.3.2-feature-4def57-kngcid4c":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-4def57-kngcid4c","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-4def57-kngcid4c","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3315b4a1405eb1d57d436db0e83944c4acd42dc6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-4def57-kngcid4c.tgz","fileCount":633,"integrity":"sha512-Q2+6f3Nl6qL1U15QVUE9lBC5uH3D1MPBnsGRm2tE64vJ9449LEXVEKsEbaveFp6cLsZ6Bg3x2kA/B5e1d4rK+g==","signatures":[{"sig":"MEQCIC2y8rfP2I32yJpR6mQbHVERkdqIyB5pFLMuyOGEBYOnAiBvFKqJY/az8caBvZfp+o0+r2DmAn8xOQBleGQP85VSvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":767011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdd/rCRA9TVsSAnZWagAA4/wP/15i6EfmUGC2qAzjI7gL\nNnWn0eYUuQ9rebOyT2yOcDNDsMicvE0jx+UfVL4OS5c5XELBf98nLfgrxvgT\n1TvB50p98rWOdVpbM6F0Ob49g5VfewvuDd0yrBHwGPhvv263WAMyB48XcHev\nbspqpfx1+RO4zlAvPbPSyzfQrNHH6kG8KfeMshbrSz4swJwyYq6P/zboGhAz\n5XNwmOsmZ1PQMJTTsSH2nMfGpOWbFsiFklElT9IvG5MGysmymakLDvEXwMCd\neSbToFOuljU/0SyLzliXLSzL9VCElFx1FHEU0+WAJZs5ofRi3Vey3CLjqJfP\nboFX9TGmlnEFl/Kf++q7L4jBtflvRSydenqIdEAVEEiy2EskE0s4tvxJ11VV\nx2KtRcMakgSHH30Gy225fCKWMYsrEf70Zh6TynipiR+DcHfLZ+AEACjVB5aU\nYY+Lf8ZP4mSQ6VX0Kiw4gLRQQI5eBFS4fGnN8gTBXhdoVxsHoFt/SdcwcCSg\nCPNyLGT69QBlK5kqNXcHMecpRe9Hj895JxFGmmxIKSzHowtKLU9pP5JjaIuw\n4C/a6sgZa1g0VLZ2r0uun1+myt38kh02am9yATSwWgKUQZ74rMeuMVNhEZGr\nyK9XzEE1qlymim3ljZp0X5ZtPpT+W5ryObNiat8Kd+Y7/dNu8yPkNZlbUaCk\niSgt\r\n=in6x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4def57e1f4d392ab1b2438bed61d23ebf71293de","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.11","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.0","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-4def57-kngcid4c_1618337771112_0.23027466117256123","host":"s3://npm-registry-packages"}},"2.3.2-feature-f80e03-knhcm2vu":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-f80e03-knhcm2vu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-f80e03-knhcm2vu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7dd7c9db037f25a436ed028fb9a664d42413a6a1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-f80e03-knhcm2vu.tgz","fileCount":633,"integrity":"sha512-89XMQT8MXR8yuGaVXeDEs2PjTjMi/ttZw877lHEwnR4Jmai0kkKfMazBAmd9uJq2enVKxwnBs5yGjYIWkVZirQ==","signatures":[{"sig":"MEQCIFqjN+XTjLlEq9wthsk1fPUqMUeeOzmkRM41SnstCT1ZAiByEvMNyToCVop4K0AzcHnAUQVd2zUI5w8ORW6RTF4p1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":767011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdszLCRA9TVsSAnZWagAA2bEP/2mmNOuz1zaMd035L9t7\nZm9YFxjnqPsHNz2GHGJzGh+tB4jZirOJxC8CXpODY63ifTpPHmVdxr5H37t6\nFcM+uZmTlMpO+tDygFlYSj4eo/W8482xm38CJzmFi+NFmOXj+4u5/jsXuMek\nTGpKDNoebz7HtO1j+TTOkVYkLFd/zZVFDUrViTiZ9nhAjnVte0IiVhucdQRr\nt2038OLDsnhZUHYb2i80oJ7SrqGDmSGHlNuf1qfTRA9j8JmkeQWaqg4HbO4M\n03B5ILjIs08VnXQU/TdRYwlbIqDJ2905yyYB0F6mI/N0Vk9nFQ6CEdh2w1Kl\nPbzqzBdQALwAsa5GjGxIkrhKZyfbYZoI6pHPvEdk0SBeS8uyN5ivdiHBvZj4\nCXZOoWOmJGToQ19lDec1ExYqZ7LBiCWk08CoBZC/PLJRnvsfMfWZlUNF39vY\n82JqucY5Uux9e6UNoG50VsARCYpg6YoyC4q83aZhG1XV4k+pMmwbwI5gi3VR\nQv0ainTejQlsMgSAbGvh3BrY29Q1haLX6Mju+eOXcEMFFIl7Ga1C4xui9z0l\nuzX8pAhosb582z5FGBNvUIiJrxfdoNPzU5DH5dIMOS+kqxmOv1B1+giQMgeT\nNqVb2DBTuGumaxtZUio9PbiQsL0teaRwbR/AcQXdsGcVmI16YcQcEyaLILLZ\nEvfJ\r\n=OYAc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f80e03eb14305f66823ac8ddf663a94147b76c10","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-f80e03-knhcm2vu_1618398410630_0.7781177606756462","host":"s3://npm-registry-packages"}},"2.3.2-feature-9a3233-knhcvq8n":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-9a3233-knhcvq8n","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-9a3233-knhcvq8n","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9539c262b50e82ceb1a3c23b26dcf2e07dffb37b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-9a3233-knhcvq8n.tgz","fileCount":633,"integrity":"sha512-Gb+0PfBKqy44doZGfb9/VSGOrehHErXkaO7Ch91TGEDUFr3mRzLKz6XgrUNqHjCU0gIGkdk202E5sq2dz+O7Pw==","signatures":[{"sig":"MEUCIBZfrCJSj/H92qklXd5ZJId8vHA7PimXkXTyoUny0QhtAiEAyToiive+VNaOzefT88GccHb1SZaSymCRUc3A79CQ1Ck=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":768681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgds6QCRA9TVsSAnZWagAATf8QAIu0YKYgBqAsHEdq1bqe\noYu0AtIuM4o3P4SVcApNm0tpT/T7V5vVWMJh+RVKPmQoae2hcQLj9Jm9EG65\nt+DQNF9P8Cgr0EL7mNoRpqTF/mQfD8PNuGGNLYo8nIM9VsuX9xTVFdLUmdjJ\n3YZPkMsKM7OERq9s6QUgEA+1P6l/TICU2cZHR3KFlsD0lLlDkCDiseKKwUpi\nxihSEuEITH+glnKYwSBQBGFRNGz7I0CR/+iexYoPg9EfVLttn0XDRe+1WViR\n3o3dlj01/ncY+DooqGthgIRQX/fe/N7Wd/8/ljuitWajsZb4IlKoG4omCbM1\nhxaeui2SRqbyoV3iL81ivrqH6P9xaf2mE4W8gxU3wDF2wdm32DgX8gQMoxA5\nZ/u88QmoHDsSLOg6qNewF6GEyJF78TIY5P4qRQozpV+cIpc7fdRwfOKOpfUx\nhjTtYYBeEI1kpFsVupQM9QX9/e4fBvmaFToPtRns1brqwIwf5c3Rreeau2ws\nQyZlyVNgFOJed2jYifFLCzdzJl8XnGd3V//aTf+7YxWgv5LUoAFMX/RJQCMZ\n21P9qTL+nbsAn8QzDXJ6f0iBZhdpXe7nM9CepyPuLaIWwE1oQFsV2jrJDJ6y\ns8wH80DP1mo/UHWL4G3pRZQEHDZdU4UeVwbJdRnSwQtRleNFJccnFepHgEBR\nfZjF\r\n=VULv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9a3233d18ee6386b7a7911c7f77128fff79b9c5a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-9a3233-knhcvq8n_1618398863737_0.9539973230268664","host":"s3://npm-registry-packages"}},"2.3.2-feature-35c950-knhjrw2q":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-35c950-knhjrw2q","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-35c950-knhjrw2q","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"225adacdb094aafe50c761dfbc9f57dd380b8a9b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-35c950-knhjrw2q.tgz","fileCount":633,"integrity":"sha512-SZ9lFr7aKiYjYA7oRWGGzoWU/IRbZMHHPlUa+URvelFG+E0HaWinVz3YUcpKtojR/5igvXWY5WijwUXoytAwfg==","signatures":[{"sig":"MEUCIQCMcYkPTnmgUr79uZK+hMdzngeOl/Tw4fmI1mMEGYNhXgIgMlBnfe28uLECCdKOWJ9SgjGxJm9fLnqoL/HVz3glH4E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdvvICRA9TVsSAnZWagAAgJ8P/0blqJUnkaBcmR96YgJB\nwIhGOHldbdIJxKArCvrEadAQ9TMKIJIVAA0+0DwvjmVblX02DFPkvKeU+oSu\nD0N2iBVYvKdDVueMHXiGOaLudEZN8XcjTn8bnilKZwWBIMI2l3t8VKwcz5S3\nubiUwMShm+7fIDATGfLfQiI7NainZ4EmBnyvInuKUmUBs2DrkjadGBfgdWoB\no+WFP2YBiMi1PBDjxCK5WXBuvCq8/1Lc03S/H0fYWRV1vZ50GVyeYbwAXwAy\nbxEAuQewiZwbKouipCxA57mHWRcEoyuLjlSQs1fiDDcq5pWGfUqXVikx36ZI\nZwKSpTRmUAuA9+E77o7Uq+1FchqYdpoA6NOAjEebmpPOunMhNnLHbVH+8lJk\nHpQ/DmzCBNL2h28ymRNp6lTUTbsuGu/nxGnxmd1skHqg9oOkHgyiTRJW/Mus\nDHsjlDw6hp0SrOy/bq2t4WyRfCSAB4jYKovMQpisp+CNSF/feSaeTvJ4PR64\nK5dfN5BNQLgwC/xzmzXvHlnUI9v/CqJN1h+puhl0p70y80CpZ6vA/w+YExBU\nW5XRRvTeVCjyH7Y2OqCdB6Kmf2aykXAZdpj5DC52rqAb8c+ArDX0tEmOPDJs\nqJQyUqkyzPTnsVMey76f73CPusmnhdWY8IRiJSIJ5yG6h4Vvq9cTFe+kdtML\nldQU\r\n=n0uI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"35c950dbbaaeddcb81a90d6b47c1ecf140a9c17b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-35c950-knhjrw2q_1618410440309_0.8385689767433113","host":"s3://npm-registry-packages"}},"2.3.2-feature-5efbf8-knhkzevj":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-5efbf8-knhkzevj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-5efbf8-knhkzevj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d4e88f58686abe800d43a2e72272e93c002a3612","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-5efbf8-knhkzevj.tgz","fileCount":633,"integrity":"sha512-D3JN9RHpGMn/E/24Z02sbEhFQKMDx4v8D9xV2SiUqhRzV6xzIGuMCSAw9lq9yHQcOlHOwWV+m6AATwzM54SzDQ==","signatures":[{"sig":"MEUCIQCNTP9clWNUyjCj1qqmfikEIW5rP5VCULNb3f+ovfMewwIgUlVrZK3vzeE16NbXfz2OBBEpxqNcIBGdAheqdskjBeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":773539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdwOzCRA9TVsSAnZWagAAoGkP/RU81IntsT8SwVs4+wsM\nmZSl/XA5X0f2t0BbdjfJRg+HYRA0YANobXuqT4hWXqDV3NkMP3jt8cWUkcEX\nTBJuC6DnLI3do4qam3/CjPqX3rwbrAIbKOEfP7w7MsKdCx5upj9L+oeAAQN7\nWTC1FLw35b8jaHZxv50S4jRb3Yrg3CV9hPMUcU8nTJTIGKDFExnY/4Ghk3iz\ns4IpPcBu2by4avVPjTEwDCM7ABw5QeOLVFME0S2rXaLQ7R0q0AJXogEP2kM9\n04iNxfxMMgsXvQ7geommH+qwxhVELGpNWbd0zTbQyNg9i03cmimuWIioJQI6\nYAV0aPkLVR4d3+BHGBtD+gZ5r/enouZpsTxm++mGnkbuSSuig+ZTwnt05ifj\nc1NXTQWBDzg+QBU2Yz6znuIFZZjfrg0x2ULYL17WJldBzCHL6Tb8ADALYMYx\ngKGEgpPBUqYnthO4b7TSvCVyfWDEZitiggi+zcFCNRFXVuiPn37J6Jafsym4\n2QXD5uNKtQfXjKTVGDrOxGUF1T/0NlZWSTI5MaYBzUC1H0P+LNGgex08uJ3I\n6kiZ8eDRaY7qWYrQ/nNtzOwyJDq5gTfSK7fC7mAnc7KekrJmkjFslK6cVo/k\nuDFz3V1y3Qvu8fWGx99Jzgl4U9JqhL8rWdp1ELOJkhDhs0daA3z652OlJcy5\nwylh\r\n=53Jj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5efbf87c1b048921d9dd2cba0aa58a70a573c662","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-5efbf8-knhkzevj_1618412467054_0.6762719849146579","host":"s3://npm-registry-packages"}},"2.3.2-feature-9b0c74-knhpx1tm":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-9b0c74-knhpx1tm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-9b0c74-knhpx1tm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"da8f53873aede547b31006b74472248961394f8d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-9b0c74-knhpx1tm.tgz","fileCount":633,"integrity":"sha512-I93d8aclFCCyb4lDZXGQhix9QfG/7iEpbKPGWBPeKipQGWnPJdWYUWsxdEhQrnUrGVEEThZ6uqj73k/8Kp21/Q==","signatures":[{"sig":"MEUCIG8GGt/wCymfjvReWxi5+otupVd6seq5zVVwC5lzT+E9AiEA9+BhSbl4oi4LK0/dNwTzFj1gXs/NgbswQd34/KMW+mE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":774982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdyQVCRA9TVsSAnZWagAAL6oP/RJrJ3dp9I+pyMAiDI54\nnctkKyRv+xTMIaj6qZzH96wFZXl8z5FOUIeN+IsEkfq9JlT32MKfcPDyK+fX\nwo++4qZw/EJ3/IrclpwonN+ALsuUtIBAcWdpMgAKB/XfEdldrV+tajWtxkh/\neFDV6+Fpcm4EwFROhgloIEgv6sqCxCK8iVF1f8AxQFBAA6J4E1utjxCCjg9O\nPOKuO9DEyNAM97M2Q8AuD+qLHnKarmdV3Bnay+6Y+1/urEU8dHUoBfxfPyRK\nRscTo0SYdjXSYKvn4qL+scVPWhz+BvbeWv2WeYZnMDTuvAZrJIvMVYpeqiGs\nUKb+ROuqt2QMfghxNrM9jHu+8oMTo8HMO9h4e3/CBGMMbkTNUa/wfh/opD0H\nv5UZjEJd5qIZXAVUl9yHfgnUC4CxxpgZxxkE6OCpaWnDBLv9qft4XzBQSzm9\n+BqKbQ/kESt99SNrpDVi4wF/TjQD9gRz0txZnFXBdS2SAcLmWX26itVLCCfm\n7pTD8XJtdAWXNCdQ77UXPnJ1Lmplik3vh3RftEAqCJjO4Bz4/SJ/X0rwJEOY\nTDnEeQ3Q4LepG1c3m5Fwa1EM1qslOWhkR/uS0inGGCmpX4BE7spNeI5/17/y\niRYJ0f7HGxt1oOJX0MTmGC/4Pi7hqCgJCwDr4L4LO9Jkoj30qFdo9dwnT1Dn\njgnp\r\n=0E40\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9b0c7434b5b1d1c6e1392740e75954780cacebf3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-9b0c74-knhpx1tm_1618420756661_0.7014785643129171","host":"s3://npm-registry-packages"}},"2.3.2-hotfix-b44d1e-knj7igca":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfix-b44d1e-knj7igca","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfix-b44d1e-knj7igca","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0f209a60d43ee218d0fb7f91deda04b076bb83fe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfix-b44d1e-knj7igca.tgz","fileCount":628,"integrity":"sha512-/Kdzu6v5Yd34d5QngjmHUa86RpkHr2oF7m/C7kTmZBwkGQxoyYKEP2hf+WnCK9XCQVDnqBkr5rgu76FhaUbS1A==","signatures":[{"sig":"MEUCIQDJneSr8LI/coQ9lTvPXkk9hDQd5+WIMdJ+IXruQ7UkNgIgMy7PY/89qYvx7u7fwzxXO2HT6wKCR6ZFbIFotx/Vnkg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeIO9CRA9TVsSAnZWagAAglwP/A4DOSH6IGveY1qQ+SHe\nZ3p6Ao1vX+FJD8QRRPkfyXTS+Bq18wQ3taOccGT0OaQVL/lV9Jw1O7a/eOkD\nnwScU3sOjxYfQIc7f6TgAPYgqZgZIRbBHlcxvA75M7EdN/d+whug9K31vtTC\nzzXSHbiQbKnkP3qOnS1P4xT8qip1OQeLnso0xGsw1NDNjdp9uRqkE9DKR/08\n14jbPYDkW9Sw3fngzYuwi3gsH5V9ob/3GQK/P/dIJutZsVPFJHQE83gCbnKV\ndugqXJkiIBQF0rBkpVo7TJ5ZCq7maZHDk3AHYrXhQStbM+a+JynoKFEMZHs+\nCH1YvGgQ3q6faCcWsVekkkVCHO30Wc0yuWBau+/gBj0cjck/UttUDEDvDcNY\nWB7VXtz5rsBoxEn0Q7Pq7I7BT01+IztnvVggVmPKUWc9FOjrrWxmKk2foHT0\nWHRMiFYmKAcyV/Wcym7w8ksAQNQsxjNzo1sX/Wco2XcpTU251/iyKTVJJOx9\n7kYVvO2bMRBDkZbdIImPDKHV2riXydVF8Nrna0Kn1CYTqGbbswgxlTlKLcAk\ncoD5KyQqLuON3NxCluIVzZdqqakaG132USiOhtN3YJVWuUnQO8hc0SJd7Knd\n+3ZlpYXM9DDFnZRpfiDurI8cUnrMmZIauu9Ew/5H+4FLhT/i36rUV79zp/Ow\nCxsv\r\n=O/Kv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b44d1efb141879c442d87f3925ebf899d374b3cb","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"hotfix~fix_api_queries","@atlas-engine/process_model":"hotfix~fix_api_queries","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfix-b44d1e-knj7igca_1618510780856_0.12066046046350687","host":"s3://npm-registry-packages"}},"2.3.2-feature-9b930b-knk14po0":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-9b930b-knk14po0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-9b930b-knk14po0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f976ff6a525f472bbaaffd61b10cc7f56697c9e3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-9b930b-knk14po0.tgz","fileCount":633,"integrity":"sha512-YcqXMMNADQ5XOgRKIGXL1NgO+PpCB/6q5MFP4bF7dcVUDmCxQAYcVrl2oVjG9w7N/B2eSL2BhSK83/HgN4Lgxw==","signatures":[{"sig":"MEUCIGtVz7hj0HptbgdjQZFwo5qBekEIiB2Dt0HVI1sT6kliAiEAnZSx2/FJTm7J11x1AUtXzldmDg/zWS5qPuXo9TMRAcc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":775009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeUYMCRA9TVsSAnZWagAA954P/1Syvnela8huYheA7w4t\n7mN5j2zfRAqzRJyZ5J/xqbzPLM9kb29CNRbYK50iunMpLBlH9WETN47hLMWC\nZOMIu3140aIOTikn/cnphXdnEfMVec6ekPOfL/J+3Yc2V4wD0DQmqcfTeMIP\nPwqItYFWKxW99fK70h4xxeJ3YEn2rWw9wvPYdM8Yd1jgWCjTMTqxNeTA7tA9\nMqenABu2fMKoS1TS7OPmaB+r4PFC4XXUYCiLrZRfapS2k/S0uhAP0C220EUt\noAeDp0JXM6DxYvjmO/mfO2A8uCfGIwPqm/xppRaWdQb/a2TzqIDJdxpvlgoB\ng9443A1MJ7N5MdJW/IGEEaWB8TUUF7N15MFLnjwLQxJrOHPTR/cKbD3OpoGm\nZWRjoWcK/5/hgZ6lXdyw3FvF42sjiMg9AshjcwyAl2Yk1w4IZN/B/9nCN+n3\nUdWAU1j8TWdH0CaQ2+IlcVdPbX2rvj4dNqDWyaYsRYhBXgTDbXPPSSY4IRQV\nU7MWIFryGTo+h17oIBBl/WyVPxGkjvZJmnCghJbuBKUgKemfRyvcPAkr3pz9\nA7mpjR/SN/GuS/mAmo0vszmC7Z7iACBM7SKOznVc5UrklkfwBUdbZKEKCej8\nPUc5qFTouEo82svrNMTv0MCorCgAxO5PpCAzddvdG/wEHJUk4NEiV2i/nrG2\n/0G9\r\n=IUOS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9b930b279fd111958988e9f93a52ce599bf2f69e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-9b930b-knk14po0_1618560523662_0.40133628972541513","host":"s3://npm-registry-packages"}},"2.3.2-feature-d0e468-knk1c6xh":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-feature-d0e468-knk1c6xh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-feature-d0e468-knk1c6xh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"62c062813bd561c133bde6920179e2d97515fa4f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-feature-d0e468-knk1c6xh.tgz","fileCount":633,"integrity":"sha512-uDNlspVteviozVwXh2ot2uUAlhLt8cJoAqu6QQAc24cAgmgKakkLqhFx5O6ydMcHflu5/cdChAeIEQiRYkCAhA==","signatures":[{"sig":"MEYCIQCZDBcFU44/opERFbo+uRAfcMgmbrjbkqrW8X8t2MU0NQIhAMZl8DFtd5p8P0L4WUpsuy2KBQ4kbRz1HrKJyOybO4YN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":775036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeUdkCRA9TVsSAnZWagAA1PsP/jnC4PKWYLDOUsQFLsjN\nL0kcyOwDPB73is/PuonJbb8V0GZe0gXl2+vVP5DgZCbnG7pl3D/9aGtg8FsG\nG5gTf/g9ocbENYH+7VYXMYqNhSMm3AGmdZ9p4skIrjCpiVKqrWKipVLxdhog\n30+F2AAsYxWo5TEYQxUO9QkkksZvliMR/2f5CdP+JX3Yd4Ht40mjbOafz0EJ\nLqgHLe3jrhwfRX7JpyeRoqh44xIzhJQ/X/r6XpxOBg1RYHnPhmEfku9lS8oQ\n9PWF2NBB68hAamVkdawP0NyWdY8S+5xKF10hfh+buO9I32AO16LMg3bpUUxf\nV1+oL/ixhUXPEe7M4Vb9+VFEzLQaiJa7krCZrIcQnZjTf3Uuj97z+TUmY3mo\nUF048ptL0Cka8EuZfSsTXn9Ty+FFg7gyZZbJEW66wVpU8LzPuqdKKe80aSYn\nyd/VdPhAbmIJF93DFGmxsYtcTAgAh+ePIEovJ+/dsN8tL1arqdez5Oc+4h0W\nMI5Is9f09g3rJXZem2WPSZZDUCgxNQVtlr6KIU4gDMrLANOE+7/Ki7ioIS9z\nnVl9/eojCIBDl9g+n36COJ1PELHHxvWcgbunPY8pDRZ87gj4PyXbZYSuKqxg\nNPlFz8jC52UrIRx3cdAXLsl5qCv17rpgIOLWC0gr9T2oA+6J48JVWB/tboR1\nXx2T\r\n=OamZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d0e4688a7943b37d161c30517e4dff88da959fb9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-feature-d0e468-knk1c6xh_1618560867729_0.9114951111482961","host":"s3://npm-registry-packages"}},"2.3.3-feature-90f794-knkaz2fw":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-feature-90f794-knkaz2fw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-feature-90f794-knkaz2fw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"02d7de54df1d8282395d4a4fbed45275e3d9d4ef","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-feature-90f794-knkaz2fw.tgz","fileCount":633,"integrity":"sha512-xkp3959FBMxl6XSWPrX9U2uyTresAxef4KyITzRGY3XtqCB5DzB9LUMeSRJkLZpmQHqKEaOqy9RfHmFb3oc88Q==","signatures":[{"sig":"MEUCIQDTltjbilcknYFokTUe8Swqeqnng419MlHG1p94NYSdhwIgVd3lhmUrzwKzX94yUACYpaq9RaAQ45xwHQ0er225RTI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":775036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeYahCRA9TVsSAnZWagAApzEQAJfxCKLvmP9QDWTTGu+b\nZF+yZaXH2MeCWpwvA/MsKAd/KncEELwwt2bz8rwgJaCbJRFw1k07gF6dohst\n0gnj9AO5vXyWNHsj+YfJePxRAba4Kfsmbnvpedxm0FPTuH7xafw0+NkzwZG/\n2Zqe5HxEAkmGvVMkfAdSvswAqihLWKQ9e6AMJr8Rp+EWciledANI3UgXd36o\nzs7LgsvtYoXR8g2nH2klJ0ZhSC42j4reeEQWlqw4DentTPqX8HJ7nM1AUYB2\n+a4fTjyMhvg31mlPyCI+JWalAr9lctXyRaXWtvA6AvcFUEYDPXy4S2mcKuPz\nfadotr2J+64ZKqubSLfQXrlxuI77HbAe4UjwrpqJtEBh+IQbdcNMnNdcbDHH\n0rMvgRh3YWwEYcO5ozNpeTOumZY/f8Favlnx1u/SR9KdJvKzkv2S1X2IS9Q7\nRyMsMeYUvZy2lOO58n8s7CtAb3LuHLGpyoxrqDcjnCgAeytJBUk+Dd8BFg9y\ngJqVPtldNWC2Gm8JJPk5uX9ZjzlB37RcpX4yBhmH2+gtzX3GzNA4/Th2p2wC\nh75m8MA7E9C4DPLJwSkM39a4Ix1nr5ViGVbobeKnzNbCv7oC87+6dqwZDmca\nttAEU9O5WE3w8NFRf30WxzYGFcynFnnT61VMcGVKYsH+8gY63LCzHvGCb9WU\n+pUV\r\n=YIZE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"90f7946baa2970519c9614b389e58678e377f153","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-feature-90f794-knkaz2fw_1618577057299_0.43144608497867476","host":"s3://npm-registry-packages"}},"2.3.3-feature-209212-knkepnfk":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-feature-209212-knkepnfk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-feature-209212-knkepnfk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"54676334b468be7603a7b75976ae8941d196ceee","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-feature-209212-knkepnfk.tgz","fileCount":633,"integrity":"sha512-H4+E1poyshgdxDFTWXNnLdqo3V5RO5aQTcijNo/gon/3cJpmrggcpJ5rrNOXdQpn6Qus1zVLZLYWDQlJECD2Gw==","signatures":[{"sig":"MEQCIG2oMAjfrchfmWskJMB269Jm/9Z0SbND1z2mTMbQvtImAiBEJk21mBaAGAwRDTdUmJOtdOx7K+uBn0iC3XoGQviQKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeZ8oCRA9TVsSAnZWagAAZF8P+wfZ7Vj9V2wS+L5rCOKL\nepaGnQT7r6KhVeFEcJVCqA7Kl0QpWmzbB+L7i0AnwMKeyeQrStLLfBpjtX3g\nkL07cUobwfLehJh2rT66YzMPJziHBErPeRnKjDnDtxsjt85vdbAmD6TJYmA9\n4BHPDL2vNh2HGi/E7IZpdbxjtbUPyWbjA3cAVCQUm6Tny3iNrLummI6R9x6Y\nREoGu+OOP79yQbCGaRDY38SoYuydPiZu88w+umQUcnlSIC8+Yh0wqtKOy6zO\nx/ndXQVSc6dZujsVnRCI6QooDVep1+YaOimanlXoVTjBXBEW1nfFWfttrer7\nPYfF3gGhGrXwJi3nfpd+Yh43MjZSPaSC4SgAqKKw9XkKwoXF43hBTERSJNdW\nXfnMciKHDFDbB+7GaxxXhddwe5tjDYJWt7Kc20YkGbVcZfedY6T+A1cNMT4u\n7WByLCwQzMNT1X418sN6rZfsMYdGl4Qm72BSbmczipVho+ZaajYWxaG8lly3\nvglPO5pfsCXtcwxaMqEXlLCxW+p0Q4uzFedZWVULF3Gram8H4QH0IYoeFR49\nIgfjdJKwHXxxDIpEc366jvDBY2iZvETmtwIQOCoq4UbzGJIBrNkltx8gttud\nWvAP/pU9eL77i6RBbuFEVe3uBKMvLwalA24p7gsVOBTt12xRgWy4nEZmr2gn\nc/Uw\r\n=mwWa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"20921210755d5794899d6c9eedbde131516212b2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-feature-209212-knkepnfk_1618583336028_0.8660635791641145","host":"s3://npm-registry-packages"}},"2.3.3-feature-72344c-knkf3ki2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-feature-72344c-knkf3ki2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-feature-72344c-knkf3ki2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8af0b4ee255e56f5c13894d620dfee34f525a43","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-feature-72344c-knkf3ki2.tgz","fileCount":633,"integrity":"sha512-Jdq3GjAu+VvyDBTuqctmNmnrO/wOratV5Wm4IIKnLAs6HAAAmk/gx4ZFrOJFzX/au2KGt2KUxLGr9nzhdCKwzw==","signatures":[{"sig":"MEUCIQDibYQ5EL8VJVouM3JZTQzf8fjG/IuXSE7FGbcZ1Hvo0AIgB3KcFISy7kWbSd7yY4GalY77whCl6Nwsxwvb48iwYW8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeaGyCRA9TVsSAnZWagAAC3gQAJjJ8c/AF/o4HOIb4Hra\n8Mvc9lXy7O2SvwMtlrqbowWOy0rPzIuxeMGHzFLU14KMBOZvQsxVeTP9/wwK\nqLzw0JzuYcQvne1qXQ5W8Zu2Gk6UE+Yo+SUuY9rXPTUEF48yXe622YqOG8Q4\nutdpPvg/UOmbU+25JzkCEisJCNDUykDdKBUZQhDSSYCmmqlpplUu86hkeamu\nRkhrjOrx5xTpgWJyVKr0hjn5IU+xeUWs1n9c2Bz9k3POBMPKC1nCAWri8fqu\nWfr3317luy46ai/pIVq5ptrhfQkLgoefEY/LItt9FZoKXFw/wM9Wm8kVFgpD\nRri8uReVXyPRxJipv0eCunrQB6oLTYuGGO8rhvIrqL6m0bmzUB9yoB+tQXVP\nLmbA/KgcKgJ9W/Eam2wBKE//Dwi9EgMUKl0EwUGazwPjpwQmG/uxbwCqSx0H\nmXNRkeLm4Ss4x60ogSmX6n7QyjMqc9V/mibi+YnZFDYvmzjo2zqXSjdGFtZh\n8dWekDYHjh4P/lJDdT6apY/CFo+JeGbnbs0ItsTlxdFBVRaTFcsOOk09kcub\nBtv+/qNlWevEvIjAl78vNsT9lL1pM3XGgYBOEJBXr92s49IhaoYFY/eRca8n\np5/WbaTTtCMNwoJ4MXGKmvkEkSz1AgsJeZ2p1bjb++o2jy3ohcOfiXvL1pdS\n7jOn\r\n=YUqC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"72344ca05192a711866787f94b54a5b46e2bd925","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^1.1.1","@atlas-engine/process_model":"^2.2.2","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-feature-72344c-knkf3ki2_1618583986302_0.28921298314757293","host":"s3://npm-registry-packages"}},"2.3.2-hotfix-9b74db-knoaubro":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfix-9b74db-knoaubro","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfix-9b74db-knoaubro","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9f46cfc22a059e32be3e27cccbdeb3e8705ff98f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfix-9b74db-knoaubro.tgz","fileCount":628,"integrity":"sha512-x/suYZCWp5funOaUokkY8A7X6O7UFeVCLnY+lbNMA+TRyzbFfL0Hg/9UbJtGHCVPLI2iQ5KeHzymufeIY7mPOQ==","signatures":[{"sig":"MEUCIGh1L2ouCj4bLVkVLcKFBd6KKba+Oaczp6bm/bnzKTMWAiEAhrVg8T4fHNsERk3Ea26xLP7Afu0qbesqZq3foOLsvLY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfTaPCRA9TVsSAnZWagAA5EoQAJKjKVbkDLAxJqaqMhyQ\nzHl5M1aYE0ode659bhGjcoDQ0mIvs49hVjdJRaY1jBmpW/uav9POhmelBwv5\niM/BvaHK7LG3E+idMt4XA8by1DYNNrkCVVN0Jkzrh8aANPCL9j/fLFTu+OjA\nT1ZunUYa3FoUFXP4lN8gl7GFsHTqFDuJ+48w872CfHuXNfw7YPk+xWU/2m0s\n5BaydG1aXAnCez1Oe1TJ5o9/r78YBfCSNGan655q29YKD49XzAhokX++an/f\nM9DRLyrg2kTkiDovQtICsy83gIyeC+ZB7Z1zfU7hL4dN7j8AFU4V5JDqwS/3\nQDqX4eH8th4X9jxyuj6ZrF+3U/zIwBlYCafO/edJ4/GCKOd8Rd2kYyqgCHXD\newHHhEtIdU4bDhOcx9TSQxTJp2mjeLFGuTypKSIb0tTFoUVedEsHN6zefEWC\nrSMJ41uo7IPrjqBLn2ErcbMiKgkfpsdaTFGCsV1ThdGRBNH31bC+hgVvCgdt\nEzsDFL++GiHLIYDYgga1e+Wz+6TdczXrgJAzkQcAKr8ZhJ7++JCsC5/UMbjv\n9CgMq67Qlc1XUY2NXmA3ltBSpQok4XGHw38hyp782tMZ0jK82FyXk2kNWYa3\nu4Zh2HttFZKikbHRPKYcPrzSrsiyrNYrJASFykwES1Qw2imgcxEQzvoh9KDR\nV8Ix\r\n=L3iX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9b74db362d8c67b8df442160ddc7c340485c9c7d","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfix-9b74db-knoaubro_1618818702298_0.2539640915894863","host":"s3://npm-registry-packages"}},"2.3.2-hotfix-16235a-knobmpsd":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfix-16235a-knobmpsd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfix-16235a-knobmpsd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c88e6d65f08e6b7c4082d1a242b7d682425932c4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfix-16235a-knobmpsd.tgz","fileCount":628,"integrity":"sha512-xLRcsfkkA6XUFeEIhmTdghf+fpMQsVrl0XXdOUg+ytQPcf+kjuqSs+FpHaHlDgCtsGcRvuJgN+k/08oRtzw/zg==","signatures":[{"sig":"MEUCICvRWnjpEbG+C0nfPT8owkkID3R1CcobWdWI/hJyB101AiEAnacvQXb+tUXE9E//ShgWl1q93MfKkIBDWnn5nN4fXPQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfTu+CRA9TVsSAnZWagAAGN8P/3gDE51j/dx+Xt+4PMno\n2QMElsD9Dl52Y+i3ZNKy4hcLm1d9rHHZrv9/4xzRZUG0P30l2MzLsUsraW8p\n7sbkzEKRqT//ZMqVKABzRxFL7cyuXUA/007d54bIZUszJj27fMJVaDXXL04m\nftxVVnWmTxSo5OSUr/q6eq7Y+N06HydJqk9EtFNo1EIy4coVkG2sXkqKsf6M\nMEkE2PSGwl9J5slMBicydNekPIYIY0ERH1PuaGy3ENVr9lX0KGUpJPWsp3iX\nXe4Ldi85sb0Ya5IZYY/3n/L/ZHIedf6aDEkqrCDfwMfcSWXbCsTjcy01awbi\nlw15qjj/lgsXpZAMquXxJbN27+TezsgU0RaeCmvLONeNsYijuh3gmaRJKos6\nxYSWJeCdKafVV755dJz1CITySv93KqOr4iPKV4QABma/GPcbOAVMUTmLqT16\nZ8g16wqTOArSG3oWd4rJuEpJVDC/PRGDi9beJQp18eBPpbiGxRFFTDIzd243\nGVbKjeeGY463McjnXTy85nZ250pcbyjVhmBCViiDvsRhAVrSDZXTlIUpao+t\nEY3U46NnIaVoc8Wg8+isdwu6ri6QRKJ8PhdUDYwGmR60YW0QwrEWKvx3X+uP\nA0QafwX4oF2tGDl57CI4g5mtZ8BBd06ijspCVpaxS2FB9AR8fIfu3D0BXZ3I\ngSQU\r\n=HQy/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"16235a8abf25bcd5b1c62374e86533fb2ac2fcd9","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfix-16235a-knobmpsd_1618820029520_0.3493913272986211","host":"s3://npm-registry-packages"}},"2.3.2-hotfixes-4290f4-knoccr5w":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfixes-4290f4-knoccr5w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfixes-4290f4-knoccr5w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9811703810a2af7a89ca679a6d207f04675f142c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfixes-4290f4-knoccr5w.tgz","fileCount":628,"integrity":"sha512-pkWLZ1Ji/ktU7lFdaZ6T0IDK5qt6Q62XDpMM8T9Oh0XyVADohIxt3YqxiWjO1M8a1LgEEaXZZkqkAG2reAS7oQ==","signatures":[{"sig":"MEYCIQD57Nib4SSy6cmIOC8EREH/DR83eGnJ6aQaaW4hshW7/QIhAOnLSBNbl1AkojSBxH+cgdjBUEAqPr7l35aS5DLyTfFg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfUB8CRA9TVsSAnZWagAAYu4P/RsOZTiJ47b5lt+9BPrV\ncTVbUxDgUzFoU0I9Tv3XtnczdOafv/IlzDlgo4ugnFb6EqVvoxXlFLBWVevn\nh6P79F5gZn5XfWunY+lDt10a3aBpjNWMpjAP8nqXHUyLmak6AnHQ16QA/sew\ney7llThL+cwPXSf4Pspeoc0ppAlnyRcMD/EGSzryimygnM5310LvxR7OlBRo\nrL4drUeWoKr3gegMNNM372+gFaFAPIV0vn5e/TjJRk0xLPTkm3lNNVf+DURY\nfG0SStd1h0xu9IsLbo83r+t6XeH2b3p4L6nOdpY0Mxo/I9GeVQnKB79KLmY+\noq3pDISKt4U14Bouv5y4n1PVSWbgENlaCNL/ElGll0wdNpro++3hJuvlUxBn\nmmorWrfwpQvxfHOKnc7N9Jj7SUY4/mmZHroj/3vm2xRjt090w6SuAbve0srl\nIrhilks48PVzjFHWNK6rOk/UUwek7K0rPnl4V2GyAK0EmWCRqMj4/oQhv7tL\nLcSovlNXVcoIqff4ff/XVFMiV3qMxnsIgat/QEJCOjWLletk1kdAgoR4J4JS\nYRfoUvc5PoJf47TjOPWjB55Vf129yvzAm4BLNFlHdD36itZrRYSnh8Ehdw8k\nEayPsnl+51ptfXpZwFByuAE2ODfp1BgCLBs3Eh+qNy/bR5vcaJE4H+b8A+2Z\nS+O7\r\n=1mHS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4290f45167107b95170e8a50ad27ffa3b7623a54","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"1.1.1","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfixes-4290f4-knoccr5w_1618821243814_0.31937413904363154","host":"s3://npm-registry-packages"}},"2.3.2-hotfix-44140f-knopxn6t":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfix-44140f-knopxn6t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfix-44140f-knopxn6t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9bf63ac18234c9cf9bfc04bdf6293875fda55232","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfix-44140f-knopxn6t.tgz","fileCount":628,"integrity":"sha512-Gbr+/nm6pVA2I4B+aQD3IFG4/LyS4PevdxDLxO2Rx5Q+7cAjAztsIC65V1NMZjbijvzrY4AmTnAsKRkh2q5K0A==","signatures":[{"sig":"MEUCIAV3cfaDpApqd5MlObp5uYPBSW6wYhiF1L+BgHPWgDblAiEArjpbHsSJeVV8xLKaBsI6kGdyS3tV7RfMFP88Z5XzBGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfZmTCRA9TVsSAnZWagAATXwP/RC38nSz4RLeA3RmLwQQ\n9BaBePybi6x/sgkYa9jkuAnYmPO28++ZGlNw0+FajOTu9WhaI1hyulhdRYC6\n7GvkPtpAbBufAdw/TxL/N1XkiuHNsmvtuTAepsJF7HiG+DfhGvrLgSJpdWB3\nvdS0Nd9eKO4y0KU5hL28HGqZEG152MlwC5CdPiluwQhqqDVWZOC3dv0Cefnh\nkiFxEPfEw/djUJGsEJ8DfV66ok3Bb3ohiCvQUmoWYsA//1vQkPxPyCa4r+s+\nleNxf4Ksss8eV27EKmde5ZrXespiW8GJQb1XjcCK3w2aKZP0qzfB72Z5+L2X\n1MZ4VFIUGaW/mB9m39JY1voRRRlsKpramz1G1VZqYYodySIDCGayWY7fWHrZ\ntdciofBhzx+rhb1o+knHM6B6KPof1I1LGnBO4O2n4i6dzwim7FqPtjtOUKGr\nNYQ9OhRJEsiMBdzczVJUJmD+ZPjSFMOrwz83S6wPlAXl5XZskUmyvGzPDdRj\nCz73jX7WKYmW2CX/3XeSHWnVnJS5heOj5G95puPQC8/gNYLavXNwHEulK5FM\n/M+UPDeRBePioDqtvx5gwgfDiTyPoCS+Yo7kihuVxtPoY8dqE7VKFksvh3h/\nI3wqH4OXiiuIJo7d0WmZmDzlovXJj07AKpxDXD9LIgW3PH0qLuNEa8AGq+zG\nK581\r\n=bsCi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"44140f07ec7d20e664e6e43ef36b53353a06ce74","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfix-44140f-knopxn6t_1618844050472_0.8247829300925262","host":"s3://npm-registry-packages"}},"2.3.2-hotfixes-546291-knoq070n":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.2-hotfixes-546291-knoq070n","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.2-hotfixes-546291-knoq070n","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"40ff9b25995793720e3ece0e95d3e151b952b599","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.2-hotfixes-546291-knoq070n.tgz","fileCount":628,"integrity":"sha512-CKNqw/oQUWJDlEjPbmwS1NlF8FOWmu33Bkd8QCbF2mgcHjaX2EELdc9XKy6SBY66/xsVrCNTPH42QnMckGD7pg==","signatures":[{"sig":"MEUCIAzaSPKnusH5Tsyyqq2dC0zhqLX/cEkzD4EGBpaRIO0HAiEA82vyq/0K6mGmMAsQ8vsfEy52/snELXzfPENj8r8oTrU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":748488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfZoKCRA9TVsSAnZWagAAkg8QAIc6+2bi2UKYQ2u3rpUV\nB0vrOJxJYVfCpCdz/dYPc3bdfa/BWQfRi6oBrtRJn5hnxMowQjz8ARRgZ9aE\nA5JRVLfMi133jWQQp2W4JlDwe4iwNr7GzAjlkHbQ3d4bh0ciDynpKbPdFcnF\nsFUq97NL25mr2P9MGeVPr4vc3dTX07rWKe4vGgn19VmlWfAj/wljaGsdzHqw\nDF1ddlopIrTL7RWYIXHQNPG+veCqbAitspi8w2JJAiho9PI/HXKnZwW52nhm\n2qZ0Zi7KHmb9yJivLiEdOIu74xv9fkzQaGR1dVNPLjme3HA7dtb2ZZc6j8hp\ndWLrrN8vdyvMNWvz+ExVJu7zoxEPX8tSX3wwHJjAotU4f25Q2RYxHGH+pEZM\nSMt+sT6qtZ0n2UNoKMfnqgbSnyFOH+SIriG0G/yq2aEnlDjZTvEbj37tjcKm\nKrV2cOguyO6/WS3riMCEmfuJqQkrZuX9iFle3PWm1JA0KSm/sowRZawEH+rj\nSLgQh0Zoemwl/rMPWJLmocsI+qLTdAO4N6LQ32gmEFvqePbg+cIczCE0xR6v\n5jEruTL29VxObUbw0+E/WbBFY79zM1BxYfeizbperVxS+aUahgScSAWaEZro\nxlZGkbohNyC36t5Z8OQ0Irfv5JXWwxBCRsHdLPaEdGgLfq723iJpomZ1GQyV\nkaTy\r\n=wdU7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5462913cf61f0205b37e303e4583900da0752c90","scripts":{"lint":"eslint src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix src/**/**/*.ts src/**/**/**/*.ts src/**/*.ts src/*.ts","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.2-hotfixes-546291-knoq070n_1618844169664_0.5452497968556373","host":"s3://npm-registry-packages"}},"2.3.3-feature-b03208-knoudiac":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-feature-b03208-knoudiac","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-feature-b03208-knoudiac","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a99e4d8a10b9b3cb49df61fa18512d609bf73f87","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-feature-b03208-knoudiac.tgz","fileCount":633,"integrity":"sha512-ETtp+i3zt2btjGbD7eUjP7/gC5A1ibmfl/P3ilwx2BqcrO6YGj9H/De/9yMPesg7VmwdQfWc/4Q6CLWiQZiL1g==","signatures":[{"sig":"MEQCIBzWYYZsuF8PWfk2u8e79vb64La2jiZrOU1Cj7UzkFaGAiBRTTLz7+6UY6ZBKi/ieF5JnNyu/uZ7mdTNWURYYn1xSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfba3CRA9TVsSAnZWagAA28UP/1M/+NwTjHlDzVcuSrm4\nS4FA3o3MFKF+VpMkxhrG0Yd0dddDsB0JUV/ujm+J1sS8ik5i37zOIqWEyyQL\ny5lrrQzk5ianCYmuJSS17Xzf08qGPuMGwyJffXqKy31UOEChnCeMFHY+tlP0\nZcmlRTg0XZivPOFk1/rxbGIUEdREeOYLIV8t96nx8DsP/A9pwEF5TSm0viH8\nArBPkGXKSx7fQkD0Ex2dEddysxgRK8F/YatT/LzBx6m7efBrewXUAdCuru3h\nsJumFUFlatff9xoPllYlT2QedDMJqw4T3m2X1aS7ZJznrDwDcr6jt4X2mV38\nTfKw2KxHTEnlr5xi7aIXbGmk8wVtmzbR5uq+UJns5NqscK/E1q9b9AW0oM/9\n6ShydBR+WhjUiduJXpqvX9LVbdAJEGJRiWzuao//ZhzjOxX6IXuRhyNwNvs2\nvywveiZNajoTTmOjndm/CJ+9rw3y+Bh+WOazSfD1OUccijbdJQtiqXD12tYH\nCAOT6/Yvugut1Dca+0igJemcc2cyb79EwL06ffcjTj9Thfq5+S0CO2dw4J61\nvrvS6FE/cJ1QpkMg368bZen8sAxuveYhdF6UXD68n1C3886MBgvRdP9ROBes\n0XgqPIJadeGLEmaycuCpOwkWSMz9mGhdVxycp3DDl286Ly7yTxxAEJZE4o/P\npDht\r\n=7HB+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b03208b639451eac27a4c83f060bb8c9397565e2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-feature-b03208-knoudiac_1618851510941_0.19776576432096493","host":"s3://npm-registry-packages"}},"2.3.3-hotfixes-e924e2-knq35xhi":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfixes-e924e2-knq35xhi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfixes-e924e2-knq35xhi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"578bf4d4e44b9fd965c8ecd4f8a4964a0626dbc6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfixes-e924e2-knq35xhi.tgz","fileCount":633,"integrity":"sha512-RUde1e6rSJgXMKKtilw46Zufe71j1EwSDWrKMauBAlksc0RKM/lLs8hPxH6nZmkt8bj8j1Nk/XlrmvRf4FSDPQ==","signatures":[{"sig":"MEYCIQDmg1KiTcHwuxTRXCzM8+vEDESb2HprKd9bzoKeN9XLZAIhAJD9vGZWiOY3cPGMS2bc3snKtDvTN0eJqqnJRTm0gBvB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgftyTCRA9TVsSAnZWagAAS3QP/Am73DCyfS4q435EcqNE\nFKGQcGMp6leVdVx5rluVFgV4BZUbWjYeShQkN3DeGkWgchyT2bNtJQ8NdJLQ\n+jA15aG7sR3ZUfMz6MC0DMAk3iR6c/qNZwErYGxca/zEGvA4KqWVsMPydK/Q\nREgPjLGdr8vOQpq6vkPgKVpQycthm4Ao83ydVk3DILcHXh45HDGD5rj/CrGo\nGMTr4YGCkN/7nSIkHm2Cmliwx+BPUlNMNtpOftDiZDc5vWdPvfxheED1/GpX\nSkNm0PPUVSKhTpHetnxgmDgaCZ8bHOcyK7vnNEhdlhVO9Ora7gIzhhE+EmYO\nqzptSXDM96m1x+YSZh5ez87L4kG7GcnQ/DM4m9kAaLUYSKxjnSjerT4kEDtc\nx0bl5QULJeL25snAFloRGC3zMYjeSZMY2A9WBOZnw3DOiv7S75jR2NFX7ozP\nhG/JlZHWmk/bDsdfcEuE7VjUS/+H7eWBXa+wR2Ppl7VAKO+vsGEIiWfd8ZSO\n6hrd3mtkpi/1Ec5hd0tdQksBV1STMQ8559Q4HFhLZezKnYmFlsmj/8rvaBqx\nKcL+EJYCs/IOk0hQAH7S1bmwmjwGvub2i5BquJp2duVQxSG1eY7h5hicu2RK\n6SMsQyQ8rfiZh2jdbeu0xyE+wngoXs+mXJvyktlrlwgqKMr6zqJ9j/cvhOBG\n/K6P\r\n=CKfM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e924e2c87daf5874f87193805d78a0f910c41a66","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfixes-e924e2-knq35xhi_1618926739086_0.5473453810661935","host":"s3://npm-registry-packages"}},"2.3.3-hotfixes-ddc7fd-knqf4gnc":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfixes-ddc7fd-knqf4gnc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfixes-ddc7fd-knqf4gnc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cd60bbb13d11afdf839982a3d3f266d29301808e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfixes-ddc7fd-knqf4gnc.tgz","fileCount":633,"integrity":"sha512-KK5OSBUUXIcYVgA9IJ3Os/r5TBVKAQ2t/zBVBZQFCs9KGS9ZK1JiAxxTbmTg0kJ4Hzh5Tu+jBb8tZ9ufVgEphA==","signatures":[{"sig":"MEQCIBEE6SvXCXshNQwfUpsd8wtl8L5a+hw0XoC5XGBu79jZAiA1BTYI7m5OiwgjE8Ou8HA/zwMyRPnw668Vua7MLWePLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfysKCRA9TVsSAnZWagAAFDoP/itU4x8x5jhd3rRfFTgh\nYcv368G/HJkVCGPS/KJvSvU1qUpZjx0tV5MIuCr5cQHd62Z8/7S6HThEIRyM\n+TD/UCkZAvCLJOQFeh94hLW+gxtbF6caDyQ2XjPWYyw8ZyRSqyYN8pIkSFtk\nj8z+BNGgNEcx5yGQR9/SRt2CQYrNgKi73ZpIOFc3YLJAzJa4bMIu0Gh5m81w\nwUZYTr/0u+Jv0gn61ipfVMza3BtuK5SnhoCjBlbHqIecK7SjF+YrbP3GLau+\nJxCUoj2QBBT+MXoYwGakbaQ2IGm7HPFUNTYvoRIf1IN1FUx3BdIjpJGSGiB4\nd7vS7D1xP3F0YYV4pj4qOrkrtaXCliLM7w0z+c8zE8nixjNOpDNCEDhHyEQp\nML79BUPnOl8cA2lvF5eZK7TFjO0yMYxVWrtokijRkM/ofWJaH0BRXcrfusjI\nuWiieHOLifarrwP6j3n1l9wG++9ltCJuAqZq3RRPRDn/VhvPJhKBksgPMcn+\nzee5o9AAAXR0UR6cTpjOcNlsgKka+TY3VWCuMzdmWzDphDGbUuG9E8yHi8BP\n/hwR3zYMrYt2fFXlVfw9LNa8tLanEyHub0EdZSlhs6k9h1KWXLL2zfuFUfOc\nJNM/EXJ6LhYdGPWWqPNPlD2Kzcl/w+nr5RoJEPAq73fF+urXS/EAGF7E0lV2\nyUMs\r\n=NxOc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ddc7fd3af46a83d75bac0b644c82ecae311ac0a8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.3","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfixes-ddc7fd-knqf4gnc_1618946825697_0.7208501010504176","host":"s3://npm-registry-packages"}},"2.3.3":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e50b738a285e7a715b6ef1349a472f95d9832360","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3.tgz","fileCount":633,"integrity":"sha512-+5pGTRaDrlTatEVoi1pAKHXjQsbAXBEzN9a/aq1vhQh10FLdgJv9YR9FRIBhqdDAVjEUyFafW5CIqobgaP1sVQ==","signatures":[{"sig":"MEUCIQDA/slhKxNInIN+F1JBbT8DFy5qkQpf2eZ5bZpTY0FAPwIgWSwL8DY9odVtg/b46aUr0JWEb1QUqbz2ZAFawEJsN8A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfysoCRA9TVsSAnZWagAAvLsQAI1n/VSxTF0iqyK//ktK\nNTuLENizwFvppyD9V2PwifrP8Opd9ZLp4sCeJ4/zg9I49Ve0ZhcZRteT998l\nK6ALTjZEifBU+wyn9R/fSCEqanoPbObuTjyieLa3vlzMrpOAZnbjbFeKfOsb\nkYELBTxjrkCs63z3GxWxkqClv4SkRBwIKCHulXUdYJLG4eGKn79i4pBUTgyQ\naGKGBxgolM5Y+E4MNMLGR84yXsgXptl4pOA4YiOpFwlHHmEhhKN6/0qdTwGj\nhL4X5Ck65FGhSnYgcZ2A7B7ugNlgN7XhPWClnWMHV50m/ljHjiBynRlk6HXC\nu+fOMMdKyF6pg3ZXmO6uwkjxEBsV5zJi15qv54TE44RmNal47vfbsV/KH9Ql\n6DYGIFjYNghkyw4FfWjV9GUSaKSFlyl1HEpX0QbHcYZSEvkC/bv2ptW7VeCB\nzRhXy1EUE5g3gVWpzOfIL7cF+LGhcNKB9wYk+2KC7ChF6WnuCu2LHTkQl9kH\n66DwuOqlzGJ6jcshXqD8OgI5UPeAZ2SR18FeUTfqqAQQAsbc1qzXRCSyZEjU\nyIbLgpnAD+PAVr6PcXWnDdQihK2jlq4niC3Jhudr38jFcySYsiVlFfraJFxb\nIUdx1SFdS4egbTWWDN7uThfTjqeH1Qb1q/rbe4r3nuQuCyQyJTTm7rvT+8A2\ndrMg\r\n=mWd7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"e038fef926ad88e897db1d526e11bbf981e82415","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.3","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3_1618946856058_0.35794615421148723","host":"s3://npm-registry-packages"}},"2.3.3-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"405c03e19f8946056cce344c390047a9ad335cdd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-beta.1.tgz","fileCount":633,"integrity":"sha512-RvlpZ6OlbHpT4EG76ieyWiLNX3qDDqhEdNAbLr128KenoXXuEBW/auTaOn++XWY+56CKXeYOztXwLzDEEopJYw==","signatures":[{"sig":"MEUCIQC4O9o4ZIBkJE3obnWG8B0ioIAYq0SQ7OypmFCujVRqJwIgbx+7szQ4ItSteVc/ewuUUAUWl0TJlSVYL4H/XfHHSLU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfyvbCRA9TVsSAnZWagAABi0P/jdNizRlwKWr1f6NlW55\nmIl9JqLFnx3+TS88T1ah5kXGAOO+JajSkVPt3g0gIZ3X67DMIcIEZ6HKM+iq\n0Fo+xycV1L4tFmZNIQJwLCDh1AakRx1b8P3VG9OxTE8nSgrYdurnHmLwgppB\n3NARpfMYLjFKMxeR4kwNqSFE3yGWlegC3akBcxhg3bVg9FDdrWGQMo5BS+Qc\nmvHfm9rBJw5wjtQtmTxntmP4Jp41ie1QY2lsXGRczSNx0C3U5dL8bKfCIlLe\nRCvXycANu3yPX+37N3MPwUB5+nyBKrQUXJim+ndkAd6wEpHoUeQtmYkzeOeL\nkHjcCCPQLtl1CVJombYW49uSdgguMCsFkIackb5UdDURJ32IIQJ8oCBUD6fe\nmALGzDoOQASnYiBizN2FONNRUagBq45l1LRcqZcV29CYD19+MUZfZ5So8tJP\nnqn2DTUhvI3eEwstcd6FmNum7/wfQc4gpGWGrIRnxnOhvHjnwvWb1ZupDmMO\nyZ0YFIzaP1sJbu8pzlY7lJsc9e1zBIf6Qwx27d7o0TuSdy858U7OqoTNmkjW\nFNpDjCkGIpL43BL1DHDHrhicSZx6N0tb6O0GjMYIzQoi/27tTA2reThS7VvL\nb02czwJ17tinYsOPqAzA4NxMb4Tv95QU89p0BLnDFP1DOnnPcWuxuBe4622T\nsa7W\r\n=AynH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4a2ffb21c805b2d02d61577bb5f747ccbfe22278","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.3","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-beta.1_1618947034976_0.2784547755717086","host":"s3://npm-registry-packages"}},"2.3.3-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fbf00962c945cff5ab9032b74bdf3e9b296dbb85","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-alpha.1.tgz","fileCount":633,"integrity":"sha512-qvy3hJDE6M4khFKdrL55IIONu3tfO2H7nJ9kUQvIzZXj3LSl/JdMo+2YHPdAEPGOEe/5Av3IGGqgSg/FMcrYGQ==","signatures":[{"sig":"MEUCIDtJ3/H1nrfjJ7lSi+7xQ/THw+QkmySCKIrDlVtyHtXkAiEAi+7aSqqPck8IhdQ3Z7FFovYVo3dMILKiuM6kSubA4e0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfywNCRA9TVsSAnZWagAADTcP/1kbpiizrB422yGLCc4g\n0cwlmus+nbZ50bo6iLqyBDodrJXrttiCQGvK+yP0ZS5hBfm+nBhZlMU7fn39\n8mF9wOjT8lpGFl46YRzw2Gq++U75CDjoAvtED5wGt7WH4dAgnY0HgDLvM/Dk\nB+mMImonKE34FWf7cmVej3G7za2ZATnrqwQkFLT87Noj6eDeU7JE/ZDW+qgu\nZM1VKEPD6qkzvqdtG3MuMaSOYrVVIIu0VBK6YI0Bd+f40uy3ZnkX5zy5XF0s\nPqrwm1Xey0qgZFbUQx7F6PLXONmIyyi5Cg6oqXJR1SYC1ZlBONYaQoGaME9z\n5BkHZbdOWpewsVUTMRITLGGxamckxeTErsy9aPRHaenIpCPkdGYgEwtn6Y9S\nBvrplkJ5CLrNAsiOHx3eTUxWw2dgs0kHVsWjIqgjwCLHisRALkq0IeQ+S3oa\nzr4dfoabRaCvo5n4w5Vjj1aqPc4cYrIPlKi4HCpthzvceAahyCb6xi8BrK7Y\n34Bq9UoS5Iu+nTS+eEWyU4iSAbAUtZvxX9yJ3veyEwD/DGpmUpc3f+2EODOW\n/Iwrt4wmQU7HmfH/U1kwe6mfZxEn10d322/W2BqlLbjdhYLewYwQI53UDVIq\n2ze5xgDVpPC6EFv1FEoVK3RIykEJS8NW2i67kSKKO9UxAE8lNAVJEavTi0kb\nZKdn\r\n=cDrC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8198e0025e1f56a30eb68c50d95d96957e204077","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.3","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-alpha.1_1618947085458_0.3755316408865077","host":"s3://npm-registry-packages"}},"2.3.3-hotfix-69d93b-kobg3an5":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfix-69d93b-kobg3an5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfix-69d93b-kobg3an5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"71c9d587299ed070ac6fb63fba3358e70b94ef27","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfix-69d93b-kobg3an5.tgz","fileCount":633,"integrity":"sha512-fK4iJ2Em6E7GPc7BUbOLA6HgGy+BjdbYxRHgtPar2XqJL9fiZfN18mg2KdbcwsTsZahsJrYQIaaQGtzYSCL96g==","signatures":[{"sig":"MEUCIQDyvMElaA3irNil1zAJr1/AQG/7hVLBt8SF0wd3c83mHQIgSCyTaClnOPQlmtZgsL6U7nmpFxNLGwpKJMlqxh8x4mY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkpGBCRA9TVsSAnZWagAApp0QAJkcz3OlOfjKG5bZqBse\nUnism0EYzgaGTf9z3HAQy1Qd3p56dcIQBlnj5zswHSH4p8STA5O2Fan7en2D\nE1eOjsH5fGcPcZLo88tzk8YJEVZq0lBWu2wE9etKu3YVcH+lV5rNdT9eWllY\nST3X6vieADJAxz55nclXEioVS53FLoVJsnoLg2qc++U2z3ZWzcDH1Hqu1Hvp\nO+D1OiFc15AA9m4mTZ/J0yqVIwNwty7ewqel4Svr0VsOGXmPc1LnW2iLdjAg\nVwxat954y/UxkWNWoBb8PZR2oVgi6d8UoS7sYq9A9Mi5Qb0wq/Rn8bx1pbsr\nt1UE1vxIcs3r9cMtKcNTBwwp5ozF89cbA6ShtjcMZnq9ByTmp5oiY5yUjZuT\nHuCyt6bZg1hBKB6olb4LvsnEJYcnWim0NgaNRYRyazln+czznbQkb++/i9UY\n2qitTi+/Ji7hYsHePDnosZoMZJV9AhZ0YJyAArvBZBfIw6pphsVsBpMnizju\nG9+5xdInBBSMQsGIoOzKd/V81WoNNOt0TVJWsaSOvd6wMGw/rO/yxu1VMGk8\nnZ1wqNALpjwQHXbd4orEcOhd+KxHcXGD2gXr21ucJfDp72DpeSlNCgfw4opr\nUfSvLry0ZuGOsNN8QqxDhN2u1EOY1Ykd6TYvG8uHPU5MzjPvx+/frB3wwVqP\nLgWS\r\n=EBPc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"69d93bb8bc1c6a946b27162e78ce3b151965c61c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfix~fix_parsing_xmls","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfix-69d93b-kobg3an5_1620218241101_0.6159672432872263","host":"s3://npm-registry-packages"}},"2.3.3-hotfix-dbb364-kocw9r53":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfix-dbb364-kocw9r53","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfix-dbb364-kocw9r53","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"380e36328c2f940464bef0c5ac43cf5aacfbbf42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfix-dbb364-kocw9r53.tgz","fileCount":633,"integrity":"sha512-b/zON4FcBPD7GM7hyotMcHJypDwBWe2q4x6SweTjhG7jyWz3fM4EwNcBtPCfBBOQ+2ayVKHXyihMj8KTutXzMw==","signatures":[{"sig":"MEQCIETY4kdaULQDUkM/N9OgE+UeKACM6MXE9aQYWdkgJwhiAiApW7JxLF1eJb5erEZ/Wm5Got1r3NfwumLKsuAEy6/UJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk+faCRA9TVsSAnZWagAA3xcP/2MZnVAikEFR+DWDehd6\nqoKKSEfrCdlAKs/lmrtoH2yQCc56xPMzJjbnRA6NBvwncXCNU7FvPPRJbnQi\nk99yUBw78BepNlP+GgBLUgeAU7uumYYXVoBqCY6Ew29olERmobkPC9QvaTXr\nVMotPO6E9BCJEOLZPSVhugJRjmnfRBxvFAXuOV4TL98vEK5nLbD7p76V+DBY\nj4FUy5zqq/6Vy/Kufup0LtmlF//3l5doWqZU0IkCHeMO+QalKFj7xlZv6/UH\ngatvyjGJ/qdr8Uu7tDcib8MJZdP1bZbvTJiFcsAcAFYNiwsmT3Z4oI33U9c4\nXttxHJFdMOsDh9jwVIjvtDq90wNHv+Y1uR1wBoy7jTBu3kQtcc+IiQdE2H+1\nYia8JVQbE4hBAyqFGnHer/vrHsMW3Rx7k9BVjZTw4EjZU23YkMyWdDFTF5mp\noO7I4ZKwxxQsiJO1tEZd9EzgLjmZFjqainut+Fvl+3sRoVn6V/1Umd/SnIXl\n2ZqiV50571rdy/8F1UVtLasbAIKpWT/FGbeLcKsCjsgY+DITjcvl9+m4eQsc\n/xq3x6L1md43t9Co/q58+LLswyB20HZPDrz08qPZpGym57RuJorKJaTnoNtx\nLcSdd5niCZnClr9jISe8aX9vVzV4gC41Elz3TwIn1sDR7G/2CRxHxBmaPRNc\nIPPG\r\n=E+OY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dbb3649752a31dd8f894c6df772eb171f1c461ab","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfix-dbb364-kocw9r53_1620305881611_0.3246323527805759","host":"s3://npm-registry-packages"}},"2.3.3-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e65f51be2c25eec1a8f66906108898ab1d8f0a9b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-alpha.2.tgz","fileCount":633,"integrity":"sha512-nTdqEcCw7mfa0BXnbnBidmFbfWYRGT35Joik8/G+1yfHR2mtboSialJjNvqu1cOOqUZk+SqoPcuevnCjqrWseQ==","signatures":[{"sig":"MEQCIFxeXB+Pxl9tlLJDM3lRk0TkY5Z9alGkXWWSI/gKNkEbAiB1F+bFXuP4cUYMsMI83+JkktOQKhR88pfPwpKU9w8IkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk+zOCRA9TVsSAnZWagAAfSgP/R1lbrY1UKQY+JPWe9Ou\nnYRYMyi1uUqJuJRdFpuSmKgy6m4sQNIb+9PBfFQUwBOdfWViI8W8TFwhd/t+\nLzWsbIFBofDDlzwn37m5eJlFxFDvjLfxQbCJG7x7fbSqzPrG6wbp7pZQ1Ffz\n6jDBnNGMdWKPOa2/SBiAsEAmnmcMwsfJtTtL+3ydMM4DPGqtp2QLMuunlPmG\nSmXdDlvRoWIR349zLojZLwYRcl36EKLIfvdiBzSHNuZr2LI1Pf7QE8YspZ5d\nKMoQ2TlQjxRXTvt9+IRfDE+gKR5ncsiKHiOIIrKzX2TwhkSnCPUhtoAAtnsb\n7Ai9gSEoYTd6llWqvVTLy9rBFE7hga1Xd8Vw5Iytx0rrCDNpxElb2NmP5eXz\nw9Q2ARK91qxxIIYSqiIHEP+olRpGP0Hz2q0JsWbnEklzt44Ftx5yNJnJIc/U\nLwoPihBQDkt6AKfCA/BWuTbORFaW0J0HP8PVNC/xqsqo7nHv9MApC2IXNBLW\nJsSrOEfds8x6+qH2B61tchzWez17sK6L8fxy0x5vrAIkmR+ii9P5LqNdVzp9\nezqIo2fgDnDH3Os3HWdKgEjvjiVWF0iuV7aRHQz8Ms5yQeWwOmfZpj9KXpUQ\npYJBmVjxRtns7buXITNK3A2XHP3lKnZ96J8MQ4OO84Za+QRjSfyfVeWGxWMc\n1t1b\r\n=3M2c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6e8dc5c962d1010321f7dc658489bb642fec414d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-alpha.2_1620307149687_0.05000053559662909","host":"s3://npm-registry-packages"}},"2.3.3-hotfixes-7e258e-kocx4v2s":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfixes-7e258e-kocx4v2s","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfixes-7e258e-kocx4v2s","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9b37d1ced6cce69d4b49a44024f8e8e2a85d145f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfixes-7e258e-kocx4v2s.tgz","fileCount":633,"integrity":"sha512-o74ha2VcaisLUtxKF0h04Kvy5OcaYteIDR44eqdFEtyHPfO4MWZRCHvv5yDYCXLRx7g9xrrtDFZO7BxiJSNkxA==","signatures":[{"sig":"MEUCICrzOs9jJaGUyIi2YKpuG1aCk5dHeudR/MNaqmqQMMQ+AiEAu4vG1ZvO6MvN+a4rf+2Y4L+gPOigo5/dlhlrvDdbHuE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk+2GCRA9TVsSAnZWagAAo1gP/34LP0E8+fXu6lCnXBiC\nZNXpDh+uknsv3GHhNB5Za3ZqLx3SPoZ4KD310j40g/uTvoebkkL293wZqMAw\nHQbqTajlRUZHBigDfnssCweiZoBFgA+BPF0T7wT7byen/xRRIiMcxZwecN9y\nPx0Jcb+zdXNkPF00FhZds1VohNySkV1I/mGuAb7rI7bEcycENKkurGcE18aq\nc63myltF+984wlLAUY6duY5ASKY2eihLo1fLwcIwi17ZQEVMjdJh5ZTOjYhl\njOL8aJueFy+YWnEDO2H6hSOR9GezzdQ0oa/HOBMVbcWeIcb0LmEN7zGbrj5x\n8siXiDGZR1NcXNqqSxGUkbGZ4FcJG3vv7CV86RCrGDerKUj0ohjh3XfDwv5l\nUr+/AYmdx6VIs33QETj65++0JNvUD9RQ1aW3kmwqzVhBVXk+bbnweIVrTlnB\nj2wvRKgSV0y8/pwKNwsRldKnq2Fhu7eCwfG0eNNFlZp8rswChk17paf0xlL5\nJ+55I+3bNC3EkA4EWLUALkICstCI6uhEJIT61wuvjG2m/zkwROW8CfG8o49E\nSMDki5VDyeAi8lRIaH9mzku6RO7FTQ/CMNTWOq5fu/lz2pk0N/KtAcycyFja\n7lgnvTNaKXTVVsA0a1/XfWuEK/576ltN9DaJ+1EdoTldxzJylaCVShUj5pBJ\nWm/r\r\n=EpgY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7e258e324c871832b077e42194c641d1af904d03","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfixes-7e258e-kocx4v2s_1620307334171_0.08044326971489024","host":"s3://npm-registry-packages"}},"2.3.3-hotfix-a98bc0-koiexpmc":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfix-a98bc0-koiexpmc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfix-a98bc0-koiexpmc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"96b21be2ef53116e38739d7ec00ca0c552adf1b6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfix-a98bc0-koiexpmc.tgz","fileCount":633,"integrity":"sha512-/zk68wLeE7+vSu3EQ1Estt1FTBWPmg5redlwFePvM+DUl9UyJRGF87j+QY9vhY9uB/Hw2HNS19iNUGBPqYGdaA==","signatures":[{"sig":"MEQCIHpy8s08bkQQ2PByj4qwkQs/Mfe2XKjqmABdbN4Y9t3mAiBR3xCQnhBVizIAlhFKmMrLe5LqRC+vuk+1N4IqXg8PdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmP9QCRA9TVsSAnZWagAAqw8P/2eUjHIrjQwhFAtiqRyG\nTk4+4qZSWXOvbMTDB1/N2LD5rJKF8T4qKTFKkukMzCEowYHkYYS5xXfHJ4yy\ntMAYOkcr5SVRsqZQ4CjMnR39m1R4xIa1QGYfPiodSssANSSReFqebK7/dVNK\n737gvJpto2cSMCkSXB/Y5z94ITw93kCGJsSJr1ZD7lvRAI/g/UQd7FCn8yfc\nu7mEhB13YgrciDbjrLY865iLoHkrAb65D3cPNOO0SEVGoii2IraOwgYsG2QQ\nVkFOIcwl7azNopD6LXKotW+DB9YVgAgaCt49vbuALTvmXHcvUPHLSwIyc4LT\nA++wrJKN6PmQZSJzpNzZUzXaSwq58fpKVL6jWjPdiwntWtbPeszEQrl/37nM\nzg0KR/bLKjHfQpLoLrxsF4UwPTutKkyMt4LwkOkgp3LMrW73Njfv+cla6qGi\nZt8ttS/EUAF+epV7+ff0onD53TkVlhQwWe4Xcl1OcxPLzBscFiSJhqrAcdOB\nMUlltFVUpH6hwx456Cyhy/841YTiSpcm1lNMoEP74Q7jGtPqElqa1g6hirlw\nfoDvAaSuyvH9R6ZcFosqu/QNj1LdafzXIH8TsIy0N/koTGFak27YJI7BbY9H\nAaZz/1lz4jxoYAK2gNgXKBikytknnSU7VCnl46alHSgCOPT1xRRXln4IboTM\nuji0\r\n=kSz/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a98bc05e5cb678116232dd2a81cd6341b3fdfa63","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfix-a98bc0-koiexpmc_1620639567699_0.33588078300831925","host":"s3://npm-registry-packages"}},"2.3.3-hotfixes-be3efc-koiirq2t":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfixes-be3efc-koiirq2t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfixes-be3efc-koiirq2t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3862bce98e9cfbaa373bb505440ba109e862c817","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfixes-be3efc-koiirq2t.tgz","fileCount":633,"integrity":"sha512-EjyUiANT57V4BwgvgDywyQ/ErGbyEPmOFFFkHoceOa9ZMUQDlrffipKQsYfHo5nybkCtILEwZDf0rdbm5Oz5PA==","signatures":[{"sig":"MEUCIB1sf36Ez+9gdyThyVAUNJW55F/U3VRbtRK004Iu3zPsAiEAht0RcTtGF91my3Ji3KXt6oGGDbhC7cm3RZLcueHIZFc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmRhxCRA9TVsSAnZWagAA0hoP/1PfOC+19/H1ChzD4T+C\n2Sq1UL8c2wKHeN8HO1dhv7kkJemnaCtLMFVf1AN97ELeBVTFBsh/WA2Y5xhf\nNQ3fZ5/TI+p9T+cH3so6ZiE4XGDaHUz6ZuNq2fMXw74qG0t+0tjiomdLWcil\n3p62rKH5yeGc6G61r92E/LzMq4Uuo+hMsx9McSXPVKSJLJqG/sgVDnmqvdoN\n9IhZuypiXZ1klfsMdJTf6yKi1YkSU643g129KIZnPt4qSY5jZvrSzbJCIr9l\nJLU+Keh+pt1WiABFOyabxMPkVy9vYuiAYwObk7f4iefoEgOPrgCdnwf40ht2\nX/y3OJGB1pEtefmzsOsN8d73c//eyb559OGqjHfAS7zM0R0oh1pwUDICiDr8\n7h8NaQFMJlzdIrVIkWuy2H8ax6TCwos1WbZ7IMi+hfsJteq6HM9RKCB1NwUm\nfP/aXL9u/Mh0OQsA/9eJk7MFK2XWStAHO1Q4B7l4vIhp3slOiZFyXUeYDnt9\nRW89f0fceymzSPcbmh69MkNyvAwHSnZzAvu49fH6RLFr/rOtUrn7ru6Jqtmu\nw3j+8A/zEax0SvBP8FyOCOOyw/+H/w0FdbaMtGDaT28uGyQ5tce5qnWHUnPZ\nu/IjUH1erZFNtwvU28b0OYJGTMlF6A0g2Vku3YajMiOJaPVrmy0Rd+myaJi2\nxQv4\r\n=0T5d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"be3efcbab45fc035c255220b91cf23dfd28691d7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfixes-be3efc-koiirq2t_1620646000635_0.635010392992714","host":"s3://npm-registry-packages"}},"2.3.4-hotfixes-aef401-kok19wvn":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-hotfixes-aef401-kok19wvn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-hotfixes-aef401-kok19wvn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dd76de0c32d4bb1f59c0b4e6db34d89019478e03","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-hotfixes-aef401-kok19wvn.tgz","fileCount":633,"integrity":"sha512-//Tv7PeI4vVvSoJk8NSN/tUGBl7TA8XWUPqaGQqEBtOYI1lQm8yHFxU6KjElLyY2bTWu+UUXMXbX1DAIy/IM4A==","signatures":[{"sig":"MEUCIG0K1cq4RqqegEaFahBNt7gZRStoVg8ZgYgLr4QcHkwDAiEAsqueVxZMEFjKriDZteiL9AcxO6BH3LIuMKfsdhxkbok=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmn4NCRA9TVsSAnZWagAAVOIP/jfvvZnI+dAj1zrm93jF\naodaI6+CG/f1CLlN7Ksvt3jcMJQbbwvNFHy5093BRFQIR7/LZYZ3CfZmZiRr\nJmpxwGJJ7hkil/kwReBcfKaCiK+pIwiIkFJ8usojA4JZ3x3phgeS1dyUaMvP\nTAKy+VBWY1/OBHzvtoWvYTSN+LM+SFZiMVWr1qfKqx0NYht1hSNxzSqhGaya\njvDBuVF8vpU/jTec591himuj41fLSgtRW8IjQxTtk2B7WNKWCeGI568fCskS\nKFyNx6/eQLj3QdIkcokGHY6v/KoT9acv1ApuXqurBOoaK4lxasGjeKCO4xzl\niiwReBUBzEgB/HgIhbNE2g9p1O6fJLYfTXaPcjaBGXtAMrxvTwtV4CIUFYbs\n7HJiJzRaO+eQfc5VPD17QXzckqXoSWzwZ/4wkjuZNgaIwjbMhfHp6CoGpeov\nRU6XfyOl781kiWcK7dO3y3i2cvMApWimgFv0NA2SBGT22mdX8zMRe/Bk8A19\n8avTLQ05Z3hLEI2q2wNE5hmFJPnxCcTlmxwk9m4JeZLfFinp2Ua2Q50RqU8n\nwXV1gbMvrTHZ/ZcXjoiCXVou+M48SQLMZZauzU2Cn5MTFyv+M8lppiDZLQcw\n2NT31JYR07No/IW9qDPcUbdr+Vxr2ynnAHYfJxgk2bNyQxQ/Jtqpa8yHxBTz\nWHSH\r\n=orzV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aef401ee60ebb8978f358dde2a97e0d920013063","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-hotfixes-aef401-kok19wvn_1620737548727_0.5847163907974098","host":"s3://npm-registry-packages"}},"2.3.4":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4c205a8523a1e3b45586390e0aec767b08edc622","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4.tgz","fileCount":633,"integrity":"sha512-qHb0GELgDynxExUaXyRUIk4pnx67VHA7pLCEGhYTw+yX+i+gh6DzcXsBKznCSK7nNxHWlWN46bxCcq6ToDb4Pg==","signatures":[{"sig":"MEYCIQDR/Zhi6PJMa3mFnCHFfJgiNDHowTLgz4Mrf93tyQUTrQIhAMS+W2uhmOvBIoBJmsy75FSCtNJk3CFL0J7VMKlncFMv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmn4YCRA9TVsSAnZWagAAKFgP/jDcUTmt7Oe2Be+2uUoH\nbCIvO7hcoAVLCKsjXlyPCI8VXaWsEEokpyH11cLmOqdza0XXJNrhepF0YKcY\n+ZDis2KJvcDn+jjFscD6A/3GxEwsRlLcdZ4B9+0iUwgkxtCgVo8sQnXH+Loh\n3Ecy9TawNO/qmiPMJJNOqd/KFCcUfnySpe7Cuo7qB9WUw+Qgxs8tDVQe+Mre\nYg1m6Zv3JR6BQYDoTjK0aL1RLYunZifonv3Y97upDbe31gXh81ciMO9sRdgn\n9JpXClvBme34p1TBeOzHenyabqvkv2+1DypllBflOCBNYV76jp55FseQ/OOe\nySnyr/vzDZr6iTpb9t8YLqv2hDfnV/KoyUOUhdEcz/vorgwxZei8THSJ/N2e\nFNuYAt+fr/+dNDorZSzB28On/rsMUqqBod/saLhMUIx86KHC4YCmXUCB2Hei\n5BW3j8xDyal0F5NDJbL7ueg7g/1v7xiDfHJ4Hk4U6L1JGN6p78ltTK3eivF0\n7IeTQlnJyGZHt4s9aMfwQNWLeQ2ttamacWis3mK2R78RBUZd8bHO/2ynchNS\nx5GvsNQdl+Ojef455tER+Mb10h1UBhD16oIM9ZiacH8ng6htX65pUVrKa0eG\nFlm3DiHCV+sHfnX3VvRCq23u0hNm4N5bZsGwXsAMA5MfUJVWZYilg8keFohM\nUDCt\r\n=HepF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"f93aae0273c5352754c860c756205456b79c5b0d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4_1620737560078_0.09787445871168932","host":"s3://npm-registry-packages"}},"2.3.4-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ab6209d78ea42cfd3fbff3a93f9e45d7c201842b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-beta.1.tgz","fileCount":633,"integrity":"sha512-x2w2ltM5YF21aMTz0EHOz2AVqtkcKqjPJ0hV7WMdmyHL98AoRNgX1U3xHUhuMtsYiDYe2wjvdrusvDieptur8g==","signatures":[{"sig":"MEYCIQDD241/kzXdVBSeKHDg6KejdigwY7kqbtp2aQzeEmclggIhAPyL95YuwBwEhQwPzS2R8Dp4Ffbl6oU6fXtThMAQ6htr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmn5BCRA9TVsSAnZWagAAiXoP/0yNGLt9fbsKTP0oz06h\nqwAn2m3ngspCIVFYHg9s4UqTeqjnpp0EhgkFbtWQ1awWp4Y99PnMXOeoh59/\namr9CoteVBSreKeE8RMvoT7qcqYbA3SNuMNGizXT9lPx1DQZZw1mBP7KmwcJ\nk3X1FdbDe3UMWwj9+CG3Jx5F4gPjcWdVGQ/k6M1CdqiBw8n23gt7B7ivk0Mz\n5qKx/gnc4MXScw6RVsdrtnB/l/67Hykw7zSPTut00sVosVPMUW3RYHMLo68E\nNp2+16cno4RHwOF5w0nNbB1YctD+2NpJcz6d5YoVjki64D9I71BgfRHMVmHZ\n7pG5uhESRL99tvnWU1l5vj+lEtjRC+WGEbuMn+ORNKBgruw5ffBjW3SM7ZpI\nWk+iumyxmGbp21twxAHEzn8iqTdY8ffXWOKB7kaJqM0wsBlIXBd3dJJT6aqq\njNQSW3JRgarWBrFWQO1sEpLVLKXJ6aaRZClGaJdN+MgGeZW3dbHeGz+//3Og\nLWO+KS/Ys/fvdk1RejtcVSQJUZyAHZaOnpO5CCfP43jlwGf1XJ+HtVCL++Yg\nNs6uBdf+r7OEwJl+S2w8A5JDXrBy0Jyk1Q/r55jhpPNHgQ43XIckP8HGxBPp\noXGXi80naZhiIfN37tDJMLx6RTKV7q7j8ljha8ZN84/H0j6ub+UFrGFi+Sq/\n2MaI\r\n=RV34\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a39414f36bca98d03f1d0e82b838e5a6f6382ab0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-beta.1_1620737600716_0.654590903670391","host":"s3://npm-registry-packages"}},"2.3.4-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf87b4a4ee33253479643026ef8c8eb8e727b691","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-alpha.1.tgz","fileCount":633,"integrity":"sha512-Dg5MV/BWI2FuYWsoRGCBUDz9ldZYB75DXtHbk6s/SXEeWiYkQKO7MHN9hbqan/YBbKv7MrWO7ahS/7THTSMNPQ==","signatures":[{"sig":"MEUCIC5sz7uOBuzv6cSi6vBXtyax4E2KjMh7SWGF5gtKY4AMAiEAlZccIbfmK4GpacDl5YcSiJ+LIXnZsKo6zQYvWjy2FP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmn5nCRA9TVsSAnZWagAA8uYP/RDwsTUAZXp/2BDn/NfI\nvOjjGpc6z1zUSFxpc+aWE2jtb22lP1zjiAB+vrAA1gjVyUH2+kv3BRKMhCVQ\n1tIwbFrAqfINSgSYR/ZM+hDX9yZnq7H11A3GNi1+K3QQmpxNVP/wlJ94w2zK\njD/vcsjjADkql7Pb1ZjXKw/c07DUzslhQv/AiWb7hdBD4a4GIbiNKNGQC2qD\neOYAkRbecBdj/NgAuAflYuf9xaeWdXksg8nUVQ6i/2twkFISWXezrJlmJ8P0\nuWdAklYVqk6RJU/Lt5Mr9CIoz1abkLvDUc3bQHbVg7wcGBzZgYG2xwikz8yR\ngkNk3KjEVAVIYqnV6nAAoQE3xrpVMccJ3OvDlY96aIT1kUkeznVT4QpoQkYF\nyC0Y61q0PnBUx6Yid3mllexQYtmepCC+qIWj3m3a5nvKoqfibEJKP2nJ9pxp\nabdV/XDgb6MumQUh3WlFPEukO/rUJO/jiclnR8VvGYP+huSIPYT4aKM9fOXY\nfkoGaxJt/CLj38dP+t3wg2oBDDpKP7iieguxi8nDJeC9wEv/pzEG2jXedWOZ\n+7R4dEJbrcyJwe/9RXnT+QdAxOroavRNuR9z5Yu2/4vHBk/HHgDBu9Q0GOcO\nGenBvWH7vxiBUdNfRMo2lH6eT0nGVLX7bHJebz5wTFp5gNMcWXOpwSrc9PYp\nHw5O\r\n=uXab\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"806c4ceb111b8c15f8ee5a2bc5fe814b086664f0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-alpha.1_1620737638836_0.11631356349827437","host":"s3://npm-registry-packages"}},"2.3.3-hotfix-a4f26b-kol8mh6w":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.3-hotfix-a4f26b-kol8mh6w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.3-hotfix-a4f26b-kol8mh6w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3eb93356fc0dbedbf244a8531358afa042a12b3f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.3-hotfix-a4f26b-kol8mh6w.tgz","fileCount":633,"integrity":"sha512-sTfN1UuMwgNUktsktbBmAzu7uptWVKCEZOzg1IeRowuhKYXj5Srp6ijdYlWrrhM8Hg5lTLsQn6I7a66+sTlIrw==","signatures":[{"sig":"MEYCIQCAIhmQNNlSXRqBIgiF/0x94fwNy13f/RUUp+aTbQAyKAIhANLIkrKBIejDVdVtt19qYHmk/i42IjznK5xUQCw9T+Xl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm5p0CRA9TVsSAnZWagAAPXwP/R3ElSnhrA1pBDJp2/8g\n7/LvVR9F+Dit/6R4lbB5yTx3xP/sX5X2Uz7LhMG/6XNFk5P8TXL978yxS9px\na8tJ6iDZVe/lM40ex++njteSvEFeghN/mbndY2PGVIn4+a77MJrT4MDdCXJZ\nqOsN6A1vJDSfnkhFBtUlHUMGNQ5Pxz0e7Uw8jkM9AcKShYssYL3MH3xrjpCI\nM5hwqowwNfQymnD7F2lUFD7hApqXYDst+oyB7HjB7vjIQsZc/mdbTUQtBIOo\nSc0eUoNh1s+vNbKLpZN/+xxJwXjtHuxndbjuKY8IJGijb4rgBKGaIZsEmptr\nQnKxbjrt5HclUAWco8LfWYv2B9gpAZTcEn4FuKUzgZmSs2ElPi3l0Yz3NycS\nNOuoMjlbaMTMPSK8dff1AjYwyNVy7i4Z/l2gN3dyYFWfURHRUSd4mLd4xgWA\nRuZ/5TDLHnRC8P/s70zJt8AminqE8KqbiWXVhwHoCf8XAhrqMTNppWDKrLgJ\ny8pOPWQyflKDTyYOgE+LDDXH1/5oz5XtW2pcJUI6Z5AjiHlzGfPGhSkmELrk\nsOAZjkSddyNNKp4zwRdwNtaBtXFI0Em09DtVoXlG5cYCkDDam5X8QvrP1RzN\nCYN2j1jZMW/pZRoHmPccMM3CjjBqy3R5SC2OlpGaqiCpZBl71JYvHdSAb3El\nAPWo\r\n=BMtW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a4f26b922808db11df953bfbde714788cbda87ad","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.3.1","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.11","@types/socket.io-client":"^1.4.33","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.3-hotfix-a4f26b-kol8mh6w_1620810355650_0.6882658594902513","host":"s3://npm-registry-packages"}},"2.3.4-hotfix-f19a41-kos9up27":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-hotfix-f19a41-kos9up27","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-hotfix-f19a41-kos9up27","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4fe5b00989b2127338cbd26417a84423ee0eaca1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-hotfix-f19a41-kos9up27.tgz","fileCount":633,"integrity":"sha512-jTnqZK09Cc+19YcWyeEW8yXsVPPspFnVjPl1jhwArKQLQzj+oExkp1Sy80FywQigIDmuJpmVGPESvSSGNuQ+Lw==","signatures":[{"sig":"MEYCIQDl9iDOsF2GC3Inx5KXrtG0OJcGiFKd1NkwFHR4mj++KQIhAOoO/ysBCIMJcZvis0Ek+1Yeb8RrXyVzGfFvZc/fUtFh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgohflCRA9TVsSAnZWagAAPmMP+wQDL7viW3jNPMvc7SWq\nd68FvUPqZMnN2PoEuS4F5LXYATrpgK+qS+LzvLKFft7vdVK9kv6xXGwSfcYn\nEJL/RoV/hfcGU5XPgwG+3buVSMUlvNTU/RsOLf8NaVb0jLvtLk8yT/b2EQib\nenfcyMRedURTFF5pu1BQPfchEf/VtvlJehQKAzcPEXspzs62CmbaFS2c0yOe\nzy//K+f3FEyH3sbd+cZiqMQTngB+QBbglqYnyeZsNu3MpkStS6UDQhOWG7cV\nowyt4JcRIQ/81EsX8oJcolEZdwOG3iE5XQltyLC/G8KTboVWzkokHXF78aRx\n1Lzm5ug22nZ1WakU8FDfp8seSwH11IktKzmYzPmVNn0RePggtdakYNGmV/W1\n6uSLLTOPd6AMQME1GfRN3MSgj0A9mp7CfxCysKnqXNso0CF3fcz8M9IBkB3D\n34keehngFNm+bF0P+nlZG7nRSAmBwMSzSexq15c+YY+Vtq+GUA8fHwbgLZPU\n13FxeFHKxvni4lQj7G3S1Z1u1bQliiO35K2TGSiq7NxorxGLm+oSm4ORivf3\nE3yy6tBDI/ZVvHrCUU5xt/+dOlWtzie6/aSBN1Rq+zR61GJAARzsXLqM+1J7\nqAP6AKEWf2t583CynyNzWCaH7GDU7ZDkZ82gTsO4ITHKIx9luJZ2jqOJMw0o\nJqSn\r\n=tAbo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f19a41b20696ca1b1095b0db240ba7d91eb55eff","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-hotfix-f19a41-kos9up27_1621235685175_0.8539958367875573","host":"s3://npm-registry-packages"}},"2.3.4-hotfix-2f135a-kou9phcl":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-hotfix-2f135a-kou9phcl","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-hotfix-2f135a-kou9phcl","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a11ac5204e6ec065533bc26a67e74911fcabc0bd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-hotfix-2f135a-kou9phcl.tgz","fileCount":633,"integrity":"sha512-4CFcZMJnWHSgIDUZNBlMsHdCHYoYT/MwYirHrqNqNWp1InuoYW4zvAnUIcy1PFJqbyA6TXRblBzRYgYM9v3ZhA==","signatures":[{"sig":"MEUCIEeSvprd5sCd1tKP1V3sc96rggd9bC6R6cUCzUjkp8abAiEAkS8P9nV9U2sSspu9TZRgkLtMk0sEbyXS3tOPJNNkOmk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo+9VCRA9TVsSAnZWagAAItYP+wY9DqwU7yhBzeA7nkUL\nmKOCEkWjr3Sf6vVD7ImBlzWxqMZL8NoHq+IyyPypyw4mUJMIM/Dvijy/qwCi\nwCVNgLyzg/k1S7PtyjQjKKFZR5Nk+GZAdlsulu3Rnfjwm9nQj22C0GMHivK6\nxI1Rlmd+7kKPJpd/WWh/YSLB9HuuUQIq6G3xDMa+ISIUZZ30zK7SLfcWjxBY\nELymY2gUfVS2MpATf3//Um4N9p2SGVRk7l/OdfAeWpu/pNV4+fxwZ21A0vhx\nvW2NkUrIG7StRjtBgju01p122q83T7vJWU1XlAgpo7zKkFZ+YjNCOg7NvN5W\nkFgtAyCESjk/D+Rsec8qGRVM/yEE+PzZ5QzcgQK9w66qUGDoea2sdzXnwVfx\neMQIqxJdtUBQv0hpsEuOJWrWmmWazltDmNHAM+pARch4uaDDbvDXrTNlBRWp\nm8KxTYLGcs0ys+oFPsbqqp7L6AaYMrbQF82r04cLbmth/eGTNvSo2oMMvlSX\nNuMYsowfOpZjlD6vfkCiheXzDJ6EZfjnfUyvWDKhD420uXRzrempaoKE8uo4\nzequCzUtt02Aj1OiQGrQ++Rxw84jItDhrQ0k8D1qLxJaBk/gbeuuERgKTNLS\nCU2T4jRF8r1AIcx0qKnLr4K9M0l61k6rzOLkaNZr3NHf7J98zNlLwtQZZx1S\nYuJL\r\n=9uUS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2f135a9f04f2d8660fc9da544ee1eba2c80f9ac3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-hotfix-2f135a-kou9phcl_1621356373426_0.8059802004953713","host":"s3://npm-registry-packages"}},"2.3.4-hotfixes-f3e89e-kov6w64i":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-hotfixes-f3e89e-kov6w64i","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-hotfixes-f3e89e-kov6w64i","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"69448370233f9782dd52166b640dc79502029f46","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-hotfixes-f3e89e-kov6w64i.tgz","fileCount":633,"integrity":"sha512-WNTzq18FgrPFX4Wgo1FLdVU3maKy7cH8uGhCR3sTcTmrfWOal+TEb3xBpAw3b/SybQd2Emrtl67hldLz8nHGqg==","signatures":[{"sig":"MEUCIEQ+0QIN3oXFryrKGITbcJ0qQiwjr0hhZ2dW7E6t9XsPAiEApNVNzOsIWsphohLPjTq13XUcEEbwINc44NhqIuznwnE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpMkSCRA9TVsSAnZWagAArq8QAKEiZIytg4Kn9hGGCoGM\nU0JfrYysR7FvIKppCV1Nlco3MvAXFBiGrI4djG4ofhVLtH+JT0DO6+CqAeQ2\n33zajpiOZPHqFSY4oaay12fYgbJLac+xioxPu/AFTqOG1m+vPwUULTOBVRAR\nioG3/9WEYS4VnsZCQlCQWWaj7spChNbBMB9S1EcylTF1VkmwDNKCRC5/caHf\njSwpxWsBuzzJC/usEciSqEcJzwZb4A41a9wit5iO9gq2t4MyMRpy284euwFD\nyMx8EfM4bwUivwPyvdNAXZIjx2Oe3AuiIAIggHdsALS7PzKSOq1MIo+yurnE\nhqO1Ft+W7U6PZajMCAZvH4t5QEUSu2krWVkAG5RHXGWldqNhe9QTXmFZDobD\ns1EpKI095Dinu0KWGxjHT6gcy91yeceeSV/HE9Kw2X7xUwlHLpL0kI3DMt55\n8rS708xJBAWME9BMBZ4CVQKYb3NLgLJ8nXD3RfwYZEkuUAbWdF/5//qWhKxH\nrEIjPb02mqh4c8J1ZN89yVIvLnBTkOWIgzPoKSeO8Pe9gfdV0s1MYnogN1tk\nHWqrCDrkWQ74Iupk+RJ+RtQEvRylVlq0U3rBXsYRdJBThHmDHUve+qUkV2i5\nfEmTDIgUWJzQdkuAozYM7UrFMr3dSGTKwfoDmvcztu2gFBVCwOgbhEQI8BeN\ndSrf\r\n=M1wS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f3e89e4a2c6b532f74f5d5ee76861b9c2c673364","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-hotfixes-f3e89e-kov6w64i_1621412113698_0.0948626535729673","host":"s3://npm-registry-packages"}},"2.3.4-hotfixes-242576-kov8bxm0":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-hotfixes-242576-kov8bxm0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-hotfixes-242576-kov8bxm0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a3a7bd99e7eb4c2b426b19d34edf5556471ea144","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-hotfixes-242576-kov8bxm0.tgz","fileCount":633,"integrity":"sha512-tiBJifXKlff1yhtYDuW6Z3zYk8FYqr+MSm6KsEood1jJ03+QhuMhT1ky7e+X5FB/t+ZX54HsfKymm6SL3sqfwg==","signatures":[{"sig":"MEQCIAO9IrtZKe6vEUhN+0DH3jQvZvLkhdFE5GgWrmMJ8DMoAiASEUf0qzR7BaRi3CHZREJkXR49NiHq8Cz7G67cnZqN6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpNJ9CRA9TVsSAnZWagAAZ/QP/3mgXZffW0koftBHwYoA\nRgLjHBka2yTYo2MBajjWhz74VJ7yMW3EPhcnDhf8S0ecJtxEGc5SucW2Dk0L\nbhRCN/JWvelFTuAhXOqb5Vq/4/5Wvgb1A5pf+mdVGPCYsEtUasOwEh5Cp9aH\nMtG72i6sii1j012gGvU7szHhdz3K9L/PgVsyZOLyZBpxGF9kEwUljFmStMWf\nGEe5r0IEY028aB8F/c05dxmp7vcjsBWr74Tr2E+rMJ5SQsDjjPgF3h8Opne2\n0vdd76laE6XFHttsGn7wiKkQ4OBNyIjm2TvZZ4hUNKLnlLkz5UiUW7l+MsPF\ni6VVD/2qgeAJyUndNOGPe5+sVMPYXmV4AtCxfm8eFDgkE+7G9Fyzy8iUJtEG\n8ENAnQCnjnxcZgF8eX5DNBI3L7c9MwRC0pvJjyyUhVFWxyJY+kwlo2pUmlCc\nYrXzpaayjOw9Dbht4N7zMSwiDS6FNrln90/ce5tW3n/cr7maLgn9p7Wi8DIx\nZzecdet8MWM+DgM5+J2IuyWfo5+5pH9e3F6YZHXFK95yQLnFJ91mNaqTr8r0\nT+q1SOS3UsOyazUIG2v8NnyWHAL1YtxbvN0b7u+JYADhmSem6WApgV3jJcq8\ngYqQxlZa2SEE+IqeJ+fLneb9TXg37FB8YVJySI8xwT1URL4jF3vq3fKLLWel\nH13u\r\n=1/bF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"24257669f307cac4b9030fd4f28af9a0c85f18bc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-hotfixes-242576-kov8bxm0_1621414524554_0.6449313074607563","host":"s3://npm-registry-packages"}},"2.3.4-feature-d4db8e-kovaf9pc":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-feature-d4db8e-kovaf9pc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-feature-d4db8e-kovaf9pc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9be383e3433154e29b37e787892746e34f24952b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-feature-d4db8e-kovaf9pc.tgz","fileCount":148,"integrity":"sha512-eu9oTNQBVZPKrDueNsqc1DOYpK+G32TYqJBH+dWtogrJlgUfeOtTCUNmFbkf0Ug3pmTeOppJqzGujpqyPMO2qw==","signatures":[{"sig":"MEUCIBJjqN5l4Ouph8pvHMPhunmcwUXD9oft2KgESZBG17O1AiEAzruwb7WH6LNrClRAYtheNGAMP6Yq7RP6DW1B+Qzs4lY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":418256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpOA0CRA9TVsSAnZWagAAYtMQAJCyOL30fSKB7jxpKWUb\nv2oJIp6i17XAtoptBqBge/mLHMRnD5sbFD0Fm/THreCdFpH0cphL7m2ir2Q8\n25skpWZck7gfeCXVt63mO7LXILSsDtsabj38/rBSqAEnHkQiRiLOupJcCrdw\n3fjoWmjSbQ8hcpuRmwyKL2azl5zr2JFb4tmy0CqRJmbJluVRNwgEbHBqIvgy\n9ARkulik2AX4zvxd56aYddHXnT1u7s/L9QujBVuFCyP3zh/R68cMScs+uS4a\nugBHudeWuhbezig34RKwPXESQnqoSYG89Uf591fLaaPXpg9XvbOHvCgPeK3G\nwVHO90yxvYehg91HmPRak3CMACP1JQLvBx4WqamRF0M2EfehWesjBb5mlkkg\nEYX1LPpZ9fr4qPOcBCoomUZqY986Ciwh6p1kobbZZDhdoyvUL3Us0Iscmz+i\nKLTbgReVxxKZkyYyKx02Cce25cP/d8mC/7mkFjlKMfHAjKefXgtbB8ga/0te\ncoOtbiVdsiVdM+WCQcsf5kbrXCo2l2+zPLEIRyUf0v60+Wc+YJWZDuASsZes\n6x73p4W+k3e+WdnSalSQGPDEBCAQuOYoNW2QEOWN9med3T0b38QpIhmUYzb/\nCoNmrD4AyCHG8PcdxGFCZQgEImpLzMhf64Skar5cX7B9I2bvGK4jQ9wXmsUu\nwwWh\r\n=Jxvx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d4db8e28c25179c0e683b5da00fc28f95b8607f3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-feature-d4db8e-kovaf9pc_1621418036207_0.08746511320782635","host":"s3://npm-registry-packages"}},"2.3.4-feature-8d1e77-kovarbzq":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.4-feature-8d1e77-kovarbzq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.4-feature-8d1e77-kovarbzq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"66150ffff6e629b4746b2a14912ddbdaca809090","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.4-feature-8d1e77-kovarbzq.tgz","fileCount":148,"integrity":"sha512-+VLi1LLIG7nRFVXrKda8AnxFiEcZfIUM4+Lwl8f4lEiHtVRK8pH3NnV44Y/CnpJudXuP0ZF0QXbAK13g25Vf0w==","signatures":[{"sig":"MEYCIQDCrzmPyOh5zfQ82AbTAjNkUeGJLt2ERlU+BnO9epcQ6QIhAN3B0+r5JJ85ZWWmHKwsnsYvoz5HkB//64CH3qnhFDco","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":422941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpOJrCRA9TVsSAnZWagAAoacP/RR16nQC72J7mDvtqW5Z\nFco2LseHSlDyrsK3sLxX9jHkZW3daLuD7sUrmM45sjg3SSAqjHhlGrETlZek\nNY4usRtC2IqWafaBiKP0xRBiQrQVRy8b5ycrxA8mofwjjdIe3OlrYGBvd65O\nAnh64HqTish/Q+5zMNyYD3N5LvXz6sC3uqADD2zUcxA3xsblPP6rwdJUbYrK\n06eGE6PI/qW5Ng3pMT7uXpdLyYqWKP9jlVYgOcIPsz1GoEFNrWy0aRdkgMeI\n6WlyJdwTPllWGvZxI9GI17SxmfIFtYcXz85J6eRjNVj508pPONwjGXQUHwgN\nNa2t9tUM3LkMblY24Bo8BfQ44eg2bP9IC+SgIGEDcs2NdbFcI03B4YG2bKDP\nsrZdoc5NFB1nimd0wAr9dkuAUF50ARJL8hYNblmiC2Pzmca69HKX4HknVuIJ\n4eptyxsT13mbINu+FEKJvWEC0pqDY3PHyNMoWqTcojC8lnriTNEyKN45eB1u\nntdRjdtyg20mkj9O49ct3m2c/uPg/gm1Sn7bOaO+KZYCmdsSo8rH930UPcYb\nuHBta6Rsthe47fNy3vrdYfZT64SVK9afMyYTS+cai4WVhmDNjiC8MuAus6aO\nv9PGGsMmkEW9dPsT3NfK/rTDK0n6P4qtlAQk/H4JAcfV9OGK0NQ1gpYsyX3R\nuLli\r\n=fEiV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8d1e7793100e875673ce54905bc42314245cb93d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.4-feature-8d1e77-kovarbzq_1621418603181_0.9531080750483047","host":"s3://npm-registry-packages"}},"2.3.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ebd26363fa0fcb613e6beff2fd48658f323d5150","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5.tgz","fileCount":633,"integrity":"sha512-gdgLsGqLmUf4mkxwN752JW8ZSKIOCZGkk2xNF/YLgqPTiSwSURqsXGFFEs4w3aMotUQV3ZorUBsYCB2Bfm3jiw==","signatures":[{"sig":"MEUCIQDlrPlAd0Cn4I+UL5wWeTzDTK0qbl4vKSTVaCBJJHzy8QIgEFQm4Ewec0p8teFR2t+2jmoC9UZsAabI+TuR1K0gqSM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRVoCRA9TVsSAnZWagAAbfYQAJFGBCZgOU76mvYA686E\nSL6J5P6cz0H4H9Y6wEEDuQ3sX6mn2JTJs6aGtRewn1AZDacgBoSW9Q0LN+a/\nd/IUjAk0oAoNkfYNqFqzVzSO3Ns/BeLTuuygvoLvgJFfNstDURTFS97y5KD1\n4WVWCP9HLl2VzsYS+VQuHjkl0SqqJxRiXG15KsNyP8oQLzzBLYhqHiZ7t5Lz\nIOb86YU+C7n8rutoJ+/AQMfHXKP/QHLouCrPYbnnsV3sXeHi41E8QEQE980J\nTZwwuXcDAlInQMJZiPCn85ZliE3vcmQaNb3ruIYj83kUzuO6ZNPfCvL0p06v\nf/PKuENCIIoynA8RUGRELA1e/NKP04xnKEMgxFZ4+AoM4x4iABkTiYUhTAvE\niOJr4aj9n78ObGhbVLfxzB/aydBgqPGY9s56H4Q5uZs5PTCGSFHL92kXEZHV\nMKXXLA1+pLDpNIIc0GH9Z3HM3Aj6jfYCQjVfVnF65cQZrThOWPZC8Y1zq+dQ\n+RqELCaF1JAfh6SRDVSEYro15JN25qjgXSpa588Cklee6a4HEh7tT6UdI4zX\nEZ7tlgXzMkH+gqHeGanyE8lyBzLBgMmri4DX6BgiKlNHIDfn8CvE8LUQbQC0\nujF2opRXBqDzunn6mtnWRKq8knQ7St23axwfDFC8ASpP7qMLE8HMbvYHkj48\nTXZq\r\n=Gw3W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"a74e2138de4723f55f67c3e1737da7bbf1682b6f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5_1621431656426_0.7548523808253582","host":"s3://npm-registry-packages"}},"2.3.5-hotfixes-7c5653-kovijao5":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-hotfixes-7c5653-kovijao5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-hotfixes-7c5653-kovijao5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"12fb58de938bff208dabd6b51674bb33300c62aa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-hotfixes-7c5653-kovijao5.tgz","fileCount":633,"integrity":"sha512-b9W1gRu31juqe+cGP49zkpkh/Indpa2Q0fjtPKPIkRsHI9eb9Yh7DoA+NqzZlQeOxRmyhlEtnVY3+bUY/pl6bQ==","signatures":[{"sig":"MEYCIQDNw8QrcWEEZmhHJ6tnyH2WlTvYrgj2A4XzFWn9RPjkXAIhANkaOPbyfqmCDrOG9di66NEHXgOL/lgoXn/VWFambpvo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRV0CRA9TVsSAnZWagAAZ6gQAKOwRyOycWFAZSZj4HzM\nTujKwR98Cd8WD/AjHPl6RhiUpmswQJUnGwgGeZ/oTqrDbPQqythaTyUMeqNV\nd4CukfYKFsMaIwPnHCCygOq1uMdwhFfdxrSHHXeboaJhaD7SKBQsaHbuJXPb\nn66jwTeNGRAFAQFc+K6pHvaUoqeEVkD+6Ktq2DpWLiZ/MN00SHRhSWAwpy6o\nIwoXdoWpZXgIIHzMPgeHvRqMb78MNOkczbvEySodSyVa9wN8yWFo+8iTZ0ZD\n0hugNU9e4CbfaQi3oFmQVaIXHe8+x5jR1MmKwjWVmJVHrMTQ3Ecj4D71ln8Y\nm+/RTTqoTUrQBks1FJyF6dwsKxsJUFcNXASyiPBdrByGNbjNMhSEdjHWCkhi\n4ycOli7eZ7gIiO/ygw/92sSIcH2P3tbASZVWGOCvmjwFm5qTojcdkwe+OAvJ\ncuAkJPYDOz7xRVYJLczcAWISWEMuktas5FBD2hy4jDYPH17d3uiNQS1Y70uY\nLsGurs9ME386w7OP9x78NYoSxQ0+P6vtI91jb2iT0hyaODKS0qMSaFloNxbg\n7WgEJ9c3wwyb8GLmTzwiBwsUZUQNL6d547qmFf3ztKMUDxyj79IQxOZU9k57\nkUjVo9eo0YW4BkhAitHYyuW3xTHPCKZDFEF/uAB87BZzEYxtbYY8WBjaM0KR\nxHnM\r\n=1e6u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7c5653b7ae987ac78d110c39464243ec6ad979c0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-hotfixes-7c5653-kovijao5_1621431668199_0.5759324792329588","host":"s3://npm-registry-packages"}},"2.3.5-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"53a51b82e7f46407cd88f711987a01b38cc3e0fc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-beta.1.tgz","fileCount":633,"integrity":"sha512-dBM+lp5MCwsaz7SXNU/CQU41FlhieUeqkbKMf1Nyu+D6EJ6kQs14inmc8CGXjcH5MX3K+jKSjqILe+jiJBtZ4A==","signatures":[{"sig":"MEQCIBOsyPZSrlq1oaI1UTzlX6MKwzI0D+3cs6PehhYAaXBnAiBWmcbIpXtCDmLRxl6hCufjBZ3HRuudjFRKhuknqo1xLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRWMCRA9TVsSAnZWagAAFjkP/2KIVnaCC3rk/UdFzyb6\nlyRps/Z5bTmtCZEwYCqjsUTTSMa98n4hZj4poEyfXyYpONXbMk0dTyHiLiZ1\nq8xfPhi2/4ViWDq9+9Zavbdku56KnSX/34AtFY7cwYdqxE4eBCLAf1A0yl7U\nmAzpOA5UTxCNmRKX48Oo0M8K/JZvAnThsKtfgYOS+Kj7/5H7gdJ4VeL5N+aV\nUNn0D2b3COI7RAukXVknL2ZmhYMT692iM+7SWB1iN0DL2ltm3h2rMbvApjaQ\nG5yMD7zIxezgTT9OBb+1vakBT0Qpf17k9Iurr2H8pg1QK/rozoG8z2kpGbF0\nH+dWQqPx7keZbvwTFXS4g76Q6VzmXn0Z1GiAckjayZLr8PhE4QHTN20LoEGE\n6nt354ryjutWDMeH6EeAVsIJmBP/M8vm62nethuYKtm6fFvyCoAWnkQn1UWz\nVG6IoGhWW5aKAfhpEgzqaaybx1i64DFYnxYsKzsF/iYvj2qu7OrvI8Gxf2qA\nQpBk99XVkynsrv9hkdOrW5dr+amZaFxLRvB792VaKxambn/i3oNwTe6Ut/ad\nHNzCDvvckXcgARb5zOo1/IJmyryjXSv/u1d8uDGcXedlqRJW38VgfrWNn9rS\nQFrqOvOXx/tSjPwiJht9uRNgcwQe9UJ1niWlTn09XgZpDi2g7ubtVmlRINiy\nqk6k\r\n=xOXy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"02afb799ccb731cb4318a4cc6dfbf9cca73a5563","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-beta.1_1621431692115_0.3350249113757513","host":"s3://npm-registry-packages"}},"2.3.5-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e7f00ee36448a32ca7d092be959d6bd0da419f4e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-alpha.1.tgz","fileCount":633,"integrity":"sha512-R7y8Omtpu3Gv9wbqS88xzfAB1IAE8Munqwo9waW9tQFTbcVS1xaDefvPdJpaYFESNysopvf0C62PyhART2e+Aw==","signatures":[{"sig":"MEYCIQDXXrYmAzEZLiFAjDMQipQ/g25zWRLMp/NCZALnPh0muQIhAIlswVRUdGrzw+GYxBuf6mrYw/L4edWVeCDaYUGWlmhf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRWmCRA9TVsSAnZWagAAcS4P+gPJxGbf2OLmhrbq0Btp\nU0ABehmQA8eQ65MoBJtiP9l0WiOpKSQthDL2+miT7ut2LZjbeeWZR4Ch6la1\n8YADA0VatbbDc4rQI7AIoRMkhxo6tvBxT1QnnTgGm9zndQ2x5I9RWZSlblR/\nm3p+i//Fbdj9b//mvur0dMCcC5IDztNWQZCRvib/3CdsjsfzsONybtOYYy71\nGch89Xs+XUI1pJ68aWlrx+GVsqmKbBCW526TO/t1e265SV4Om4Ou3D4z6W2J\neqhKtcJM8JLtlOqrHSCSfcm0NSniwaIR6PUumj8XQ0l7v8EuTe6ec/bf4J/8\nSWu4MFBQP9TViZSNtb++QMXcP/6vdrqDkyng37nXO8byxFWQsAUluruV/mTJ\ntUBZ48yQGFbafh5nJt/y03rPTeDYlLjIwbHsM2DyzCwt96T82hUSCe8lrlqi\nMvZryF/GOudUy1xzYrRdowjLJL+UcOJXbRNwMsUtsdQy2hevMtjkAPt8riux\nBvO4H3HRqEL4lzLiaKt3r7DfRrejcMgJqAROv0K+5zGd6FfX+PqMW5eJ+aSD\npV6kglaH4USSX2mMLBB6Ovvzaf7T8CsaTsw0dbLPwyD6Nz1DDD2mf2LOG/IH\nC4N5vpSURqTK2s7iUV19nlUw2sras4eg/oC8y73wne9ZLtAoLnEVR5BaYmn5\n+ihU\r\n=QR2T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"35be502251932e1c9e93d8143f515ae8133e45f4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.4","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-alpha.1_1621431718012_0.27357106752587557","host":"s3://npm-registry-packages"}},"2.3.5-feature-0d9b92-koviojv9":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-0d9b92-koviojv9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-0d9b92-koviojv9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f199012f55e5db78a991593d3892d39a8d88df82","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-0d9b92-koviojv9.tgz","fileCount":148,"integrity":"sha512-Yk42vKlh3rpPZUoTQSL7z0ysm/ATvpDhDXY1qFQ5Jv/NTNYe/fdb9IH2zrmSHay466dc5I79KiF0RBA441yVOg==","signatures":[{"sig":"MEYCIQChca4zb7koTRmO1CMlGaHS8ZZfznNXXPFvS9go6LCcLgIhAPd7A9ufurmBNOClLKEo2n4c3NOkbXEFBp+AoOTAEEBO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":422941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRZmCRA9TVsSAnZWagAA6wUP/2eA5GVAKBzBY+dRjXpy\nf0vkmcYgv+WZUr3K8I+IUxP+T5JLd/j+2IJ1FzpPP30XviBXdHkjfSLQFFsY\n2Z9O/Gg9E4H2dHgnJMv3c+4R3oSYy+FuM2IaaNZ2F5CWqybY35eIUATUAgTp\nsKQwXRjqCRN+9w26yAIb/CsWuxzBjBvqIPjHJ5wBszJ93FILIEqnkhqrVv+c\n2rUcajYV653ucCVZndabtLmC1y+4ZH4f6Q5z+Ky/lQvZknd/OMMgto0UEdMw\nwU5+43BXEJzhJmu4MD/sNK4YDN/h34q7ucq8pDY21KkoyhwQZVLICIC4PcnV\n7DmQjUZqeR73+9vpi9/vobG7du0O8/8H+1EdIuLtF2PuUcM8EnYwJhlL6Ek2\nF3COpYOupnEN7REqyEEhdlE5N+gNlPvDhWAF2DhJ3SxIu9solcKFL3iC5b77\nMygKzzn4JZOmlKRXV7PLz6+9/5ofOwX6uIVjp7QwI/RMNKZRG7JED+sNNCmU\nRdTlUPBzgp+ur1yrBtOc9h2KxrlX1A4NtIivENGokeqM/U7dRvAIz7DWzNcw\nbA/986juF7rEtVULDXkCusARJYXOC1ReQNjpNtdLGr3y69RLkMzwD51ieir2\nM4CPqUqEtCIMFYIQB9drmWT+0qMWv2s5UIxGljjUqQQVlbE69FVuDy6CQTbL\nz2Ck\r\n=TBc9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0d9b92c0ee9452271f21efa611d9e8bb2e7ef18e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-0d9b92-koviojv9_1621431909939_0.4204681191994606","host":"s3://npm-registry-packages"}},"2.3.5-feature-77d6de-kovmjm20":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-77d6de-kovmjm20","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-77d6de-kovmjm20","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d0132752b22858423019030e10fed5794e9accea","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-77d6de-kovmjm20.tgz","fileCount":148,"integrity":"sha512-OHHEsb5kLn3WpMeCZY1mx7B5jKnKOZX6DlHklSlTQYR5hy4S7k3HjB4HwBehR7jKPDtXDAzve7GmZSOKnf2oTg==","signatures":[{"sig":"MEQCIHAhycSNEz76gOJOHpg1vvFD+EgSfIVAdW9eayMb11MsAiAB5cbWXCJReqTyM+1ho9wx6j5vVyONknnBJp6CmdckQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":422655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpS++CRA9TVsSAnZWagAAdzAQAKS1dnNQ5yKlDHyzbzmt\noJRgYcmdFB5hmVeCDSVffN6cF0mAqGaEpFJ6nhNZnOm0ICL3LMzUfZCmx2WW\n24rhnZND/Zf8pfDZ3fS/tLPoIreCGLYaZiAX+JVXNP6nWEHWpZbA+yxMzRy1\nanzhPCdLk6JVTo/WQtQvS4lEdKXdV5VVZby7T2UKom+296K6U341yVPK6Oqa\n6NdCJ/eWnSdml2ZcBcBitqTx/Mf9iHDS9v72Ox0Jb0C84kx4kO/quIjRvfaZ\nhusaD1X2zbPqse1uZX20gl3pfQTqyWGUw4KhGV91zmISlvVnpDSDnJ5ym2B8\nkykXmYrBoJM63HwKEHFeO/2wQtQgejQHH7FvbXYX9Hlpottw04SCfU5icB+0\njBK4smt3pAnBzlN+5kJUlSJLozTrp+j0UAq1nvQdBg+T0Af2A3gIlUI8Mlji\nJ0yFUySI3GD+Pzl0D0/c8/l+w6PfxCDd4kzEXZyr29GZXPc3vh11xllzvMy4\n+UdffEiiSGNLCG6G41uZRnFN66fFFJ26/yriE1TqRNHWZ1n54bn26vyo4CYA\nXPOwPZw2GAMCP6Exa7hZediVomzFOdLUzso4hYgJhq4XnDIF1wRPjusRGHPp\njK73cjjhYzjde2hzoR0h9DDsmlz95hhpVZGvajUvNW3IM/nbHTaXu1zJz2Dr\npOEi\r\n=ZkIg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"77d6de289022f5ff5e0876e6a648bdaca7d08570","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-77d6de-kovmjm20_1621438397879_0.6285362873080593","host":"s3://npm-registry-packages"}},"2.3.5-feature-ffefab-kovr1gij":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-ffefab-kovr1gij","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-ffefab-kovr1gij","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c60442b9d7dff4ffaeba88fa27397fa0b5b01b90","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-ffefab-kovr1gij.tgz","fileCount":148,"integrity":"sha512-KqT5cYkArTt6uggHR/r/+8i92N+WNO13sPb6GeM3vYQR8o0obHo5njT0FLkwKoCMTrKLpEMo42T+oWCXUlRPOQ==","signatures":[{"sig":"MEQCIEXsuM3qeSVYreuL9iyb0PMAvjVgv8Tb7C0aVWbAe4YbAiBQd0O12u+QZNyVgYk2ftWdhKHCv98d5KeZAlA/b0CfBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":422070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpU05CRA9TVsSAnZWagAAtBMP/0gpaZiVYbNHjzmj/5QA\ngACHSzPW/I1egT08k5jgXxpSyWGw29HHcsvJj5c3LWLZ3gfZYkJPcczxtu1r\nnZgC2ab3sUycJwhVHw4JROFq2Gfc1D/evxHyphxMYnCAcA5FgpVEvMTXZ/2C\nulpSp39ij5OSl7Jhgq4iBC/wiEKJVjObDBPrUicWjgpmohYxw1IPjqFsB5ZM\nEt91FOv81RCfswt8X6uFaGGMWYfXk34pV3Z0oUeCr1NevnxZ4H3J7OtNm1Sj\nNv9fY/G38SIORvl6hsSiTzWLp15N7zFVHURMkpbFRS03d3QqTJb7FlLQhcHe\nQkfEFXRKH+3a9DW5vm9m/RyoQashDf34mFq+T4xRluKFZpxAO7zv2S9a5BtO\nd0frm4pxsyGdQqZ9uGIS6dAERGvdn9v0JkJZuOKwi5My8OFlCW5mtNcXKR7E\ncAr05syNkuv+NG9fSEERlYibODt95go4mLkK4/gVBL2ZRFKg3IKVnHx54j5n\nEEGWaZly65z8sMwAIXTRfg77ZclHiLOb+idzVrN8xtv4Py5IrcBv5C+1dL2t\nk0T0cq2u+9hHGP1C1JpQ6VmHRG1r+E+wc0CTbDGc8wpmQaKsJKdpS3T/qBxw\nzVuhcc4QBx4Y4b3MorbaC6nXiXKxAyWDIq2FceajQlTbM7oDYYyndGaOCUuj\ntwcN\r\n=efKZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ffefabc225b9558ff1ccb05852fe68637e6dcf81","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-ffefab-kovr1gij_1621445945266_0.19754038859097256","host":"s3://npm-registry-packages"}},"2.3.6-feature-ffc7d9-kp4450qk":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-feature-ffc7d9-kp4450qk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-feature-ffc7d9-kp4450qk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c055bd7df7acb1ce4dda7f2ea0dc5ea4e6a3e9e8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-feature-ffc7d9-kp4450qk.tgz","fileCount":633,"integrity":"sha512-DbLkn8XcDhhnOUGcssJDZo+z0BCdS9KP12fAYb/q+ayfmBhxl3UJTu9oH6WvEvsIFXScA5V22StGr+fq3n3aPw==","signatures":[{"sig":"MEYCIQDvPz94ivRjp9tEStqPsOkTWrujNUfnqbERfCKiOzLEBQIhAKzEp0iKICMb+whpUtVrONGAARo9JTyFlPxeVdQUJUCc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQTECRA9TVsSAnZWagAANo0QAIiI48+k3/IfzLGK+ain\nxS3k923AEM+mFXsFZHQ99QE/RIaMZO7/XUww7cXu0XGe8DR20lmROIXAQH7E\niGbx6bgQryy8RyKgeahWVXfj1QvrmieKzS+IkPF3e2nxFoxptHifOopDv9p8\nosFvdlDbOnTeqCTzgJbR1cRch9GeZum9JzjdeOytZJASIHEa1R+bWGUKpaN1\nwKMee5mLqTDG+nzruyCEnrSwc4GD1T21WU865jQS63SAtyxp2u1IwKwehwd6\nCs0uw83YLM2cqLDRNXQMWpDc0pNWXGdVSxb0Z5xCkcso3n9J9ka/GHFjg7n/\nsxj9B37GhgbQAyfxBC6+3SUbxMUaT1BkQ+BnkiRU0cCg/rlb+aGSMB6ZJzrG\nqxNFrcFrmpz6kijTAeYW13qUV5lR2kT7IN6WkEik7REtktGQYaxNv4acqa5u\nuqDEY+tvlv4D572uaiCNaRkNywfzFdGUk0BrpHb/OuPQ5IsZpnissOOxh4tQ\nZBLKai98qMh9bDukWQ5qMQrMPfMLRCymWTNDy5kjYEUcZhyKwBuBJvO0fjXV\nZMoXsLyp34e6ubl3gWpPiIVCxwCvDdqFz+b9OMq+gDHm9V9snGmP8datLheO\nwDzKbvBB8piDZblyNzM+UnWXIKgHQoSk2LTCpbseNg/wWipLADuDcUqdyLFs\npo3z\r\n=UrAj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ffc7d9fae4f08b29ab850496bf602e04b61c7508","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"feature~add_process_model_cache","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"feature~add_process_model_cache"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-feature-ffc7d9-kp4450qk_1621951684225_0.5580772535775496","host":"s3://npm-registry-packages"}},"2.3.5-feature-3c0088-kp574ql0":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-3c0088-kp574ql0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-3c0088-kp574ql0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0787248544c786a1d875221ab216ead27fce8caa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-3c0088-kp574ql0.tgz","fileCount":148,"integrity":"sha512-M/CFRqG8Meh5ystTfE9Pm+m11rzCrHe4Vivdu2ayFY0UJ3Gx1FOlZpcSEJboOR7zhEtuULECxMVBDWAtnzyUuw==","signatures":[{"sig":"MEQCIHMj7UwpJZ9WZAW/2YQujg2MrV1Wv23bdy9knIg0PWUjAiACVeD1EE3OAkO4Y29VpCPJfdvZhzf4pWD7By+eTIjA4A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":422819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrgSUCRA9TVsSAnZWagAAxd4QAKATvCzbFCeqLAlpFOnY\n/dW3nrGJcbDxCACOvM1O9dYrHxH3+UCYvw7uZ+X7FtRqvcVSlHXXLqcnUutB\n8sM4GD2sLFkKLA6vn5YDwUSblEr7vav6Ano7FROtYscn4aNWFybWkESOgK4F\n+grrbWLkrAEaZaap8552FpMijiricXvWVpwwCMo2+KZPnrbGuFch7ulKDjNJ\nAnzoOovm/rFjARhcc3reEHid5Qw+2BLiGEubPnilvWyRQL82s7ItsESkGHhx\n+JFaekmJ1WJ3+W/Y6qvBLmxbdOSrJ7mjwXcVc0HDgRY7J7RbBu7QhmGCbpVM\n7wi6e64fJd4pX4HGJzuka5j0LXBnKinvb4tHE/AGsdq7eHlVX8IA7X4dj9u1\nPw+BiBkpbKMiikvLODYPJg3yZk3AnElJiKIlRPNO+nfn9uupdk4kft/ylpyt\nZCnYG9e1Ipaxk8DRtmf95Fyi5GMocPqc0X+kJmXgfRUiQLz5QnlsRGUVUrde\npinANMiTjNKzjUqYmuxvYcNXK3631IDbwoGdQaP8KCK3aJLFg0iByGB5rsuT\nTSHf4tYXoHUEADWb+uhp5N2M8Wcak+9rUUIkIwlF7TPOd7mMjyqJWyCuLlq/\n5lJuWIXIIuuAN6Mqa/OAqAkUcZ6xPfzqvgeBt005JG11aoa3wBrgXplMOa78\nauPg\r\n=MiAp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3c0088eff62d9cbf253fdfc551ec2271838a1f13","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-3c0088-kp574ql0_1622017171997_0.9929038916993356","host":"s3://npm-registry-packages"}},"2.3.5-feature-adf0ce-kp584bni":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-adf0ce-kp584bni","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-adf0ce-kp584bni","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"04e209f1253d2298583ea330ce0d5851844f9853","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-adf0ce-kp584bni.tgz","fileCount":148,"integrity":"sha512-A+75fyEyGjcwwo3SVrRzI4/bdf26sBE3Tqk2HV5jJRbWQJJhfgeI89tWb2B54uWLYHwUmZXc3AIlm/JdvrqOsA==","signatures":[{"sig":"MEQCIBNrnRsaQpBbzoE6Tkp4LJ8o+2ypXG89JXh2P3OzUuyhAiBuy0435mlYonZacILEqyEzaLAZaXxoB3B5aAVAYMQPhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":422819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrgsLCRA9TVsSAnZWagAAdTgP/RLZrUDRs51KZFjurTpG\n8FIIt59g/6mCfCWTcPfXGxL6WJQu/DySB0NNufFPRAyifpdXD4gD6ykgVCEa\nkdzA+NJLEM1sWrOi7ct5VwPfkguSVf73tmqfhzVZoUU3Ntl/xbEGbKm6iNHr\nzmAJcW5RMPMx9uSP11Q6UZVht6TH8peOi+D9xhFEw8dRfEQsPvj93cU9HIhQ\nYefv/sDGK0jTjmtahdJzrPZFIQ/iQVPLc92lkROL188VvYxvOi9ChV/ewNyX\n1beDPyi8/4NJ+T7fqS/s8uuXXnsgmWbN8b78Qb6nK2zAwCxTEqgi9Xh6H6U9\nQ0aBpA3nCVp2wKP1GnOd8S/aa9hXGPqsePtO4qLegkmDUVjSnQqaKAJScJfq\nIe2Y+ctU/mbTwTWAaJ0xTchcBesk6CIVyXfsWV2rqodsnFl1hqiykpyibRU5\nCqnmyxoxDnYi9cc7fdU26ABn3uswhjHJkHKMjqmLX4lbgb/N8WCNF+fAiq8V\nVxACEX1sbZXl5cBAT1wrVeRO9KeZbSCtOPmkzsDNYrHWQZVPiWmUfqXZLEkK\nfCbJMoujRW2mehdPhBmSo4ElzPbIZTJk+RRNLaOOz9iVdY/FCyoMzZSecVe3\nO7tE//Upg5XJGCU9OrnC9FhRGEFxZBVth1yoFJx1eMoS+gAPNcBZNP7dumd9\n9Bpf\r\n=aKLE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"adf0ce0eff2417507afcbf32b7a8a9d7485505d0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-adf0ce-kp584bni_1622018826614_0.7130038567916888","host":"s3://npm-registry-packages"}},"2.3.5-feature-36862c-kp5b1bfh":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-36862c-kp5b1bfh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-36862c-kp5b1bfh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bd6f8b328cf58a75f850036066b8e5e8a47365a3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-36862c-kp5b1bfh.tgz","fileCount":148,"integrity":"sha512-GQWDzaVP2OI7i4rR0PkjwHhsQ3YHEhcbOQ3LEvamp4mZM6ip8l4fejfcs9zWC9WIl1XLd7mR/nCnaLswWY5HeA==","signatures":[{"sig":"MEUCIQDUm3hOnMSTG6bpp7afcyYdKkBpNbD/ZsTeZdiW5FrXhgIgRVFRBSnv5N8nigz77JRGau4Q6utLbjhD4AOw3rqOFj0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrh4wCRA9TVsSAnZWagAAImYP/ihFXIY4BbT7hJ/f9XLw\nQgbVgcOrBzvXfkCtS3Mm31xQJ3lmBWE+H6XlV0hJEGNbWRyG/z7fJVjSlM6p\nD8GDZCQgSAMA5yqsH9JuJqGNq0gGGl0AhPO6NLfWv67hjsmCoF3o/JE8zLrr\nGpFLi5fnAwb6UKX36ppahIfy9mtd5PRi/+CM9o4gWPNfr/elCYGkBIpHlA2F\niBVbxt96Gk5HGWm7Z8aS3pOSuapcn2c8h/Pfr3Mv0jIFObMje0FTBc2uPNEv\nQvpempNkVXTzrByFBbuAyz1RBx1QtapYgdnm7iayG85TUr6U7YM78B0754nD\n4IWA/McETKdYMuhtbNPOrCVR0Lzpbny6xtC7luqj0u/eBhV7d80koh+rYean\nVu087Y/1Z/Hy9i4X6QUk2JVymows9u/NEK9K/+iuW/GAZs0XG5jPbKg4e68Q\nnLcFZFAh5u/mHPbQus6MUD5ozBwq94Ys0wm6afYs5uR2+XHc/gts7gsnxme5\nRayeSg0oox+1ZUlkgCP0D/6FgpRcFeM6+ymegoHZ4uPJbVGI7UsxT4U3fX+o\nCZ7x4FMcaNGstAvNbphjhNsORapVTWST3CSKJgEqwjC4w/oS9X5+r8KuqoG2\nT6qvU2KxNDNCSOjSZBTbyTeHPou1pV4Uf4mEpEPLf5qZ+vT2tOqGaSweN/vb\nB68+\r\n=zwjC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"36862c371f1ad1a8eb3bc6bff215c1854344ac5c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-36862c-kp5b1bfh_1622023727675_0.43751726684686654","host":"s3://npm-registry-packages"}},"2.3.5-feature-4761dd-kp5dvado":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-4761dd-kp5dvado","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-4761dd-kp5dvado","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"33fdacdbdd376ebdb1989bf486f9398b0255d5bf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-4761dd-kp5dvado.tgz","fileCount":148,"integrity":"sha512-uJ1YnT2AV7I/BoJ/In+JsviaPAX0qqpZLedtHfdTTTXlj1Mnsfl5vQWaIEPV3JlS1Ju7PWGiN5x9Db6bZMKVOQ==","signatures":[{"sig":"MEUCIAvLBof7c96kwkvw7ulQoxsGGc8cFsaLo2wmn7LJ5tUFAiEAgPApAd01/UZAASbRkz0H8Q5V1hiOvsDMVVvvbXrCIwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrjDECRA9TVsSAnZWagAA09cP+weKTgNdVC/YWTDWLdM2\nlWuEipOtKD63zXIQfDE1xK8xaCNwrtLG9osIysNKJDhv84+j7F6RZN5p1YFY\ndwAXMRi7bovF5cUi5ATKmZbKgQNqUbVql7//aT9rrTyHDjQldf6vKleU+3pp\npBD+z/OhBwtyC+jv3Hs4A8oQLmNNabV2xhjv0MuYbpIbghcGfCD4an6ZSb5L\nr6E5WZn37F8LMkECyK7v45dtA2+5EO9n+v4jWzgiphUNBkvSKZg0SaDCKgWP\nPDkZLcwM6irkurqNQGC8ddstJD3kXQF27xUxRMJwGlZ8NL6jNmFhQ3O8smE9\nx+1nMqPZFxh2XCIsNm1jNZ14EeBo6lh3Kc4hjIAABA254lbSGk2dkWyh0WSt\nWm9YZnKd79ocHu3Ex2qENWdUeXWD5X+M2+NDqgYxJflTFefdaqW6gjypnTHa\nHllBNW4XP4iKViU9lrmp4aJegJD9ElPbVaYwXPPuPSk27b4VrA4bSmuQao0r\nydqcIDgfbf494j81eAEqQmqXVsxJpqKR470bG708GVBCA1cV+DJ8BhR8HXcy\nHXF2y99lLXFD5mP0ly6BRZhL3m4roPiZS5Ru5Zh7QJUJBUH/9voAHZYSO9DO\ntgkyTV2mtflKKhQj/qBwg/Hf+buJGZH/sS7ikengmpdzoaFNKuiIXGDqjNdo\nOImj\r\n=b68D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4761dd8215e7d95a1af9710443bbfeda1fe48048","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-4761dd-kp5dvado_1622028484389_0.9490792661018645","host":"s3://npm-registry-packages"}},"2.3.5-feature-55d189-kp5ihw39":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-55d189-kp5ihw39","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-55d189-kp5ihw39","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a5b73aa56fec5a5cdb35f85cffed352f10c2073f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-55d189-kp5ihw39.tgz","fileCount":148,"integrity":"sha512-xHrdnzTcm4t4oDSKEg1aUQcyhKAQRU38wXXNR6EJbeVlriRK1NL3PxgsPaa0/PYusnOSjMFcraZiqDu29ZplRQ==","signatures":[{"sig":"MEUCICgB4MbrxjWGeQ9/9G7/tt38+fWNsDL/lG6XKk2b+nzEAiEAhKKlRmW6/TJBChyrPng28/LtnMzstk4MFdnKNZ3hnUQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrk8mCRA9TVsSAnZWagAA4PMQAJbMICq8qLTEOu1foR0R\nwr1ouG0SOQMmDMe2TnHJZL6QXNrmnLHzXfiNrkJEhisuAP/Xe12ekXiXfGK5\n/qIcH7bXBRWpgGvN3tz7ENQT2Z+ROf2m9OSPuQEbXtfieeELYn3/d6YTsQiu\nnoTdo0htGXPHukCuecC4xKq5TmkCGhkuRkaj0P2Xy/PmlZHjPkqx0/GOHZ2j\nz7Qst8Cx8B/5BR3PU3NVNXOKzwcDqfqCUy+AMwf87QviNA5n8TKhOYjKZRuR\nX9xJ5HivzQqlLIDfMdnAufsgY2emUGJlV0cnpJZsK0eN740e2eJzkYIPyZus\n4zax+/xynKyKsubLRX6ZsNk72w7d0ElB1NzbkS917PQocEAW0BjrAHX5+33r\n1eo8I28BVIJVkdRqj7xaTQ64nWh3HqoNn8vWv8fRttDB/5AbPFIKcebFQ+Wc\nodBAXvDc6Qdti8zbNRbuo3K8OzFVmIE+YilMwRCCCRu/nc/HMsi6qTdx0S7e\ntNwwcbYaoCU074EO7vI0td7WlhgczYy8UOTZsVzlZwkvEM1An7AnBVL19g+N\nXW/bUt5jREN1AfABnGO7RHfJ6UiFEqYABKI+uXQNIqnnOMlJA2vmVGqaKbJ2\nmSS4ReXHbZDLI9Jk+PK/IgC2N5xnf8sl5M167bYfxj4A8Qha5OiVKn6XiC9L\n2bM7\r\n=r6Qp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"55d18943fc466ab2f1769f7f6f350a1dd2ed2b84","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-55d189-kp5ihw39_1622036262082_0.9169456912965845","host":"s3://npm-registry-packages"}},"2.3.5-feature-016b69-kp5nk2xy":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.5-feature-016b69-kp5nk2xy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.5-feature-016b69-kp5nk2xy","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"adf3566aec4d3292b7a896a6e65e036813ecd75f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.5-feature-016b69-kp5nk2xy.tgz","fileCount":148,"integrity":"sha512-EqRwCW7kL6X8l34GKercDsT9F40sJrNvFmPW8mVCJIHfbWrQ4Y7cFIFuVo0/mRFJsqrvU3jyaX8cL0wb46/uxA==","signatures":[{"sig":"MEQCICO0/wjltps9iniC1fTHu0h/GWgH1dGBfLGY7DVJXl5jAiAXykKYpQSGGTyhEzDxq2e/gdAeFqEpshQKCbLr4lLPcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrnBWCRA9TVsSAnZWagAAPqgP/A7CkI9YCvYY4XjNHBcI\nr+EYJaiYzG02g6ni25Vydd54W+WHNJglawa6XZzYssGpiKQUq4UHEBpZpJr/\nX80UHIhzh+/5UPqtuB54fFzX/pqu97Dk9pd3JhF6XAWrgxQPwTJIOdXxCrpm\nWkra4BiiIOYqYdv+n+O+7MA6ingN3PEmbcy/SjRF5HZB09xPrU4QmDPX3EcI\ng0yf0tiVIjQe9B9LZBU0Oa/emKODucvOipV1ocrgyL1wrpw5B6I5n72OeBFH\npiJR3QnkjjtYwoSaHk1FcHgCUiVIEksxithh08s/PWpp1+dVMuRiw89xZqd2\ngKwWUPvfy2cTFkmPxGl0S5myCtCVjzE1ckJJGSwAG7VHz+UjaXUY3sabDK8E\nfufkKSFUW/+FGpflKUBjdPrE/I3nV2JESpvtWWliF4S+Dy7ePhW+dhVvGFtm\nv+5G/pPaSN4V0hVcv1/85Q1V668xZq+fjClqi1kWvPyEWIg5I7EpNAY46W43\nNHbK/d42+ZDuVNO0ptud8zYetf6iojJ6K00dyVGc6K7CPMkDU6d/XKzTjt2N\nObUjcusZ2Kct/EnR/rxXow/zW17+QJmXHYaLI8l096uSNY9BGAHwyFuune88\nw54aItGlXfB9Fo0Y+kMc+u6aQK9ywb823brPeEBhAYv3uI9B2pW5ezBVK9MY\nQTNI\r\n=rb7P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"016b69d41d4f93d45b5dad0551f0ede75675a4ca","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~engine-mono-repo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.5-feature-016b69-kp5nk2xy_1622044758090_0.05638838476958252","host":"s3://npm-registry-packages"}},"2.4.0-feature-fb894d-kp5q9zee":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-feature-fb894d-kp5q9zee","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-feature-fb894d-kp5q9zee","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"10c79a637814e04ac82ae7a4468c5dfcdee2a922","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-feature-fb894d-kp5q9zee.tgz","fileCount":148,"integrity":"sha512-WcLFpxL0zAFg22F18G8FeCmfF7M1YxqYVRCOeK1c91P19cLMhi7daR7lFAYpj3OItmCq7ZIoutsKcg3g0W4hBQ==","signatures":[{"sig":"MEUCICB1ee8MNcQRGyxrqJbWKpF9Qp7eGtFr9Juc4vzacLeaAiEA6MrvzgKj1cozfu0vKKXhb0Tzv8hCuaHhYvPkhdxljdQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgroIuCRA9TVsSAnZWagAA7tEQAJGdh/2Nuhtmi72ekqLY\npgcEUGri8t56HttUc1FU3h5VkZBBSLfcDNIFycMCgG7azvMXQ6er7l+QXfkm\niT4s04u3AwdFZq+uZILCU0lQ1hZaI/WFng8980+Nch2GOiaAThk82T4L+vay\n+li3/N788jTTsFJ5XPNuAfePDXqrK/eBAkQhewkmqvEMuPj4rurCjTlSEJfY\nRtnrR2LsL48YdoeQEaIYUXsduE3QibDQrAldh8Jbm78lL7cBEQ41xc/il//H\nivM22UaQxQnXsHyTeiNW23prZJr8kv3o/kv44mvzEb6c1IYLEsQIooyHUWm9\nT+gMPImwHmngHE8e6aw4LAttisS47SWup2Kfp2k/+bU+S5IFavByL5HmvwRz\nDpoaTI+Hm7KfOMnKxLAt5M742ATx6gB8p4RmYONC/UabpN30/duhJQZHIkih\nz61DsZAwB7I9v92fLpSFfBik3NtLLTIvsWTVy8a+7kAbqMdi733ZF8eDA2iQ\nrhbRlwS6b3YG6zTU+LyEGkr+eLOBgRsvFbDQeNLxt/DumkDWUPP49Ja84jeV\nDZFMOfLC7+6DqS84fgSQDNy8dQBnnINNK47rU4KMPQMUChLdZnkGSBWTpXK5\n5I9acUxtG3J7YvHgvLpxjdjjfNtZ+RWE5HwfwgcGlLMA8KEpyNBeHsPOyHKd\nlcwe\r\n=iQww\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb894d6e365b755935a181b4171de0aa539c059d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"1.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-feature-fb894d-kp5q9zee_1622049325746_0.7361408764790489","host":"s3://npm-registry-packages"}},"2.4.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"efb014090ee09d5deea6f8a80cfede219d84b41f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-alpha.5.tgz","fileCount":148,"integrity":"sha512-gfl9yH6NhtrySf3In2YykOa1yHhJJQ5wIFm2Cp1udkIFHzPLDT7aHzWi89ueRPwM2q0g6FCqL+VKPp2xG+1x5A==","signatures":[{"sig":"MEUCIQCRN6VwbdPXWbHJSaFDqx9RsVSPy1ps/V08ksqA+DZz4wIgNEVlYCi89btvFmJ5ubgEzT/pOaUtChqt60/I9yAwOvs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgroPJCRA9TVsSAnZWagAAhT4P/Rk4FT1Kp7+x6ebveNK8\njijINicG2kB7aCgVk31MHJaT8gqDndt/20NZGS6FZa/EIFrZUmUR9D2svBGU\nL8+oI3CGu4PM59zpOKr5aejrUr6BhUYIJ4D+MuzJVTP7kkB35sOkcCvF6LQq\ngLOr7jz8/SCKYa31a6j706KUEkNdVUzf5LLwhttkjcGZamnPltce7Gu/4JEp\nzn/nKcXdRmYi80UMJKD0mw+2PHEv7bSJdwlw9fBgXa4nHQU9UOseWzfJ/Td+\nxDS+Zf39OKisuLTyZu9H1tS25Zhtvw4KsF6xFNkDHi1GacMtmxcJbdq95yVF\n9iQq7nKPDrAaoJsG+v+kvr4l4vs+nfHDENRwnhoPWVHU+U3XPq7up46gY6F9\nZBtqXleYWE5CjzyhNurUCXIIBMXZjo/ioHXnzrK8jQOdM4/zUykjyKkQALIZ\n9uxmROY7Mb9hSVRkvSUGvCEqeqNzbzq6mR/P71Q/kvdhg6bA6q6p8eY8JIK2\n8UMYBmeuN3Zr35xLwhEJFLLgM3IzY0ZoSwxNmKIMM/RiTYFqJt5/cFGKyffV\n3Ord2i2BD0RX5a8C9CjdDOqRQN1FQYfov95Gj8YycBq4qMnHKNUzFkJMxDYS\nOdwCyCunerlA1kqK8N/KjwKGmxhhTDrVJdmjhTbmfS4u0xAn4fyrwsTWOE+O\nWqQ4\r\n=NTKh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d4b3d6a71349ef0a0042486f70860f530fb97354","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"1.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-alpha.5_1622049737369_0.30554808381655296","host":"s3://npm-registry-packages"}},"2.4.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"2.4.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.4.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ea3d71f4543e8f819813cae48d6acca8d6773f3f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.4.0-alpha.6.tgz","fileCount":148,"integrity":"sha512-y6v0mTYitGcIehuLxYh+U3HJs0MKUd4AjUQ+jhCVK7QONi6gc+j6QfmFXXEBhs2FyqxEuE7qy/AjY0mCu7pu/A==","signatures":[{"sig":"MEQCIAhKg4XmxNzMRlH+f3McNQ/DE92B5RxKsD5JUBFauwWUAiAT3DNQWr2BfCh/grcbzNDrUWdv8RcVeyitmEFbUZ6Erw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsJW9CRA9TVsSAnZWagAApsQP/imKZd//VBlzp0g/mEMP\nshVoQm5VdtHW++bA81RXOLgZigg+pWFFWCtB4bEzdJe7xgDgGQJpqiJbZNUZ\nrTKRo8zHVCBmt4CU5bJEduuf4Y3zalZ1S0cIGD4p4LOZED5lwncsyPZT0Npm\nSci4q9dOSTG7GBKGN8GIi+YrpOPD9uhDCV4PY73/zGccUDVHy7WPyPDG8uLS\nU5tC+ls8vDtEakOjDeiuIErGDn1QqmO6IgxztqAvTrLoYwtCeAp/SI2ENRwR\n3yC2ewtsGaVMzZgr+sexa+WTIs95CDFQgldDk5HD0YuDnat+jfuIQ/cgDgjX\nt62EeI4732RfWJvn2VorJnWMjYCzmTcUV9dVdEgwTqGOpRd2dD2Mxrjn3KmP\nc81G35cWT/HP1cQWSMModoN51GgVuEZ0D55UlzkiTVOC0cw2h1eCOIE009us\nuxyQEvfXc8+SkDRpl8lOEzC3kjoVyh1kgqTnp0Oiv1lcyzELpVVqyQWhNqM8\nKb73OpINKPnBd7lDnk5ADolqJV7FIr4PSz3FW4vbwmksGr7aURLYL9wAyjh0\nwRRYABa8B7+qLIuF3zIeIiO92Wslj+paydi9mPC/vE5VfOvG4qXuq7zlzw/O\niymwpBEeNFtuaUNpFuQezupPeltc5CvI5olv76Oh1oQWt14sqUPZfqG2CewF\n5rPE\r\n=iKyI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5d5152f1cbc2a414a48786640354d1809f9253bf","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"1.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.4.0-alpha.6_1622185404542_0.9486967570744562","host":"s3://npm-registry-packages"}},"3.0.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9eece2fe94b24a72d92a64f4f114d7db98563ed8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.1.tgz","fileCount":148,"integrity":"sha512-O9mZTnLUTuljDQdsws7HJ4JXj10vEcU/dI8nX57xeqTkSkfsdazA4ISqlB7dljut+afQMGqjdIVrTj46+OgKCQ==","signatures":[{"sig":"MEQCIAxslU43rQnOXEfyR2ug2MFq3xEUgIupczK6UuqR4CNyAiATMxMboe+SvtDnHCmTOgq24EWdwUSqpczDdYGanHd3Gg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsJlYCRA9TVsSAnZWagAAoToP/irQ7RgbstPWC6SLtJ66\nQl3YP9X6i/4KUx5X7Qx0TJit9OjEWAqX52dYaWPOw9+xXO9akCC/+JFyu48J\n1ETXdXLl9zwxGAptv8jhYBBGBRzY6DX7TY86QUbhMkOOtCzrs4NM1lDz5lDH\nF1F0j4khd1o6+nKqX/mlGHftFsljLOiC02HzA75IOotIx7R0sJB+/lZaoGiN\nl7OstifRLrvsuhP9R3V73kljfBW5GyqpieeWdOk32u8Rq4Vj07I+Y41QrDfw\nnmc+s//KT9Wt8eoSheBwhhjSa71UDXFM6eUAxtGHcT3OZ1aCx1xBNUZ7uzC4\n1DQc6xMh+q2c/C15Qv+hEfhDNpb2ojPL3HapvHqtIpHslNMWvEHwzvsyZ6sz\n/7b3Wk9BaogQe2RTnwApe+exWFaFpSN2QWt0+SKEuHT5wpk54oJ9XmUb/k8n\nHNJNM/MtZg2MAseJIH2RxcdpIaqrzrwpfQ48lObdD9BwzyETym7ivQGWN8Y8\nD/vHHJcPOZfzWo0EbbV1QfXwFAJt6/EMU7xGQynKhOaLcUYTDJrtBmVBKDEG\nqI3JxuTEgOPp0tsqgKZ2udGXiYXtpq9ifUBL7rLP0Gt0fICWgp/juO644CVG\nPiXdbLFni2QJK7HaBkXiU9rm45xNHXe8lptdGtTb5osmPI6G1F9ABD1Pi7v9\naKeq\r\n=kn6t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fc108b44ab0c0e78b946732e02606745f87bf150","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"1.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.1_1622186328142_0.4043893177259408","host":"s3://npm-registry-packages"}},"3.0.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9b87e96d307dc3c470be1b9d888f4953f36439b2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.2.tgz","fileCount":148,"integrity":"sha512-PLMvrRhdg5Q9TTTnXyz8qNxavocklr6uk0Ldcz5ZiPma0HmLbEYqrfaD3mAxcrj1uHkCSg6McHNNN4ZhuvihYg==","signatures":[{"sig":"MEYCIQCJQRgvTGSIbrXQ9JxayMnlCvZ033Nbgd3YuYAKg4rK4wIhAK0KkPBOPu4ZQk9rzgppTCu8SKWh0H9X3/0Mg4nnqntr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsNZ7CRA9TVsSAnZWagAA+g4P/A5v5OKpAqvBWlwBM/w3\nZZW6xIADTsgSmclYi2KU9WyfS8/ZRQDShX86Fj2WfSGR8/ujl+TIEaay3EdL\nEN4yWNZ2SYeUWtgt9TNF3XvmphUOri0P1S6smP/4Ab8glDnFdBzCaUSyPD1I\nl6gS5uqg0OXkbFuvfvWOZJiqnRc1+oIGlanro3MkagQGzToHisJaiULR3JQB\nGvkGH0rxSP3UMpv8DC1PkjAjqOmBY8sZbzXxjSRDaJosdJDRaDvIWEa3NhWB\nww9TAPqgQ34pvTTts56AkwbRR5T3ppgYyYBAqbiw4YCXRhlOyw+wauo+iOAU\n4B1ZWWPa5Ah1B/GAS0jmPdFcQyVJEyZKoPIY4EeNJwi7f6SL5HfTlgbjsFBr\n45SsINJCpAGZGNpnSiIg9GEnSAclyQFVfH2RdHM0cvCLnHubV/ZFe52qbzDo\nzIl+4m0yUwGSYJGtZpn8ck9L45RtTXeUmtjHHqq/h4KFmXl9zXpjzUnsB6d9\nM/+XobR+TLxgZ45i8h2I3Sm9DN8jnEf4uFBKNiTa9FpUhHc6BNrhA7kdxpwn\nH1yYA8mehhrnzPBGt/m/2DJaOw8aeZVSxK0Tj2Li+m5ul235LKKbeVTxixkN\nAarVmU6No5ea+OqrFsadgyFwMIwYlVf0kfURF79XQp0y04am3CESVw6+1jzA\nuVLg\r\n=epJm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7d3f7d733865fd046aceed99545ac09dac0deeec","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.2_1622201978487_0.7549081627723238","host":"s3://npm-registry-packages"}},"3.0.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d5dbe5d0737a3e2f5c033c73f2740ee44280c9bd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.3.tgz","fileCount":148,"integrity":"sha512-JMXdpo0xM+KK/VGUR35bJ7FXq+dX5T64TNn3PX12keCsR8mdGyeeL35sSA6j1RHHrjoU5qJHPoyVxzHJeivGQQ==","signatures":[{"sig":"MEUCIQCTyHcQghoQjf8kuXLpVyVp/Ru1pAdc763s/oXlF9kzTwIgdhK433U+qKVyFLCOAgqqOyt5+vePWGeMD2A8Qj4WIXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsNyqCRA9TVsSAnZWagAA3toQAJbPZjqN+kIAhabZZo5M\n+7sLfExJK6tLDRWt1NK3D6F1LakCWJwh8zO/rzRttAYTn6bHAeyA9bv7knjK\noF7eR8hRbNx9btiSVTKLJkvAqR1DT6mwR88OoVYS4EKOJTR3Ew9yYdZ+K2eF\n1wmam9WrkWqb4o/nMV+ifSYNxxfJQbjmoMF8akWFVhDBxw4DDVG/yJQMLHKH\ny0eAFJUau7MtkWkfqeo6hvG5v+SvfAZLUevw0GSdDGxiKo5jj31o5G3moxpZ\nRdPpGZW5SO8Cg0QJoEOEcTc6yuDEUNnxHRf2HYyo9erfx4XUQFk4eHv8nsPk\n3xK+pcujgxFbD2txKqd9GCoB+/OfKhzvwKm1B4Ajsum1lUc15jA4axEjAlKx\n5XWVNDCXj7VDxQX9yFNIaQIfhXuHnZYkjOvykzUDc5Z2mmYea+ZwKS51Voxb\nJDe6GkQmG/9a7Kd1W7qpb1fBwjfO/0bmW3gn1cVTE7/14RwZagAg10Ec0NNr\nABKWkGqvDN6xXHB9jeQetlz+0smLjlYtLyEydMGK6en9Npx9Dmmh8r0986Xs\nSfkYqw7lw8eeKlGZdvKe2MYzp2q/gmPszYvST3cxgoZRgGlL6tXpbSY8BtyJ\nThuzMolZPDv2H8a339LhfaAfjjKiU6bwdGmB+lWO6ZM3wurhqq2AZGkZ48gm\n06gA\r\n=OxIc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3f9005c8a6223c9f74fab57cafee465561bcdd9b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.3_1622203562280_0.15816832694452088","host":"s3://npm-registry-packages"}},"2.3.6-hotfix-b9ff4d-kpe8wgw1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-hotfix-b9ff4d-kpe8wgw1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-hotfix-b9ff4d-kpe8wgw1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2f8a1dd98992c0b72882edd68719ac509e0c1de","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-hotfix-b9ff4d-kpe8wgw1.tgz","fileCount":633,"integrity":"sha512-g8XtoY+jFoq2Jx5F/0BfA/D5XP7eGP4T79CjGFJ0rw4Ee4i+3gan993/SW6bkEn5gJJzByd/4PpYnjtk9q1oeA==","signatures":[{"sig":"MEQCIDfRNMJJnvFzup5/qdJmkb4B0vPV46tZ+rL1Rq5sTSEOAiBLJiRjjo4XSoT2maiNJtEKuLXuwaghEB8+TyhHKzHfTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtl33CRA9TVsSAnZWagAAcrEQAJdUrIxYPt1RsTme1MXE\nKps0zRTcdZyPp/tRhE8fOaKdjPyzX3pJYAraGBfBZT0P/25p8nqE6da09v/h\ndn34T6+23RY8BKA2EiQPw+pnrQdB61k9Irei+vgNL6irmLq40FJADC3wpwqX\nlRqNu7KyANYzv+QmsBSXnIw4hVooCOJj+uouwJ3ACqCorpCDiztPmbqRmjAp\nDdN3DYxXQjhO8/hXopkfz0oKX+T3zmI5AAK2qdVPIHMFJPGFUcRLuZwEtByc\n2NGvnj3YNJYRbL04oeQve1BJFKn8Yoim6sP/+2YAz6qrx1x7TEg1dQwTz5qp\nyKnBcMYlaKqJgTwzVy9y5DtJHsKbVNOP39Duuynhf2SWqsPjuf3DQN+gOvpu\nXimdeeDh7JvkZ7LLTa1CmOb/gU/BpY48p7zUJOFpZoo8VD9JrOKN+THamKQo\nfDqR7MkR/yvm94uUqTRAN4aurDYtGzEizQoca0Hmupa0Ax91VYQmXfDX5XU9\npRzJKTi5Lw3HWxBvLcHjMOpGyuJKHg/ycKCpDZP0aOvwqw7oRr+XKewUq5dx\ngkgyNXCYxgC3yNqk3gufzIUv9rEdMLhFNkW0Jc7rZEKbjde7tMypsQzPfZtc\nPQQpS15RCzJictC3Q6aDKb2FQiBk+yElV7EDqsdradSRLYm4/O8Ey3rkIRg/\ng8PG\r\n=PHTf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b9ff4d5dfad70d2269034c49f43b801a18b0b511","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfix~et_performance","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-hotfix-b9ff4d-kpe8wgw1_1622564343395_0.22748794410684048","host":"s3://npm-registry-packages"}},"2.3.6":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5c9840ed61ff4b83dffd82c13a7f2166aafbaeff","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6.tgz","fileCount":633,"integrity":"sha512-Ws0mXzDsIYw5D7gmndv2vbZxc9hb6PlW5EeAKBN2vm2k+4VUGVv+L7oimrJS6upXl4BfRDbv6Sr57Aru62/Ymg==","signatures":[{"sig":"MEUCIB99FqURfaOVo7BNZj/PIWKEy6f78pmSF/r17c44S1uxAiEAs6GkEKcD72CFUgEiGVrh6p5fownJNytmvIJvaUMz+LY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt6CeCRA9TVsSAnZWagAAJOYQAIsAoEJZJsZmlWI9z2pm\nptcZFKGD+C7SU4mnrop5lRbKQ7y0f7+2fzbeAanOYC+jAuU0r1By+c/2art0\njtdN2jdbJfBlrDiGsH4gdWKN7MrSNR6nS4z9cblTfcPfnvPrIQ101N1a1Hnm\nkyRGQuTyxFOYtP33QQ/cmbdZpY394uyPm5wZGpA+g6tBsmp5WwFNQelUSgxE\n0KosOtsqAy59F41TpcEJEl0fBCJRsEGZQZLtrsWxFwIij57rUZhDWAilh2g4\nGGupd86ALk7+JMrJXNImth2sZls0hWGfwCtZU4UQDwxcmitBCbcZvRpZb8kO\n/RBY68uv80ez2zcNVqu535fv1JTvhrLbbSBMUSEr8AGs6bIBFTxyhVO8SMxy\nwQKWTu5CpRyVAft1K3sbJShTIPVycLlP0xBorOxyhMbIhMiHr5CdHV7cdkgJ\nA8CY4TY7tkEL+nMGcom6ppMmgjyf9VBMV/lDfC1NBAoA31ikOVxjDxF9M2Ci\nCNYud1ggZZOF8WQsc9yQ/2/syWhvc43xtY1TcUkEzC/0m2ihVSccdZSnb4i8\nH8GglvImRqIBYSesMw/YsKyKMXcdKoC/u3g/grbQqowdeQfqRJnVPCRzdwqD\nL/92FL9HoR/1nBNVGTlPethId6c7qvDK4ihnDhU1iU7Iv3Wn0DFmHTbCAuss\npjdy\r\n=N5Tm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"8a3a1bd9c8dc43ca085edf52704c639d71c13998","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.5","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6_1622646942062_0.5248477366515487","host":"s3://npm-registry-packages"}},"2.3.6-hotfixes-7338e8-kpfm342j":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-hotfixes-7338e8-kpfm342j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-hotfixes-7338e8-kpfm342j","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b4753bc3e38660e57c229cd7123d423bbe9560c7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-hotfixes-7338e8-kpfm342j.tgz","fileCount":633,"integrity":"sha512-aIcZluB1LGCJv8QvC2VcCahX0qqs8j1rnuHfcOOohhpx4icA7SXhjUpnRYu8OdnBK4kDIaGgNqV5nTfhhPx6DA==","signatures":[{"sig":"MEYCIQDvHi5HrTPFFDtID/+fn0AevVc4B98n2glTn4j4IrI7CAIhALcgNRlyDXBiBaGLuJKcTZ1FwVjwK1w+unKzauNnS47Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt6CoCRA9TVsSAnZWagAAB2cP/AnKZCcIKHLxkogqxOdD\n5rh8moI1+e8vJ/z4BPpwFO9LB05YD/k3Nxam4HmEAtefVI1tQZsID7q6yotp\nIwFysh039Pm1iRJBTKZlYT043pxEhqmFc5bJRh8FX0p/01oXvaYAsw9XVfpS\nZB6AU49Z3MkU9fOto9qYM3zr+QQmQLnOpUas1uZ+spQqWVS+zEjDDADO1AIX\nm8jtmqovSIY93FJxnOp+j+bxlHgr601QOLGk0G+uA8m+UKUUIGLmqKp0Jgxn\nUiFuTYywAQLTwx7PjGaA9Tnu/bKG09Ex37JpNj7zXPD6DEohPNP2gA5BaXh/\nfoQ9cSY0uKfolsYcqv1rEzbb5BYY587WQY7xcbxyKqMg4lRpJoxBw0X6/Cy7\nUkXsBCI5uWKc8fRPHzzaMgCHBrjd30LK675NevstWWo6kBhRoO+nRvYssTGu\nmfeUaFhauuziXfXtKmFyY3FssHMcNDAuY9ZAPvF7w27bL93y9r2VCtjn2a8s\nPVB5SwlXDECY5I5y5gElTi91Wq8WS3ie0V0D5+u3jGbaqh03f2O/ANBvPbdT\n8O6fYpqUQSUq4be+yw/s3UnB/0ouxcJ7b6khzGnnmUNc6fP2iiCAO5mdBOAg\nmGsC4Q7eJhXu4qHzy7jKbYtn4NBUnerLJNNdqn/7k7MM6K3B1umpdCD5wE+V\nl681\r\n=e2uZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7338e85196323c4ab914690ce02af26c959ea0b1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.5","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-hotfixes-7338e8-kpfm342j_1622646952403_0.16164920703049046","host":"s3://npm-registry-packages"}},"2.3.6-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0faca439269d43023d426526f5fde0ca7afa9abf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-beta.1.tgz","fileCount":633,"integrity":"sha512-fBkOxka5ouiuhmxpwKPlqNuiNa8s9Nrfceg/jLDvPfQwSjq/hRc1195VuNI2Q1yj3dGSmPdCGXtRYXHqjrwDpA==","signatures":[{"sig":"MEQCIF9pe7HOP99t5VcXcdnVddQLVEXgpqJh0sGPwVzN7I8oAiBgag4qB8G/gCYYr3R0bcRc8irZW0w8fqP4++bUZDabGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt6DQCRA9TVsSAnZWagAALTEP/icgNFJetpNmHQjJgIlY\nv4ICthHVJ+FebPy/0aZ1m3ykC6s4yDbekxf8Uy74DvyBhx93kCrMt5Oq8cX7\nT8m4EyLG3Xrughw4+bYqea/q0SYSQvaKSwSj7g/HPZrLNjWkv6oFuRVdHu+Z\nK3l1Cr9MXq0xP4bWvWZ2IgA70aANvttHqMCUNueicOhtmCFRTjCMPvyuphK+\nixQBotX0cwViqTHO94+1NEj/o6tPMrZUAZ4Pi3Sm8NCm+WWWLK8+Jjbrdvx1\nlCdeZuh5KlPtR3Iy3ocGFPcX3EJc+AA/Xk8ih59JEY5Xpq7EJDe9JC51VC5T\n17nT6AOscKZnR5MIf0GgV32SxbQvSDqvPu4dSuDbc+lF1eImWn85JK23+82N\nMp4rVyEToZ/Y5UJopHi8O//KwIKzEl7PladScqwMVVxcKpqS/WAy7yuqPepj\nPTfBOk1rAxAsqjWzkJ4w9i6x1675F+Sp97KUI4d4X4ZmwFLkaYMzXQQDgUp7\nq3mZXT34d98i8b/WR6ELLpeoKJVdEP5EQwkl9EX1J29hIC000YePBmegqfyM\nPbzCo1JQx463ni6AtPbb9lXFO82mRxQxKj17PYvlLLtcunBged5JrbCeZF+9\n/Gk1nqBm4RxysepgGubMqC/IjOTmYf+Tydbo6BOJLBwqlyGJloTkURbYoTMf\n8UX1\r\n=UDIB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5afcbd91a43735fbd23b0b1190e83730446df38b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"2.2.5","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-beta.1_1622646992721_0.6079156064472333","host":"s3://npm-registry-packages"}},"3.0.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f434c0620e5805e0eae63585a9fa080d39560575","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.4.tgz","fileCount":148,"integrity":"sha512-0CNZKu1Y66PoyPbKH4P0HQlo5e4qdB0RyspiHJwgoDAeVweiZlkthr4opt8fs3QcfvWDn1SX7MuB4w0E5XDhTw==","signatures":[{"sig":"MEUCIF7vLeiSBMDDxGIjH4eIlu1XUGOhd/B2PS0HbkrSX4XcAiEAuiiXAf6yC6LUE07lNTBNd16lM3qyA0L9wztylYkLvVE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt6EJCRA9TVsSAnZWagAAnOEP/3s3ZUeMltklsu4CINpQ\ndYt/0JvVrcWwNj3ADQM0TeRwRYA42N5sVuHmWfSD+I4+qRid21iH6gKMDuLg\nWSBwIqj+9OpBFsjdk2C1Dd08nnKvhdxTJzXouacBimZ3H+H8SGCFrXV3sQDZ\njckzhiUW3HpRvmgw+AWvituzEUc5dWn17Txemc06oNIGxy2TScL3mSrMA/J9\n5I3HoGooOmKjcTYEqNdP7LhphNRU+uzWlQL2GQxVJX2hrjBhxzVLSw0xsKW8\nYAEo5dhFGfxbzPkU5wYI+EmFE3fqTymyyioPfpkVwVrLzxOnklh11yHuTji1\neXcqOpKGlhrwtto8KGGTTTQDFr3PansAtgMqVyZMdgd1qBfnJrGtSqiz7pvA\n/TRPWBMDcJFVDaeZz5vdgdxLNMaOGNbZsrHJaILRFq8jqsp8qtruCLU1sOlZ\nAiWfLzP2vfBGR0NwJwXjcxI3ns14juRuTfCaGnK5l4jBs6ZV/XX+382lSn9H\nZcjVCfb7g8yGyQO4q4EiglmtIEaOdOQ77w0Qriq8M2VUuPhd2p3muW3gUV7B\nN4ZwzKMQB0PZ5WfQaMj71+2iZep2Z9q88zigGLDmtzGVdC1aB3f1hTKs9apd\n83vhTaTesK1ujJP/6QgdvKsl8rP0AnLPjxGL6LsVNR4Qqs98VB56vGYjvuuS\nsyYo\r\n=s6aA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f6d4edb6ac10d1bd301d4910e4abd713f16437c0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.4_1622647049802_0.1370006395970642","host":"s3://npm-registry-packages"}},"2.3.6-hotfix-ae8feb-kpmjtyus":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-hotfix-ae8feb-kpmjtyus","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-hotfix-ae8feb-kpmjtyus","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ec04db3aa1b6e03a0ab5456818987ad65957af02","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-hotfix-ae8feb-kpmjtyus.tgz","fileCount":633,"integrity":"sha512-vW+txBHegXjWwkbHDoqrB6HxI2FlWYTxTT6AoF81cBZhIVrJ9uqMQfG5DvUvPkwVk/NiLeqRIMlWo1magFV11w==","signatures":[{"sig":"MEUCIH4sISOXPSKu6BB+j7l/M2NhLjauMINKndJnE3gzSR5eAiEA5cvT80KQQvPJnHwa8s0Y5JMDFE8YtZrYIREWSfFpuhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvgdECRA9TVsSAnZWagAAteoP/32ZKWnwGzzHtanoHu77\niYrN6fdd4BbfzInzJNKTFRFG1xytoqwDXQovUmLH0tLdbWSkfTshObjChUGE\nlJn96BvgDvsUtAXCmGN+8c+FGD8fyOak9Ce8Jd01k6f8g6/mHz9t0RHXlpqy\nKpSrH3PSUabmZwKzTuHRVHQ/BRIWHbgGUj6rXQQpgFJAZIhj4jptDvAMYsel\nbyLPSRFTws+Po8OTwyOepkM2GacHhhq/G+I4xSnhI244NXQLjZbH8X8PUFYM\na2rlBmT/OGn2AwoKLxXrrBQ5KH873r55KNFCIE21n9WxBO/BTLQYfoQXYVAo\nxv5y6ig4vRpIF3o6L+scn1HUQg95fA/okxGbQS4lCE1tPEf5QaIZCfuU1Qmv\n2LcZ3tzbmr5tSwMKC6rqxO5j3bjZM3E3D213z/ekkYiBlp8PoE484MdaUxCv\nQpevxxy17aQvZPTiWocrYzrt4C+FgmnN3CR7lKLXEyYoO0uAZ7daYbj3GKVV\nJ8JORIh8PkNUmpYgNCQr0b9peTca94QAQ2nHdx4XRc/xxWIrmJ0U7tq3ZBna\njrOeV6Be/Xcwcsub1ygfV1KhdRqiY03FmP31rZpGRH8H2YDKwck7PHRQXWTm\ny/473zPQjPFwJu54UJMNiRVBVu5QbZJJxkRXkga4FUe6A/G68bvXLxakRn1x\ntBjL\r\n=+D80\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ae8febb1e7e60076baed07ca819ab5bb78162bce","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfix~fix_process-definition_cache","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-hotfix-ae8feb-kpmjtyus_1623066436605_0.0340218249927251","host":"s3://npm-registry-packages"}},"3.0.0-feature-7d4801-kpmlctfv":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-7d4801-kpmlctfv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-7d4801-kpmlctfv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6e1f4bbbe29aafadbb54381b509361967d9a41ee","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-7d4801-kpmlctfv.tgz","fileCount":148,"integrity":"sha512-U/iNr+kbQ9Fy5olqKOXpNW5XFni6d6a6EJKQsRxbo13OSdASSoqr2/MwamXVxr7CE7IkuDwLapNllFpy9L1a+A==","signatures":[{"sig":"MEQCIHVXgtsJuV5GZT1ZBhOJ/le8O6P3dhVttlHwhx96rNiZAiB7gQBLcPj5lu4ZyKjac+9O5jmy+U2BlB0G3m2K2fBKjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvhE9CRA9TVsSAnZWagAAjsMP/RSe+h19wMjVZDMQMpoa\n932pV7RSUFyZWKA1c1f0dzoSz7jzCM+X7W5hNQnFNeKLGJfnyO6Cp3CajS7D\ny47veCQLgtjPJ6GFPTFXKpqd795ZDMvP/HJF+6XeNqXw306OGVYTJ1+iS0wx\nWyI48V+AM/PF741wwwSZ91tlVLPSLhztzLL+Ji6AdkPYbVO6EzGbhUqTNx3Q\n/AuZO1K0gA59oTb4yiiS5gQdnRQ6FGbT4sJoqt72ni69U9srcuqAO+WLSfOB\nqGDmKlLPubzAxRnNp26qzoDR7kZQv1RT4peUY9V39uGNEK4mCQ4Is7I4Wf/S\nGn3x7v4Qctl+l19xxYrbiwOqHGyEOBLciRHp4rxnmNfQkYwTuzD8abgJSRDw\nnLVgMtp/5NGviOCE6Q38OUWTiYfCb1+EuaO1L0F231C/2yG31eQpvA+c0imz\nnFz16FWAy0Io8GYi7rMxUmG1juMD58gkxxhKN2tODkuRfQdPWI1Ei8i74eiw\nyo44bFSLEmr+iUZ8To+fEaUk/219I7JNMicuY3ERjQo8MFsL0DuxwctRIxHF\nkL0fRQnqqBuvig9A4iBPMfKu1mc+CyZKI960K/ceQeYyeFuWc1L0sM7WrL75\npziE7qXHuYRs8rRl5ilOdvwmQBogEuhpG36pnGqxtO10yVQSP2sH3rqciZlB\nVZuH\r\n=9Ln8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7d48019fcf89dbee37cc2e59dc933f50c3ab2436","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~move_parser_to_sdk"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-7d4801-kpmlctfv_1623068989291_0.8040136464737468","host":"s3://npm-registry-packages"}},"3.0.0-feature-f79c64-kpmml00t":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-f79c64-kpmml00t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-f79c64-kpmml00t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bbb4c7a7789c8bbf30e37e82f368d2ab75f821c6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-f79c64-kpmml00t.tgz","fileCount":148,"integrity":"sha512-05dpJ/w2Zj+2+0yCeagfw/E3oHok4qp6cfFGF683v1xf2KnVC1TjiELEKcPNdEI0+OkhpNHQFP7imqdncFOkPw==","signatures":[{"sig":"MEUCIDXmByGbUGwdj02S/v3cIkIC3+cQ98y5AqBdvJWb6QUuAiEA/35eNfDjuXWUCx73vwYH8+gchDk4mU7X+MK9FaHhuE4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvhlJCRA9TVsSAnZWagAAlR4P/3hbUCLoBOqKGYnxOsn7\nipsHcdSYwSZ+eXSTwyLwCFuEN+VlJTN5P3zP19RpzJRQdaGTesg1gd8g7o12\nAjkN2gjeCtgmKnDnbm+koe2dRbn9V9PIxRcflMwZHoP90JOBuI9RCYBpPKCy\nOebqrJbHhg/tQeocPz2D+o5557qYQ42COD1tLJ+FUMJVCcZDahhlrilVxgwU\nMHfZ0mNntLgWVeEor+EPugzqd5wdCIh7yiva6WbKTIFCKwgiffMnvXMccqWO\nS124wmhllW7LadH1dKugA7c7rc/K9luqlHqcuRGr4RpQ7vxMOwyoL7vyRgdT\nPSPAWLTN7gahApUCmO74u5tup9XNqMPq2N58Fe0UyhHFPwOHIhnyjm5/KXHW\nsTLSISw9Hs1ADF0KB9e6H14L3JoatqfBc27WXLGf33x+fCdWa+/cR4tMs61e\nxA0sQXWDjNcoj7IKIAdjQ2zdnkmXt8jsjdyQCPLnJmTv49IhE7awh12jAl2H\naifZTNCVKM5jve5dXl/o47PxsnNvTpMhzX8CfnD/nP25EsZD/m+PyWAhEOZU\nPayoy3X4o+CZvwqGp6U0EBmXiP3h6v0fg9pnkww/9CeOgP1AnALPUWyCWHek\nwnnuuyG5gyVo7UOCLht9Bj5cFpUX1AlYdGgyhXPHKsE9bq1ZCSVbFMSx2/ta\nauDg\r\n=Y7mu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f79c64e8355ee3ed0403ba6c8fdce28c25f583e6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~move_parser_to_sdk"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-f79c64-kpmml00t_1623071048937_0.5825298121385254","host":"s3://npm-registry-packages"}},"2.3.6-hotfix-8a204f-kpnobvpi":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-hotfix-8a204f-kpnobvpi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-hotfix-8a204f-kpnobvpi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a9d1f0f6a8673269565b46cb5590c0f0922c0b29","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-hotfix-8a204f-kpnobvpi.tgz","fileCount":633,"integrity":"sha512-dgP7LiGc8CPSPDV66pZp8q4Y+XZZcELWRw65gVnmj+Eyj7+OufCkemHUQUDpHfPleJ9jaK7/dp+7KvtjRovTNg==","signatures":[{"sig":"MEQCIB2FBNl6QvUyKpbeiJezDFazP1LQT9E833J6biTmSX2XAiAnISB3UuZbvrcKpqW10V7P8HwYd3xzVVMgZ06BrtakNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvxD2CRA9TVsSAnZWagAAlSwP/j6G7qq9C+TQP+LDFT1Z\neEGOi/D2OQ+DKfNXUbNIkBFI+/QGxNXj2V3OsGJLehA+9LtOI0JEJVNGoRXT\nzYzGFG9KeiVfe7YGD2C51tuTeoG6AOXLaVD2QW0fQaXo6eMi0HOhYzl3U9We\nk2+RjBp+m7VePioOiZzATvNLgZopidY6iAK1rxJLWst+f7ww/+hXGXWenLgw\nHnf2pYwF/aEwzFTIi++1BqgniN6+2OuaWJuuiYBik9pl7DVbwFcfIg3S0fBJ\nqMCchrIMw5nbzyrBfeHwk73b9j/PkZWWbSpEgs9clYSAABI0qMTSuRhu1nbf\nKBaofBhHVINsSZIsJTjxS8sNUaXc76niQKonZH9mnX6OSrcVrUVoZTIhFgOm\ncnLTYpI6txag3z7lJGdFZQB6K3S3dAvsKGyZkFpewLV6Gkmu8+x1c0TkMVSp\n/cnLf59ZzQT53EcnqurcgxdRCG2VhZw0oU8cBZRHDTHwnKDrOm8lUcuqr1qB\niSjUlFt3LHxkExMbbNge+UrgqMPMu10SgHxJeOT7AoqQ0YlSBgpURrwUtU44\n0joHuBdq3xdJdOuRQ3T310r5KHxTnp4MrXF6W5JoKtkjA4vecMD2OO/+CK4a\nR+FeXbv+3xtLHVdoVUUW55bWaIRoiHmgIRWxuEuMByaocjK1wShJoMCJ/ttd\nPCDj\r\n=U5Wt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8a204f638d0dd6e614688db2f237bffbacb2631d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-hotfix-8a204f-kpnobvpi_1623134453930_0.3386166200387366","host":"s3://npm-registry-packages"}},"2.3.6-hotfixes-b80212-kpnoezb1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.6-hotfixes-b80212-kpnoezb1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.6-hotfixes-b80212-kpnoezb1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"516ff29351d2305ea7eea1df195a6c6ad8c411eb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.6-hotfixes-b80212-kpnoezb1.tgz","fileCount":633,"integrity":"sha512-yRjf7L5f6WXm/qQYDkNdhTNlmVV38mSvmGHrBAlzJ7ztUVgBKYazffggunp2q2JGacMyf4dEkFfBpxMkAy3P/w==","signatures":[{"sig":"MEUCIHyq1ClAE6zgrQA0FXeEveqR+747kFqkRKmyFxYUbPndAiEAsmahRMriHdKCHEKniBgunEvNJSCS1dglgMvxCwR+bJA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvxGFCRA9TVsSAnZWagAAbMUP+gJB+Q4pUPSxhFHF1ZFV\nONupe+0mGMygtvUycDFi5iE19OMXSoXE2EdJCHtSEX574lwzrU0asLtPlX0K\nZdsSrwOiijwcAr6952glkHGW9075p/Eos+EGg8mCVBdpC7jgHdBeK5kCzARM\nd6nilvBBIPG1FUuKsGf8P2XuOgozz4i2UP6ekWNOOUUon7DBcldJM1Ox9Ztf\nldq0B9+FAKRPhCZ/5qMSDbNgcCOYC+Wi/HiyJwNo4MfYzpyLHm6MVILNmY97\nUfk8f4s/n7ux1d7q3aLvoD/zTZpClJLb6HTEl/T8YI2l4vRt4Bkm7WzIuqEQ\nT8rILVHtmOWq+XUUKaAlkEJXbDUffdzaFYYuhejmLFfRnQzQvWIBl/BzMN9e\nnwFq+QR9zD5Sk46VcMJCL1YOgtpMUKBt++asx1KYqIswA5A5Pqo4NjE/YjAF\npckJn/VSQ1V/RK3XGT7SFShWaDcmBw7AVTZOVTUJRwupV/uO6/XogQ1H92yg\nmwVRdYX4wViVysZzGFRWi/vsBl2pfA42jVwD1mB/MEq+4zjCWNyj6VK/rcGW\nDHyTZcG0s2MTwUm/ZFFOfF45FjcgttKp8FZP/ToH1Z1pKyz5Ixn99m7zl1Fb\np4AEWTaUFfz62E6HFNLkKVZI2mSymrOO6TPO7CHHaPstpgsnQ3+qsV6lAdly\n2EUT\r\n=YyIn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b8021258b7cb9438e011f6dc00cad369536e9127","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"hotfixes","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.6-hotfixes-b80212-kpnoezb1_1623134597070_0.06860284902765845","host":"s3://npm-registry-packages"}},"3.0.0-feature-028852-kpnt77di":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-028852-kpnt77di","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-028852-kpnt77di","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a9a4f4bb4c66baf2d670c55ba54e88ec98fc6e12","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-028852-kpnt77di.tgz","fileCount":148,"integrity":"sha512-krurU/0Cke5OwNbq3Xs64hjVmQfImM4SIzdvQnKVaLPaFIp8vqucPqrJTRQCrSjb7b/EZs6ji0HO5bDPa0H69A==","signatures":[{"sig":"MEUCIBnpCBQJJk7cbX8nbjDU+ud1Tysg2LZfpzcj+JXxnJ0UAiEAsMeVw0gEULUVeMUYgPqr6oWG1CadtxTDK0NuSZcJnJA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvzDhCRA9TVsSAnZWagAA15wP/R0OWgwGCUTsDEA1Dii0\nZouzNQVZ0wXx8YxmH9ePf3B7GjUi7QqxoCj1F9wXYPh7BLOFpfixM0/G49Cw\n9kBjmWAhE+I3aGOULHan8nlMZhEaXjrOK00L3dNkQspRubDWThX1FYQ0g42Q\nx+towB/26m9UQx5EyU2aYvDlZKF5tBI78UnkD7qXSeXErCuOjCtlwNAQh3sy\nHYN2vb0tF7XdvGDMaiSM3TYoB/GdC/Gff3unkoR2bbma4+d2e6jFWCvthzCU\nGOf8xQjIKl2Ret0ranzLFGNAlLYG39x92gnFENw9a/monALedUk2c6715W/Q\nsdxxuWLvqZC8wQbZWpwQcv54TuBp+qpZInyidnXOKmYJb3EouvysecFDH652\niX0/Fk1CQ6ud0zPxWf1Hro2A5r3hYqN5zoo9MOnXjYNssONBw16MIKGXOi3R\nstnDm2s6zoPedVpNp/DQ5nRA/qBhSo7LhDfpLjC5BENfbP2ZRr9B+pJzWUeY\nCd7q2HHwHuJy3BK5iL+fTnnOiC37PytIF/9GuC9OTukS+yzNstnfKYmh7sOY\nZ/u22l3E1ni9JMLP6306btZ7z4RhjoOJiyXOKRiMc0P7kFJICM5OYepe8X1J\ns58FqOvvUL20FWMQW9Os0HD2aO/RC1+RqQhuNzf3PJ/RCD6UYKL8BY0b7NYZ\nczq7\r\n=auZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0288527958145b8bc66479c2ec63019aaf641295","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-028852-kpnt77di_1623142625744_0.33052031857288","host":"s3://npm-registry-packages"}},"3.0.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"33d791b5c6c546b7d6dca60b6022f15e5b2788a7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.5.tgz","fileCount":148,"integrity":"sha512-i7JWkZeQPPX9gI6lXvMQOxz5LtMvJJdJS6spyrcWqdkv4sxJr3MpbmfQkPHT3SV3mWulBOLoGcHq+7JvF3tyjg==","signatures":[{"sig":"MEYCIQCiOtaWZEmlpAZeLFymlsxSuBlH2WNr7UPuar9v0AYW7AIhALqI/yiW7IS+8uedY/lGdzZyrj9su9QA4lB3SuW9BVpi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvzE7CRA9TVsSAnZWagAA9Q0QAIOcts/2j879vHkKOnry\n/nFhDtEzq0rTAUhfa+cR9/VMEawNqoRfhqCIF23P3t4On69TdhuR1VxAuoAb\ngH0MwPJ3wxzz5jx6IVn8zK0Ni3Cg96ElgpnVFDh6cjySNKbLeSelNSMmxrPE\nmOwkrDp99fnrl+E6D7lp9CvbzrsNKbrMW7CjlgDeseewZO4HhCyNWx5a/Tgi\nU24wHcmZcv63yKDozRPPbXVI6wz+RlwbUdu1vCqdCxr1b9oXYgxKT/hdl+Fl\n1Gxdn/1NKQZzA3fP7z+7WwLDVzZRX3yJvZeYL2FUhO+i1hKR3klo6FA1raCb\noH0LfHf8N1iS8cQpgFGVqB7z4URJI67lTXT15VSFeeL6fz1jia+Egx2GBf+p\npEV7cy6qV/GRk1b7O5WTAGGegnky2IXO1VThSvRHvVvEFkSYaVSV5BdG3p0D\n+TP5uv6HoRxCYB6LU0LAcWuGYB8ZxCQEZn3zrXhTFqk/kH0j+7KXaanPXHpT\nakuGUELmaNka6/+zQXbQm6sO4UiXd2IJTNZSWxOP8GL4rEQSizkVdYbjF9wp\nq4VEhmnQGrGAMncazM0MpnjimgjLqNhgy9em0KXqDF0WYH1+8LNpO9fKzP2q\nOvZKtrpCly+leU8nPq/djtYyAAOYQH9AfFz+bnXC27+CArpcRLbD9Rr+XkeZ\nGaWw\r\n=jylL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"934f95ecdf89725fd972269f0b0766f07a4b560b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.5_1623142715763_0.5959056961077822","host":"s3://npm-registry-packages"}},"3.0.0-feature-87f794-kpp3ku50":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-87f794-kpp3ku50","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-87f794-kpp3ku50","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"131d3f1051de9c7ae838b6f085586a573014b9b7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-87f794-kpp3ku50.tgz","fileCount":148,"integrity":"sha512-jYGZpSFX3mlPhglJReckDfSuh7CceDkggaMZ/Xd/xBIaiVYLvAiCIeMWQa52OuSotyFjr2viRtEV01hvnZOMXg==","signatures":[{"sig":"MEQCID8cvikC88HB29+n/06VBi5zYa7Uo0B0LvK+705++OBEAiAGCaS8hQn9WwoJXC0hqWn4BMSNKSX5tlmAB4fQKvO46g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwGEtCRA9TVsSAnZWagAA+MQP/ibrrCHsRk+4e6X+EdRi\nWan1c5wxSgMj6RetASfqLoW/XxhNDvQzdJBFKktcrtO3VGwWaPml38MHE36F\n0UIQhtxOs0ekra1wXBQB89pltWyXdIIV0d5361s88KDg4o7mIKENfKuummAC\nN7O2h+/WRT1c5yI9LPEpkcNwgdev3bpiDGc98KgDx5sq8tdOhwoxF/VHsGE+\nXBoQAeMNPcS8sGjBqEv1eE2GtF9Z/KK9trGhCdOBns6fPc/LKyObzXY0DIyb\nZfNYw3TURlFh9ZPq2td4V8sjuBOFucAq+lMq1IUeto6+vyfCqGYIJecDON3V\nI/C+MxtC4hL+l67nGT/NmwNWSCFIalMzqzuCFHNu4EpuwS015sN5p872Ko9i\nIpTfxWNsvEApLMnvnE6uPDrE6Rwx5fAfNrXUZP54BMS7pmA/FCTGpQCyh87d\nShTJiKjj3Zu51OBR2OKFVvHCB9xtRDtPKrXAsna/0EZE2J9HsSddOpaTCf+s\nUtqic0hCLgrR2YYRm6c3xxI8O+L4inKjf1meTlk0dO2eIG8n2kulO86nM02+\n9dgihLB0xT+jutkdhZDeb9SgMkxNoNZXAz0sTCIewL5eDv29zWEnjLydG3CR\nmwcmfjkOxmU89UGtPn9iB5JKwix+rce8+WnqKzsFgJBwxl1X1s6eS2vbOqPr\n97a7\r\n=Jy8R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"87f794cb04b81f7cadbe05a866a0241f95823e4d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","clone":"2.1.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~replace_moment_with_dayjs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-87f794-kpp3ku50_1623220524912_0.4430825504969169","host":"s3://npm-registry-packages"}},"3.0.0-feature-015c9b-kpqmvlg7":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-015c9b-kpqmvlg7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-015c9b-kpqmvlg7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"660e7ea86d779d15e73ae32ae861660bbaf3b843","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-015c9b-kpqmvlg7.tgz","fileCount":148,"integrity":"sha512-n+rNzWS8pk/qL+pC/BhN2iUj/g185x+sv3+bAWgl9Bv89orXIn+H9EeuSpSyiuhzWWuXyemB607IfkLS/GFIgA==","signatures":[{"sig":"MEQCIE9dex2iL2SnOLxxieZUqSK8/SXZKhtuZdNTGgPjDQ2oAiB6ZnU1Mgz6tWYautAX0SnEUKx/RPK9b+5N1pywwDqGIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwcv9CRA9TVsSAnZWagAAvWgQAJy/kolMaCqcrikWf5qI\nIFd6DOBu4ju1DQBr1X+Qlu40fomf5+Gk9ZIkZgUM1Y7PgmBOI8GmHWFgR5zv\nCqLx993pTapfql6AdInJL3G9ggRH83jdWPstORCF38aJmKIA4Y6AQhfS17jo\nZZdRadMvnhLUhgRvEEZfmtNbwX3/MHjZRYMsoMg1u6lXNiPHXejdKiBhqdHz\nyNUL3D05aifieoq1ia3syqQBwBs4P5gd93jd/UPd7jci4LIQizmXsmuVQmZb\nbSo6YeYRVRq4COkiDbL7WxcqdBDMRSvKieDPnNevijQjWqXRHbopDyzx/cBE\nDLUGGkq7g8FpGqe+oP5N8Os1hQgw7vaFeyQOsrShHp96oZQZCAY70NIw/nLP\nIamAb9YTPh+J+9KQyN4hzNI5vLhp4pAfyjyQr8wr27yrOh3YX2y2KnoCDHkq\nJlTEiWukfjzY3p+5JcX/jdEUbG9UM0oL9ry/rcF0coDkOQAPuePJEJER+HBq\nbuYysTPtloFPTGEUC0POdNR0kZiKksCdZOFU6Ey+4Wwwi/fRNbZ85Lj8ev4l\n0qBLGHyOs6q9FsLHQ9tIVsxyNpev8zK/7IWJ+K4UDBM6uIHXyFZcgMk1+PAP\nNbR7xpG8Sk7EsIvlkPi4YK6zSN+rs5FTi6NSdta5f4991cGIGa6EeKmG+8B8\n1c3f\r\n=BWpZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"015c9bdfb40b2e665b38e2e55eba5b3b77796e62","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-015c9b-kpqmvlg7_1623313405457_0.869489082908478","host":"s3://npm-registry-packages"}},"3.0.0-feature-b4f6dd-kpqxgc7d":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-b4f6dd-kpqxgc7d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-b4f6dd-kpqxgc7d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5440a2838b384f0d06620d01b994914b02c07762","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-b4f6dd-kpqxgc7d.tgz","fileCount":153,"integrity":"sha512-Mmb1S2Y+CXe7gyqmMrFNhckvsnbTTy/A6VYW19vaTvxkhv0s5Ekglivl6AsBTkThvSiude+bWjgKc23k80zDYw==","signatures":[{"sig":"MEQCIBDpBxvOR13CouQiiuXaoMk3fAN892o2n1n63lsC6iC8AiAuNBcD0Nb8lozA5qLgVoZLR116GZ2llXNEUZWowjLeUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwhFlCRA9TVsSAnZWagAAZkcP/R5opQeqFQlZ3kSG3BP3\npWHM4KjNGYmpLjpO7CfKSUlVCbsUHHkxyg0OQQH4v0/twJ2kaztP1rhM2ug8\nWcY5JcnlvTE5tIFQs9YBQoYR1ZJpdCpk6dotTpWaK6EuLeAPQjAVTLidLOTQ\nP99N39R9mGlC14gJzH26JTbiz8bUSp5AWtL9xxMor0n4oqMuXGv1UggH6n2g\n2lLnTTIELE8Duv+35ZiMK9/SkRzjZaqeXrKVzja8mUa/U7ufncDZP0iEPXcl\ngVep+P+5hPfhFDfNP0I/GNejJLfJhWy123guMo7Mfif2yL00KEIE3x/+wezk\n+AFk8VCMsh/g59fdwDH7cOCjhWTt04grzH37u2KghMo/W5mGSBRVkA0xnnjS\nxJLJ2l3nPs6wBJBG0B20LPgme7BevAoZML9GaSdy4Ji4nRpymr74H2rPteuN\nqq9GsprvcG7DpNCQj//6PIOO0Uy2k+pdyShFbKjbS+NIrWyVo2EmuSpACfIN\nu7S02icH5IkefrqANLtLzTMDrqXS6P40bES15osE94pbOuZTaerG/JHVEz5o\nUQCIg648b9YO9N8Z9lmZdPhJQy6lodlkfY2p/WgCwrcCXrZ6n/B6v0A0jCIY\nKylcxs8KMQWgpQtaSzFgLQi3yOBq762btZ72U5xhq0wNiVhQFMQ9kMTOaH3/\nTmen\r\n=2V5u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b4f6ddd6f61dece664a91f9dbfa20e4be08da8af","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-b4f6dd-kpqxgc7d_1623331173647_0.561019712320062","host":"s3://npm-registry-packages"}},"3.0.0-feature-898b94-kq0sn53c":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-898b94-kq0sn53c","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-898b94-kq0sn53c","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2041c60692ca17f5f1535343b93fd1dd6b4a82af","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-898b94-kq0sn53c.tgz","fileCount":153,"integrity":"sha512-CJYQTJVJDyDkktW9w1eR6AJTTmwkaFdHjp6oli83ehRcu6PvzIJYZfhTQCcCShO1r858jxmLdZZ4/2kFouRemQ==","signatures":[{"sig":"MEMCIEmreFD+y8I8AMNGqjJI6OzFJ4AR1/GokIsPFBEBnSuBAh8rOBjDer7ajXBDx+2OgyFWpu81uTJHBdz/b88PlyNv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyyvICRA9TVsSAnZWagAA/S4P/R5/8JDl/CkHsPeAxgG8\njt3GwcO7mgwt+KCS7Rxx+V+N0udMQG8YWwqRXBg/vG5IDELin+aOxPfooQG5\nXBd3TNTjxweHMRChLbD69f2kfLInZ2nFeuCAG9l3k0uKTVMLGC1F6+Ad/iqR\nyZiusQpuBxR0uVlUGIR2VqjAs4BJxe+pCTxtuh/7fMcNXogBjdOlCs7Q1oQK\njgBuFFUjQzcX/Wj0/susYNNcWTc3m3BZmz73v4Cse6zQKhH2nrjpIKfYdtPv\nVo3ZkjUq4jYy1w9g9GxtjspuO6v9kZ4Nkdsezt+Cmokcw7HHsXY54S/wABWh\nvlJmX60fKDtBSclWTl5xp0toMmlXvxfToLG6DdqOzrKZI0e7ZvAq/klOenQu\nvwuxuNYv+WT9Ppg+4ye7Y8Y/DGNqiOWETPDxW0kY9wGw/awYjYiRt0lLd7vM\nCV9ZPVYdO8CQA0rz8r6zappGFrmI+awI/3YcwVptLKaf2iPxWF6m23oC3EGt\nc7kPHVH0N9oTXG0o9EwU4fqJttwnIPjezAp2O2YrkHxgvDVYXY+Kj+eupc5M\nu2OAGYzzjt0JOUWGmEYg9d/iclzCMEHQPGgL9wxvXjon0eh0HmRn8l4/qhO6\ns3pOwjc0keyBs7a5ne/uOMJhdwL0aRC2EsK6FaV9b2VaXSFaW/imVvC0yM8U\nCxen\r\n=4Z8Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"898b94a385f19deb494324a55a56dcd40025c176","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-898b94-kq0sn53c_1623927751979_0.6698008661537274","host":"s3://npm-registry-packages"}},"3.0.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"aaede234050eb44f1bc3a242959c3159fae94390","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-beta.1.tgz","fileCount":148,"integrity":"sha512-vT4d4M/G3FE+CiqfCCsz4095TGmkR1vrGcRrgoHYTyogoXLfLtoaf2Y1TFH4kYw1pXC8obcsCDlU6RAyIYBZfw==","signatures":[{"sig":"MEUCIAnNvlHmKQFn48v3pH7+7czBPqXwT7XVJw+vqr/AttosAiEA3/d1eVCURVjdNj4Zwr4n1N4Y3TKN3RNOYiZLwvdBDUU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzKw8CRA9TVsSAnZWagAAUQoQAJ3fMtGkvwCCKe6uzDCL\nRm8Zue7Z8srVWDsMqjli0gIFhJIDIIZYWjT1llqHEZqiq1oYYEWdRN1TLbcq\nwPZbnB39ejwvvcVguPShdTG6Fbf106nW2EoRHB+Qb1W6d508nT55vbNh9U+C\nESPBAbSPKypRWQS7dDWG1wO3X7Q8vUVD2lzGGhG7C3MTq5gydZIEUxhsDyJ2\nmblv1tBHG3PsS6vUgvOlR+XQMg8XrEavEYT6Tm4EkoMf6D6XaI1/OzEI/Uqs\nWhDDqcbBXDZWWJbe4Xof9ML+Fk3UMvo33MmfR2C+uffrnMsAVSUYiOF07k9U\nMiueTtCpckTst5v65aJtOtq7iGXiZB9/ErxfVBGY936sbVBaNUwUu/v8PcEj\naPu/cltDMcYJzoM1B9w4t0x0ROPJ6zHxjBuvwfai4E7lKTYM4iJSoTdvCFqG\nis0bFlikxlDYfmQi5auwMxdfVPTfTdw6JsRaLhZ9JTFlON0+Mh6nL3jV4xKy\nhDIucP+jacQ5gDyHvij0GqKGdYBedeyVDAPJK0S0nE6rOJYrJqLD9+FNATu/\nc3g+x+gTgyQKt8VoFb91QKDGzUjE3snvGJKi7bRLDq7OqvIjpJ/dnY6Ut4Hu\nUqeqt3ZrxaXrli1RNMqXpTxjdJ3pLv5mfVKD9YL2ri/9uP4HAuUn28TRf84d\n3fCg\r\n=K4IY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6aadc256d2a53d9c3d16cc8b586c7213a43dcfea","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-beta.1_1624026171692_0.634674432588024","host":"s3://npm-registry-packages"}},"3.0.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2d1ebb9fe49992aeed2810233e4072bff92e8884","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-beta.2.tgz","fileCount":148,"integrity":"sha512-Xsg4F9iU68/xx07glYYoO5M8ZA2IIXz7sX6YpjlJqaqLNsUKl4xuOTROtIqOv9ut/wiaA+VOWTbg0vWNLR0TLA==","signatures":[{"sig":"MEUCIQCg3SS+GY8D7UuwB7Q19fKXaxVFXEHtveAx/9PaDQCVgwIgdS1DtK+PuXnpoBCn6oFwZADIY2ClXZXcbt1rWiNS71k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzK7zCRA9TVsSAnZWagAA4cMQAJ5rAztwO2Wrw3DiRsug\nKIzbDytXvF/wmHZYw4DLlkR7M4CSeQ9GJ7+KWdfYaRpIFt2KwfR6r/FPhmH2\n4O5WBwoquI4zmSMSbSXorLkTi0TSnXlGi5m+qXRTogDEfiLcSNIOINQplPKX\n8uhL8SKojvisJbxHKIIHedrdtph5+uJnk26JSur5Z04F70mmsAhiWGVhx0zJ\nfzpX6BiQybc/brg9P70tI6FOcBGLWGMdZXWM5SATfk5BjZlQ/+R2gvlFOo0n\niGF8bu/G/kCWgCyFe+4FObowvKLV477j4u0MRLl7wrzBokxHTu2RK6Ux0AbD\nrrJfXiGQD+4qMOsxuqxx9dQ4jFQfJ0KrRYayHLw3UqI4Hb+ADJ5S7e6VQyrL\nepIXo99rvkwMOyzQwmCX6UIk34HObmO8a+GcQDLRdo2mYMXgiiYotGz8Qdwz\nvVi1utC8hF7piAcTNhSUfVtr+buIc3qEiJ3N+rlxHo1/iUgZErHjAbKng3qw\nddFETt5uozjv1ZOv2Ihv+UZgoTCz1kYxuUoogNR3cPAC+7IErHGAEglSARDE\n3/m3IAJ3kklwsN8S4HI8+bGlO3NtXZbv5PLxnzkcmfuUR9JSS3eY0FOAc9zv\n6Io3icK3RK5ivT2w3G970HD2KVjWsoqeAQ3tLMErhY3DUuVFfzhsYF3LPBjM\naIBi\r\n=tr7p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bf54e5ba8e59ae105cabddf830e9227b5651146f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-beta.2_1624026866839_0.684055556499513","host":"s3://npm-registry-packages"}},"3.0.0-feature-451e1e-kq6i2mvc":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-451e1e-kq6i2mvc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-451e1e-kq6i2mvc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"140ee56288bb6b861b6f03c5f94d2ad62563ecc1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-451e1e-kq6i2mvc.tgz","fileCount":153,"integrity":"sha512-y616K83UsJNHqFYPwFMYmg1vbjhQzdOJ4TtRDAGSFvD9g73poa6mAWLDx6oHGXt9wd/yGkr9mLQOosywL50T3A==","signatures":[{"sig":"MEYCIQDjv5IE0k4qgv48vN1IF/IG1Y2pGh+s89k1COSGrW0NNgIhAIgu4GMS31Kz/wcvR7I79OuypcZYNjA/Jdpodlylkm/4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0G+oCRA9TVsSAnZWagAAGpIP/2EmfTGsSn02wffUf1GK\nibAL1kUkX7x11ZbMpqqadCwYQCBhdk1CEBP6d54JdIjr5DzKPvSzCzprQama\n7Z5DktRpZwZT91pr7obCxQT/RJfMhZlBPesXL1CZLF3Y1VXRZmrWVc76kUyU\nZPf6zjOTFJGVGAzfQEX834rcL0fiL6GcB6FOeHgJVw7nENdF3I1fBvMRq/vS\nvgwI62Ohb+nn0ePw3H5a+GGG/YAqVWhdICEERpdgx8MlanbryG8djBm1feQv\nO5SC05Litt+K1mcqzrX5AAvcF4J9r6dmXXmeF9gaQLXtcOD97eiE4qNv7K3t\nNtl0FISw+/8vOsvKnY6HDOTIQW2B5Jl7HR2hFdL22+kKk93nD79i3BmbskBG\nTobjgShxqHjiq3/58FSZ15aukjTjOZEiG+OWJf9pc4qlRxTMF7arRwwsUEIR\nvycKZbfAeOfAKrAVe4gme9LbsDcMtbb6YGGay2xyAg5wfY3Ufw3aWckHKcKe\nGMlB7QQozkncGIltpeYw9tcq886CJzNtlDXg7I2mkK78DLlUM1RfgcKO7r2i\ngA5VkB3sFvvyJS1n1yn4B2u/qYRODP0k5WlZSLLLjRHH1OMnkm7V1xOKYGT+\nvKwyra925XcXHIeGfgAPquItiZKYKgLCtgktJEnClmT48fC63/EyJDeusLqr\nqQcU\r\n=fBvG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"451e1efa6cf16533bfbe47a04c489be91cd50e0e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.0.6","loggerhythm":"3.0.4","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^3.9.7","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-451e1e-kq6i2mvc_1624272808385_0.6644378636391539","host":"s3://npm-registry-packages"}},"3.0.0-feature-937c17-kq6i3jbx":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-937c17-kq6i3jbx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-937c17-kq6i3jbx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fc142e6b32b44d7df7a3f2f5e7ae52e53a4f288a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-937c17-kq6i3jbx.tgz","fileCount":148,"integrity":"sha512-VMOZImOhtFiRLA8WmLmsqCrn2Nad+uzgnsqFuL9DmVaJFZhsn9GgANDNVhaQreT6Dhk6ERRscIqUFy5t68HLAw==","signatures":[{"sig":"MEUCIQD0FYVc4fWIw/5pQS4YffcyZnfQdzFCVoEQ6TiPyQph3QIgCwAMRHDqk1pQ6pVk06COl/O0Odrsgbd6BM5ATdToE28=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0G/ICRA9TVsSAnZWagAAurAP/0/k1toJNeoCS/FsE00f\nPMMvr5li88vCcG2B2WA8DqPAyj19GBB7DrJWTMAjXh49pDqp9lxufvGlqqZb\n776l/jTcbd8/uHsa4gucP2I2LKLo78uCTANUXNWkVJE8UjV6zjsgHWI1QG+C\neYqALHtVB23pNlT3TTuqV7WU7w1BJdVIaOH8AUuBtEeRhk29qA5I4JFS3VUZ\nxrDl2awOZ0YWmq1m+2AbRebZRQGw4poaPkE8JsxvUJXL03y801hD38OXkqW5\nAYh1sCKqBTLuvKAvyqUC+vTtazlQeX0mLsszVAkeDKirS4VHydNfwFPjxvlW\nnZ/SDuXAwBbSr/Tak0p8tIp/gMD9vT1XiZmJdjEAnReDicuz3PdD5ob8mY3w\nV4cweOkTCom7wVcjauuh65kzkQZLisocQj3gjNRdnTKWaM/4pyJsTmSfBux2\ngeLpV+oFMxqXkTgA8DDwNIVFlvuu2ZHe3ij8s02fKH6ahW6s+l6m4Lpp2Jg1\nvuvE4zUauR9R2wLZ7rIqXsXZItQZmQYipll5FLe4QH/L0TQe4VpobCApM52A\n+PnZvs3q28fthVWK9tl0MdMUnujmAgDdwUVCiwLVC9CTlJvwmBbn79i8i7tV\nqzfQdQy7C2lHZsmhiGR+3KmfRo1VUY9NcbCe5AxJyxgO90v2iSpkln6pxTeY\nBb3e\r\n=TNOF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"937c1738ac1bfa840a2235bcf3e1151dd088d2b8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","clone":"2.1.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~replace_moment_with_dayjs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-937c17-kq6i3jbx_1624272839574_0.9910926916290181","host":"s3://npm-registry-packages"}},"3.0.0-feature-bfe7dd-kq6n9wc8":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-bfe7dd-kq6n9wc8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-bfe7dd-kq6n9wc8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"01fffd8b13c7f1391661b8df65a9bd2fbee89a69","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-bfe7dd-kq6n9wc8.tgz","fileCount":148,"integrity":"sha512-7j83AmLx3aiwOFbozqfxQEed1wOtMNhbGd8XRvRNqRv+2UkVoL0uydrAWsoOQFN0Qo7KR0rBOybXospvRWVAAw==","signatures":[{"sig":"MEYCIQDTXjMdqeYmA6KDqGGGN8n0/jpz77qZfDflqDaxTGloBAIhAIqG5JfJoZ2Dd4rGAlRNUCzAS4wYJWBdMb4tbk4e5ZJ/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0JG8CRA9TVsSAnZWagAAPv8P/0Rt/YvrrKGdpIEIZyBn\na6EfG9iTaBGiO3/B/7P7W4S1RVVwCEFRjAkgDxxh8hi7rWtwvl/3CQbdHpnh\nT7VHk/k4yaFtweWYTNeXUMsWNaxaCfJotzCfSZtt1NmZke9BC8/+tbOFsBss\nFw3fzFbQLe5J9A6BwjQ/cIDZR7spcvLNFd9g/OmV/3vOYuJAoChLHmvLMpSR\nXHBbHn1c9RORgxdA9O8oalr4UqBGHpjGMYl9Fs5MlU/msXQgO81zLES6Jpy2\nGOwOVe3IBAC34guADMH9RwMomIKxT5lZ07LmtDdbA9dzMjoKEVOyM1iC9Obf\nDzjYyQs8yOf3hfgA/BUf1DPMbuPOpIkdWorDqiBoOZdWZyxCCi8RZ5VjFiCZ\n6QZqUfyCRWr1PqOU7KNgxcKpxVC7qvLPp7oYxkk/6B8rkUz3JEtuGUWlBQjY\nTj5QVaoH5JXvYNYzkAw0JL7ynmJeY1D1hFDAfcW5jsOqYG2Z236nu/FiHRvi\nDJdKOQEjgdBampd/k3PU2OTDkH4EoKmUoJT6grydaMBB4lOhpQjGgs+JGLJC\nCIwKkSHn+hYEb+eFli2kn/F4T2Btcc/RHVStvbq04pp99oUyoMxxomyf9x/8\nY147FjrnO83cbo3qr7XoZtFBwgsRBe6FfzvKBSH2dOCcZmlyPBCh0bJAUwa7\nVlIz\r\n=3wHA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bfe7dd8e5bf174daec20e3a4a700ed38902bfcd1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~replace_moment_with_dayjs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-bfe7dd-kq6n9wc8_1624281531888_0.5312930634379305","host":"s3://npm-registry-packages"}},"3.0.0-feature-98198f-kq6p9g3v":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-98198f-kq6p9g3v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-98198f-kq6p9g3v","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a5d1f701709c9fa8f8f22027b87fc451ebf96862","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-98198f-kq6p9g3v.tgz","fileCount":148,"integrity":"sha512-rRgbp+QMKe+GsPKX15naG4TX3yvZMVAmbqxGs2pOWq9CyIaailwwpqke1GySTarwz8b2I7pkBmKIt41ppj+nhQ==","signatures":[{"sig":"MEUCIAzXYEhD2sPILDMGHZdo8GYXIRMR3Uc92d5npdunrpMaAiEA6qMVqqttIGt+3JQAvv1RNiNnB6UzwBVpwfoP5K6JDkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0J7FCRA9TVsSAnZWagAAMTwP/AiVyQdIxIXwVq/Q5amD\nbpz2skZzqvTwb0ZWebEDyeyEgSwxCXTwAIZDAT0QOujBeoGXevatv/Ak92IU\nHTXErWG1F8J9LyhLodD3eAPhnRkAy8EC3LrmxsNaC9C/qKRSrW9XAExFL6O9\nBTRW1izq9/9OgZvqmF16ajEXSmp/k1QKi3nf9VzAIGLe8N18I2unagAIkTes\ng9rox3zg5itTq2SEWC85+F59rSn6UuvN6OUuAioDLZub1IhcF3AsUH7oUeGS\n6WjS8QjfS0G97NCv3jQ7L6+OtHU9f1SjBKHJxtZL4tIDKnkt1HVkCs4bWW66\nfDCthVf+HfINwRMweGHlgJat1HKyi2KVrMZpzAFhm0Ro5BGCY5Wl2KiPcZeJ\nDWxgmu67o7fAv/uu8A59ETYn1koJhMW98l3PvdHWg4dagOVdr8PQ+f3fWxMK\npFe1VOOAGux4prjhrEeLWqHCSfvwxZcqVe++1LCe2VYuCJnewbjkRlBj1gll\nx2TFiWWg9p5p292zkD9cMo1X+SKkxb39zDtRZHiYl5vJ7u7OiYXycfd/uYbj\nUm1aQ3suLo3X+VPhxZZsQl+BPQ8xCxDz6efm9Wb8gOage7ff9ayW2aBaXGLA\n4LYJo+JomE4JmU2OFf/oJyR8QKDqRZkA99nW9Nl8+TmXN+X65zggnxhY3U5R\naQF6\r\n=5fUc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"98198fa963bd41e60b610081deaed417a059c94f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-98198f-kq6p9g3v_1624284868938_0.6234092928634705","host":"s3://npm-registry-packages"}},"3.0.0-feature-637971-kq6phcuu":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-637971-kq6phcuu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-637971-kq6phcuu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"80e4dbf0ad1c6487f28f1851d307d7887d4c9a26","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-637971-kq6phcuu.tgz","fileCount":148,"integrity":"sha512-HBOhtgg2YxlwSwlyl7ZDx6itrvaoyJkgRbUwPqwdIu2gYT8xjnA4jF/B9pJGGwj4uabYtbvyBVvgFjxyoR+q5g==","signatures":[{"sig":"MEUCIGEHF1vBohao+k/GYL8g4Xkp9zbJ8fvV+ogdKrQGbnAsAiEAj/UdehdTcOV8P/7aYXhL8JrzMxGOlbPTieeF2yieNXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0KA5CRA9TVsSAnZWagAAsgQQAII5qvG1WAQOi5atFev8\nDwnIgAtM8tjyHSwZcwQ6VVSVTDMROXONHg4COvggbwvGz6LDiVxDx467t6We\nxZS5n9ZheXcRUPQj91W3xLRjHgIrE+W9Vk7+86WF3uRcyGNZi8eSfmIj4eW/\nZ+wfOA5iPsBW465nOhwFNqnkotmeRDdEprI4bheWgVYMuGJGCds0LB5m4EaT\nY/ehnX7HLnvehjk6kaYusPwIsEUw0CMr58YiYzGY43+/t6C2wa6UMfERGHpd\nigen5mFxOuGZPsAtRlOIfx49MOVy6FOq0FoPdKGkZMRUvToMaVVBBhKm9iyo\n2amHuhJcLuIiBcyMo+Z349s+qhsrLotcShHuNrv+Vr2deDnvEC0KzLQlYofd\n81jlhIfPSwL2LCoYuaSoeYCfrvMx3k0Rv+WIeIwTk3wyvlB1tmukznuiJ+4f\nroKLd9i4K9V9x9C6Xez7gvEfhMOV30UVaPJ6yNodnwCZgv4W394CJvKcdIfK\nDFQwGzYbtRmD9lnYSPE45rtw0G/YALsq6h4ofr97K3+I8/27DF+xA7h/Nttz\n5kHBFxoAQST2s1M99aipiPbYaXwDjMAapDnzIkxBKY8Rt1EEX0qCuvdmHB5X\n+1XFwhLMhmwI7QDYwVTBBRwafA9XpVa7zd+X+qxkRNtZ9RAxE+crUDs5axp4\naIkz\r\n=7CKd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6379718f3d332ad6ff65e59135362e213c353cca","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-637971-kq6phcuu_1624285240831_0.9898625240637349","host":"s3://npm-registry-packages"}},"3.0.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"46d7adf063be74904dd9794c85df7fdc7f7864f5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.6.tgz","fileCount":148,"integrity":"sha512-V7Rtvyvvn7uCDIdIht8kDpt8e0BndVYFiXiNU34k7gKwPBz5qkcotpPpZJ0GVN8iO2Pr92+un8uvQHQ0ySRpOw==","signatures":[{"sig":"MEUCIEIL2PB38fjHCZK/oraKvlRl8jsS+R7AFFQeDXMMC8vSAiEA4t9vJiW6kPJVgbyWOls1DqGPP/5zfIh+4Ku/St0rpbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0KCXCRA9TVsSAnZWagAAhvkP/2/jc8fRMnW8IpzWrEPf\n6H5zdPHYldmSDjJm9qjClXYaayqHfk9YcOPt65JK1fZUwWQfHGtg3YhN0WE4\nS//L49VClGX7WDVYXBFbap/ExPuiG1mgO1ezh0peMY9w93kyTrKCO+Znn8We\nCumSVOoj4Mz27XTK6HrEAOPGbbWtJFB5TTTxRrCh+jE2qDKFglO0ZhE5k13i\n+SxxiYB/ThdYDqoZutuITq1ExgZqpDPq2BjlGdr4eNjHRZEhw9O/oYLoooOe\nL1JWOKfGOqDY6cXrccphwPq+EjetyEwXF7tDCJhHRsiSkyZfkwojbLyIsZ4/\nyDsNbsO23i+1a37kBlQliL0Q4uKNF8fWBRz6Se3cf8CmzjIRSLb6WjRhU/zU\nqYeqqgUR/VkL8dCfpj5+NSei1y/rfIuxEpQginAE2XgMallzQExpp5STG74R\nYVB7XqOy1rhJzenfxofVmf+9dKhHs/RN893QTm4/j+fd4CL04EDYQWWbeWtv\n0G7W6H4PWSZEJzWa4zA2B+Gk3pEUInntMbVH20qka0vu0Ryxdq+AJSuTlDqp\nNDN+o3+jM8qWNUcW5o3/ThvCuwbcSp6lETapS4Ip/QxkX+XeXPUutbRa+EKd\ntQs4kF5Cya2j4/6jmiq/ANQe0pOy4unI2l3E3wHz5KFRHVKCl9ElBofK4CJu\neDRU\r\n=8Use\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5fc66ddf41816bd5b5d48fc3de73c6795b1edbd8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.6_1624285335471_0.9266164733070739","host":"s3://npm-registry-packages"}},"3.0.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ede83d0f2282dbb89b7f89a22987cb85538d1657","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.7.tgz","fileCount":148,"integrity":"sha512-TK/r2yYrH9C4oJ3U69bkstkNDS3150nctXYMwmbpMri7u37QnWWbNhBWiNiRhB3uuV19qLiS0APkqMwpCA6DaA==","signatures":[{"sig":"MEUCIA2qbTph0GMevp5gGo0gWZpLlwAsCcgtj6gXRKpCuqQ7AiEAjORRXQtwKd4Oueug9/m3q2L7bn8UfYAU50YvuCX3bHI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0KDxCRA9TVsSAnZWagAAVjIQAJ0rFIUDUXWujbSdYrYL\nCoSllGxFYVyF165YJbVbvj2VQcUtVMfy1gs843KpQE9BGdpZcHc4wIQL6EKD\nbNlJUuoASoGEnih9nXdcR2t1nCZZEkoMGWmGuRnlfqOYF4Eh/BsIcPtDSVqz\n1KpwDCSsnHdPwepk4KPjifCf4HNladHLP+nm3I8mzhl5x/WWovMcc4ktF82L\nv5IT8gW17Nd4RMEAoicD4CqcQyaW8jPcaLjU+WiaYzimtwwmSBMsr9z47gMS\ng5t9bUTZRRq6QUILmLmH5q0Ly0PAtlSZGXeqdFMHCPNCRfCi9oTBUCdHTJYY\nO4sXOKQy+h3/YVVgtzvkXqlQqWSqk2ibseuMnoZaY3zBe+SGiaL0qm+JDj1U\nGgLg0yFkvzgOzhDTqdm9QDJKBSVxWYVT5ZN682u0w/2nq0JCpjd1TpjeAIk7\nE17YImpkA3dHmU1DEHpFyIZXzRV2k74GOIj1OSZu4wFxqgh731/9i1q0v2qT\nwKRTURNsCwtTXA+/LX4yOb+3lJ5Y44pNo/0dBPx2HnUFAGEBTTQx1wxfX2gg\nZyFA2/N2R6FpBz3yZUTU/wRGrhf//BfyW7ECQCrbaPrirIJTh3UKiut0WtwI\nc/lXPMQ6cx3aGtjFEBmGjEsFv6QE6zPqR5N5MNxkQRhHyUmnCG2ZcKXUnaYX\ncTCH\r\n=VvpJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0858749ffda1eb8d2caac2889a7ec1477478d658","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.7_1624285425019_0.843753406313021","host":"s3://npm-registry-packages"}},"3.0.0-feature-c7aa56-kq6prfyd":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-c7aa56-kq6prfyd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-c7aa56-kq6prfyd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b15e4a0176557b3a5f95cbec5c982765f90b1ab4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-c7aa56-kq6prfyd.tgz","fileCount":153,"integrity":"sha512-stcHS4kN8+o3/Wgc862TZLizzRBL3x3PRXTLFCUZAEO2Y1HvAspyKIlpVVa/julXUmLP5qtP1KGNht4ObfFJ0Q==","signatures":[{"sig":"MEUCIQC2AF49x9gqXKYpBBRDVKumSMfqaZOQdpFGlCsDyvSSigIgJoNaWYdrJrWUQEE3MLG3jo6zZzDdyafH9FbZhz8JbBo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":437899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0KIPCRA9TVsSAnZWagAAHi4P/2eQRSyHdsH3+nhL9VGW\n2vqSzOTMvleUFrQqpy0QudQgBzj37Qy4mRunyg12OzNtpTYkBiz/2lEzmfHy\nqM/tInXYo6nfF+NOXSh+CN4d/yb8f/cfJ8K+eH0dkGfeSB7O9wd2Ed42GbLN\n8l1a2HUgbcGbI5lPm6EfJzEJuN5meO1CoB/AjlYZlHs724XFYm95higGDJkM\niUKM9N9iBYdeJoFmYMhy5AmNLqhXoOqI9cXCoRRUxMgpB4kmRSUXX+J7WyoN\nENho7EBG5AEDyJ23vAxNw8mhgAM7JMNE2xkkVnMH0zSggX9zg7mynAsrZQl+\n8KWp1/WLPMwbZ+nvTXUY+XjOdCtUwVRC0IM14ZcOXmx5Hzf06jJmswBeKrzE\nR27Yw7p+hMGirVTTem98hdUajaVrt+woMFUOdkapJSanu5rITQ3kUJgjMydU\nbrGE3Eb0YijgwdirBxLFRitXy32PPqjfV6SxFVIrOpHKiRlXxkTe9kJ14U0q\niaVqmzUEZCfLeShIdfsLEbYLGv2s6LQOb8guzQf7ivI+UDrjM0KZc8afMEba\naZTSvytgfFJCfokzACxSrh3ha0zLRuoh7NcC4tr+FIfQK9Eh+XWDwFVjGDxb\ns7vTweNBwH/L8RSvKLIbxoCw/PWBxxXlYWeSx2UqJHJnAD7HHqRTvkqaD568\nrG8e\r\n=22+p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c7aa56aeb44fbe6824135a9bfb56a0c9dda96452","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-c7aa56-kq6prfyd_1624285711078_0.245010530200245","host":"s3://npm-registry-packages"}},"3.0.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5f040f6ef5ac09abebefb3e0765c23f4419e6157","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.8.tgz","fileCount":148,"integrity":"sha512-2vSGvSs+pjE9s3/QSvIRbyuG4KTTabcgDWKm8H1MzBbZHuI+B1+c6n6SekFKX5f8ZxygzicF4oX0pRPVN0QWXQ==","signatures":[{"sig":"MEQCICRHJP9C0UtctB598CF0bBBMa/fvjvp4erljBs1LsmbrAiADFI41Ae5VqWv5jMd92lEgvkT8W1Ns+lDsSlqH7HArDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0eLQCRA9TVsSAnZWagAAgBQQAIJJYtpm0Px6Cu//13oO\ncPwIiprq2LFz8O8sl6ZkU2+opTki4WWaxXcvtp/GZOv2P1G2RcDIinTpKUT1\nzKmaWL4EewIEqVlRgsN8J39U/oc8uJVyVpXS50J2kVFX3LkB6P9D3uWdvPP2\n+rnZ97cow27rtkDYk5MJcr8CgDcXMtRPSkCoUPhRm4bNy0wPuTXfw/6ok5z1\nhAW25d03qp0JGGirhHNuk8UwJAjNyCXYT81RZnj3w+4HVlE//aQ9nXIHD/Dh\nu84f5UaaW1lyYzaSBrRKxKwMEuhmIkQFuv9Ki3HhGJUbWygSkZE2I9L0v61F\n7gEOreDiW0C1hVXTPT2Aa4BqptNpjDNjoOFELpgkC68b3/MUsTfqPjcmHimL\n2G0efKTLttQDruFsmBTk9+Kna2eM4i/M7OLUZONEgUPc3yZ8tWetHSYPRsLz\nBcScKvUmejdVg2EDad+wC/FcMPw7DBud0bufOY8B8ydvsLIV87WwSOK5epIA\nd/SzxrCSK0F9fubCVG79qx17VmOckLoqu8ZpU2E9x3jBL3kTJBjTpFcjsqdz\nrUA/j26+F1xV4EKsx6msw+VecoMbcRScJLEVM2yE9OVrP5dvbKUkZbWoERIw\n5SMN0ZlErBnjTPPHaoTiXZ6GDmpZkVeHuiGTDPb0udb5INp954C+xAEl1iXZ\nYczo\r\n=hyqE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5bd9c1d2c435de60feb78c9cde9439a7580dfe0c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.8_1624367824301_0.0715848329432136","host":"s3://npm-registry-packages"}},"3.0.0-feature-e0ac74-kqgcl4ff":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-e0ac74-kqgcl4ff","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-e0ac74-kqgcl4ff","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b0278589bd2f6ddd92b5c0543a4ed5d505dd28cf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-e0ac74-kqgcl4ff.tgz","fileCount":153,"integrity":"sha512-sXblgws0qrvJUcPYbCtLx9hQT8ri+9RCXfZCtcRRHbbprmT2bIYzCCvfH8hMkYXpS/ElfYIEpTlqr45TR8HAEQ==","signatures":[{"sig":"MEUCIDBtpgPxa42OdF2s9GzvYjIYDmCLJgZYnT3INii2XLgYAiEAj0OKJExoj1Sh2jI7K/sVXjp2o7zUvlx/7lxKX4TywAY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":437899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2YWSCRA9TVsSAnZWagAAgm4QAIO44WlOxPUnPcGyi5ri\nl8ktD1MTdL10KgGB5jKZz45tmOa+ISKcugtttmSGBYbCOcOUQhZCmQ3DQhTT\nC2R5Kxd4viGYuJkXwd2hdRf8JmHiLtkd6Jk3jx7TeOwgcenIJ4+NHbcG98kk\nqE5ECVRTPB3NnunoZgKA55WPOAGHkYFWQEAPO4ZKfWoHBy/u4l9TP2aGwyx3\n9S65zc7OCduxegqN40cfhPB/iCqJp4K3NDH9YAmtOxDoQJQxaNPCYNvrt/hp\nkHX7HC241nPWBXxS02o0Ol0mXq/IlK4XW3jRnGje2mLjuGL4iHeTRetBKzSI\nJWmwiz1vQ2UoJWIoZ6t8TIJ07U41c+3Llvazuv3Mhtjoi2xF1FreTxh4AZH9\nnxmrLC53NEqQqaa0WV3fAKLReRSwb+lxPuLGWokNDlzsZQTI0Hds+yf3GShH\nkqtuGsgvC9DkO+gdc63IaHUpMqF65p7JynBar62EnKH2mDoRsbtxqxx/S4XA\nTU91psovWqMCq0PNu+xhx7KOalvGB6af8EDeBoGFiB75C+ZdG2BHOImt2sRu\nRLStMwPr+C03E7ti+ZpB7ry3Uc7VjlOSFn389pnZawN/ZpAB9yH850US0f+o\nwvw3cjz8kMD3hWj9y+/3Xj+Md5rMn2k93104/XFbY19yJEg/Hcb9op4/TZoX\nlEtr\r\n=9G59\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e0ac74dd00d907f1c10e5e2a62e739ab22ac5321","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.2.4","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-e0ac74-kqgcl4ff_1624868241651_0.6706080324365575","host":"s3://npm-registry-packages"}},"2.3.7":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"aa6d99ad8bf265caf6d6269c018e426d01fe6ff8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.7.tgz","fileCount":633,"integrity":"sha512-jqAmN/+BinFDAQnMjb2c14hbyngQg87HYfxpxPQhl3eXUufij9jm1Xxc+9SrAMXPYkL2vLAv0MugZSnOhXrD9w==","signatures":[{"sig":"MEYCIQDk0GKM5IAlTk+3cXVi+ObpdWpsHcHVBMDiCNfPm3nZTAIhAPItdnfclgylEae2YzXAS+OY/g1Tocuz2mCIEUObPh7k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3bdVCRA9TVsSAnZWagAASfoQAI6L9doh+3HOk5fAxTqm\n3wHJpN47Q3h24Pid4Q9V9gG4ZKgXdVtDlpxR96+KIswYgXtK/s+bjKesArO2\neUAHan7nsshzyORDrXSAyzlpmUhb1SSTtrDw5GyO+TDNlPu29pdhFchj1dmP\nI5gH8OwCN8dkyxV84LdU/RuwN9jKy7TZ49b7+FScfnCZ5hB5A4IN8pqrQeyP\n5QHpDJ4UHr21V9SbJvwfJjGGWyZLajKWny57rRw+8ctrFwZjkBcJ+1gitj6V\nSQXQrkaQa40JSaFpGnmi90IK3vM+mfc+aKih6UoXHGjghDPpqQ//uz2tfQeP\nDrWury6l10j6Y0IrBMmJB4+tRWjDUwat8zEkaM7g34QcvnyywFLQTCdIl2C4\nbOQSmGyZrUtRGoRqyoUzSLogJq3z0E98cX5UxrRpUbf2E1l2hvYY+NuFyqkO\n1AO6NL+ZCS3o0kCIEd8q9DuHLRgTsepPyqiZzx9zYmdQvcQbfLmJjZ+Xvq4J\n46QqOdwGz8a0XfG6X1seTjn10YnxMlOhwfvyF32G9PduAiUxLOBYjdVMxmVp\nYCrsMEUhzIF+/oN+1PMFNPPKrNNoZKgHqZ70YOMb6SiSyDRQXy19lemb6VVl\novBgbxgxGgjyG25K2Y0JkCAYdXkYX4dKV6oyPtFdiDomA/wQ9PLW2yt+8F1b\nZffj\r\n=SeRZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"0291cc8efd82062aa60875738ed9e84f4b493968","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.7_1625143124778_0.7373058249479174","host":"s3://npm-registry-packages"}},"3.0.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dc87fcf08509c8a8e5e427c98573049f9044bff3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-beta.3.tgz","fileCount":148,"integrity":"sha512-pjVu+Ey78+Cq0S27OZXS/ZgWX0bzcgmbyirSIKOBod5CU2vzh6kPAz6B3/UwhFYBrn11p0TI/EbIi8EJa0cmeQ==","signatures":[{"sig":"MEYCIQClhCpATsFKZfRS7/UQ2WTEbtWi830tB0jH+1IAY3K/4QIhAPGX7NtC79q2bKtob7112Ctxb9ulIf44v9oNb52hXX1j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3biLCRA9TVsSAnZWagAA5W8QAJu6X4ez/Z3dN7m2JIEb\nGknX3g9vJPZ25TJuZFmpbqeXpO6oaSLcWySp0Js7Q3+g8ygl6orken35IIIC\nnf9sytb5x9NEmjQjcCnWP8b5XjeiPmIpztwklL3oxhabf1f6uaTW3oihl1jd\nHiQv8dsJtk8XjIMwVTpN6kmRTYOskK3yirOtONv/gi7de6MEYQh1zn5OaOBB\nsNUOfFw68asupdH612xyODD5IGfQehLcmDURhoyn+Flt8hjBWlCk1I2w5rhm\nrbR+s08MlvcIIc1UO5s4KaZUyrGmd2L/N/5s2kqpEF8qIl5aqJiyGVa9iKKh\na4eWLi9gPXjbDlzWiHcJ+6ZxwfD40xKxAOrN1JwLCDa/a4WPVAjBFFm9eS6x\nIF2o9XcBx8pXdTP0xV4aTIZ0uo6ERKRSP2/nBU6WtjQcD4BA5i5+VRtvnRYO\nIp4L4hq/xD+YpopQNJ3NO1SDl+tD5dmr7MWnNNzK0Slb7ELY2fYKcQWzL1E8\nwySBL9ddX6XLehpdk+t4Wyi8SUy8R0TnqLGlQNkJPGhKAhXzpeO7R12G84Ii\nRiRookU+wG6cVknGp43t9/JP0ZW0COyanmSepR3ximrt3xfgttXRwQq2hXNA\nHcxMCYuYERA4WpH45p0gUHQ7qaysOkXUSTIqBZ2B1QQWoe9iqd2LiK2+lA0Q\nsOZf\r\n=nWBe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1988b4287ae7a8863b5ac6d18eaa29b26c2b0763","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-beta.3_1625143434576_0.07482013611779204","host":"s3://npm-registry-packages"}},"3.0.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8120c3ef784ae09ce64ec98430b5d541024bd3b8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.9.tgz","fileCount":148,"integrity":"sha512-I9B2dWGHy2cs18nE4zLP02Mc6t4Gdbg1YZzAFf29wILNBqTARQIsfQacKwn6ogLzBw7WZ23W3DCXWnyFFqE42Q==","signatures":[{"sig":"MEQCIAevN/no0IOREkeQHbGaI5uRSBCehqWPcWSOPpkf6wuBAiA5NusVrGM/q7hD9E+dEQY/x7kSwFrG+IfFffqSJ2YvhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3biSCRA9TVsSAnZWagAAJSMP/0NjIv5qhyXRBi/2HXg6\nxOVtVI0cUZZjtt7ERSUJS6s6UVIZLPCFI33vaEFuU6pzj7ZUkcM9M+4zCLKc\nAb7iWnHIqlBg9Dz+oIhDjpjQKWNdBTHDxRjFaAMWIN9zqMbRMP9ESZ4m9apP\nnbqNSsRaENUdScGLb479HbUCJJsN4gFeYG8xN+Uzk9o2XICqhcs7U042o1WQ\n2A1/QDwDY+XPyoUHcuNxH2TnF0krlmnV2wCiaXF4xBYILJNEbSWHoOIL8FMo\nuE1kTpy7yjdKf1kBH7ESOCHrevFLHVwIn72UoID8QBvB7brUmiX8xyD6qy/R\nRr0nH8k0X+ju1awxh54xsapd8h9pMk0M6Y9FDHarH1/Ow9lDNC2wkAmMa6uc\noX5DBMX0W+etDeLCfEhQFqpqN28HIDsH5A8uj8UUbSO/zy97ooTbyCnJsi/B\n+A3j7qQE/mCLdY3tCcH2OtL//PvqEPalY7RyuL43SdvKK4P0HC9uPWGyZPWx\n6agLz0ZkVKBD5HBveaURcXrzBfF2UT8N/IbhZIvBs1KbUA35MVKLQFZIuAbK\nF1w6QIvjnPZP9wgd1XA9dfIrSdA/qGxhyCCFsWbtWSWcwqa6+38H+eawfV91\ny2lE78yGWcSETG4hZvPK99OdmeyNQzxru8ekGrlbphgaeEX2VlYp1zr6Eb0z\nNz51\r\n=pFw6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"33f92c57e12d5e03ff3539d8506e40e9eed25b23","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.9_1625143441622_0.32342203382550117","host":"s3://npm-registry-packages"}},"3.0.0-feature-3c36e9-kqkwuqq8":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-3c36e9-kqkwuqq8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-3c36e9-kqkwuqq8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"105c11eb5cc3b01e9f9d60dc409810179cebc9fe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-3c36e9-kqkwuqq8.tgz","fileCount":153,"integrity":"sha512-rbV8nDamqUWUU3qwZyYkXt68Ge2D3MBZRt6hv9HWWpnVVrghswu/yXHhUyi9INSm6MQFA5z7CVMYg3kiLe5kQQ==","signatures":[{"sig":"MEYCIQCMvAcp57mZ1SblbQON2s+JWl/mfkMel9o/2YGF3F3CpQIhALtyfVXQxgGUMdavqVS368ArsfuZEpn3k4JEujKstlch","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":437899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3btXCRA9TVsSAnZWagAAIdQQAIkRGNNlQAlSOnnN6sZ8\nMw4THnp/O3WMvxYFae/8GvE8wtVrvCOWhHjcNJB7vsZ7whiZ2iPzReIOBTAo\nmWp+p2DNXlWoRWD7RiArJ/qyOP9UxfCV5wTOlL0GWypJJN8pGmi3WjLIOD4Q\nwFPHP4TnTaIi3vNNeaOaf0xpI6bzySFHabkpOBaGEz/l1Ms07zLMzvQ7M5ZP\nIVUtm8tRh9HwXV151ArVR2vOpvng5mkrC2Jqx2Qu54rFFzOU7n2YKw3daaj8\neJkjXHcvV0gwW970oVEXqPz8tJFF/E7ZqRCjvSzckXx6RsDcV06PxJyMTHzc\nhec4uLZUWFu3zuf0Cih39+2WuISJjeBLxEDJ4oM9GE3MR/oJnnlOpHGShgfD\nhFKT+aYHRhYGAw/S2Lp8gZlrL80b46NXzVbrDMtbvquvM8SZ2AliLrKIYv3I\nFzKMLAAKejUdPXwe+0bSB2pjkUB3iPpDENVkGtb4A2DZjFDFuluwVxahUlEz\n/EPRmiON/DXxhqsVRLSN0H1mAruNzKGD5o23G+4WGaCpB/9PKJL85N0Mj+WL\naVYwsyReM7s1z7CNH9wyu+Mi1GSl1QWwYfHgpGYMjrRWTV4lhMT6rS+Vuf0d\nEeaz7OYpDMbz+ks9wwpMNB8HtKu2D1yI8MPbxtiaPlfyO0069j9S+59HVhc9\nJ2Y7\r\n=3dY2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3c36e9b26acd16e0c11ec22e7cdcdfa62470c0c6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.12","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-3c36e9-kqkwuqq8_1625144150713_0.8061838468720268","host":"s3://npm-registry-packages"}},"3.0.0-feature-29ab5f-krbzsrg0":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-29ab5f-krbzsrg0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-29ab5f-krbzsrg0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3dbe242fd75e76656dcf99343530fdebcc076d6e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-29ab5f-krbzsrg0.tgz","fileCount":148,"integrity":"sha512-VvH5rG9OaCeuHeoqJ7QZwXdutxkPPqiVZq9QjSeaQ6wo0KDXx+X/ySY0EbSOiOG3pWKt6oFhyS78i8w1Jb/wyg==","signatures":[{"sig":"MEQCIGLNkn7yYyy/hMli0zDjARyqZKBR70YCJ2kgLMw5Vf8/AiAWwRBfB+c1Yb1ciFuTM48bbcn73tnw7ZqOiy37CD2FGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9rf2CRA9TVsSAnZWagAA6pEP/1h5nJ9M6V59flbPIy7+\n6hiQ5ou6CFiCInAjFG9S+aQW/fHtvp2IycVHKK8f34Z5ANwmquENUOwXWYCn\nJZxrY88r/+uy+m+KTwCeTCwIj5+/qfUjsn6nD1TPwvnKUN5++Vgh5QhCalgr\n+JVkSc3qe5JNaACglib5XOrMYRMFC3gOssWx+EXrmTVpnfhopJiEIk4WK0EN\nPIsCrFuZvVStIwdOapzLzlUQ5Mz5PYrIEyAvwy441gKMGjjWEgY0tOiet2UW\nIt0jnjgyhVIDWpioMuurrze+lAB0mae5MQ7OXfhXN8ogugB35H3DTzgeMGIE\n5kfs26zjQqh7xV1Jr7rHBZXSwt8F9TCMEf0ZP/kc6k5RqQR0xcx6qzyI+7Vf\nmAKAzJzsobkHPyyFIvlI1GB6hqA3YB292CMtnrzwmpG+kREgDDDLXZNniR0i\ngkuN1jOQ4NxpVYulxxWQ0vqSu3OTloTZ4bgkfENIkaz7Ov+JQuSOA5igm7QX\n5nFhgQRU29ulxJKR2adbi0RRk9ug4q/LUEdSACUwQTAuTQhHhMXioAK9qWAm\nGh0mDpmUU7+mnX4QUIZT0nORsk5wpOt7lkYSXpkiA6xAE13yYBVJdvMcInfs\n82QSQLteSnn6iS3FUgHHUONl/3W8m8S7BEAgCj8E7jc2jM6Whw6LHJEFUxiy\nv8DP\r\n=LyF/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"29ab5f5e5bb981f15d2bd743348c949091aebac9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~configurable_dummy_token"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-29ab5f-krbzsrg0_1626781686096_0.4736288345586297","host":"s3://npm-registry-packages"}},"3.0.0-feature-0f5c90-kremznkr":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-0f5c90-kremznkr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-0f5c90-kremznkr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1d2e584247262c17d3055ab694dec8b617485719","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-0f5c90-kremznkr.tgz","fileCount":148,"integrity":"sha512-dSpspkEIQazfEnr9ZkTbfEQ7x6w5gG4xVKTOzFQOa4tWXv1YcDCH5i4cIUEdfE3ZvsLbDdD1kbfcMQoeQRZHrg==","signatures":[{"sig":"MEYCIQDxtrltdb4YtUnjeXqcYluQiA7kIZtY4qac3savyDqYDAIhAJ/0Ga7BV2doFaiz35RRIKQFBeiyAjE2r/H11yBPtAII","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+SiBCRA9TVsSAnZWagAArScP/it0EUuZz7h7tIx7waBu\nz1+XMghOSmJzTjNx8GHjCdk2WjOiiKA4x/hc0kLJ0LuYvab4LUHfYxcfINby\nINzl7a+AWJ1WIf23BJqZh3/3//ghGQyIFPYPqY/1f7cJl/YzRl1zKcG2nx1h\nt9d9iKgYe2cPWxwhJehLUfnjQ41NHQhsUqeEUvonbsbMYZUrJphjDx3sp1RL\n7eMKzepcJtmtZK3nzR+mzHgqQK+gVrw9YFT2RBWoL+SPGtk+XXTsFwKxQ00Z\nu0l6M+Prp9ahunfPaCiag4AfamT6YZyiYFv58sOYRTL5qWDZsiopQgx8qE9P\naUZ02vCEkT0Dg8fG39rlDEITjO1zLT5WyHpXWQvOPT8+A+LAA8d1xe3hIqOL\ndc+XvCBv7D8lAjw8sLeAgRrsK9rEIaoe3Je5QZ1m89nvCZzqnAEDrtONLdHK\nzrbLm6GPzyfLMsVQ/B+xhtbH3JOyKLdpcUj8c7IFzY7A+ufum1WhVWQADMt/\nufqzvCdERe6z9mnbo3riRPR9YJmhMFiDj2cPCPzjnNvtPjZKiwHwg6l3YWFL\niK3BPlB9vM7oYQG/vDCuOu5b1QPVqRaRvDNSEey/MHk7yJwBcl9fZ3xDBLze\nNy5aW0JihtY1zuuTLi5JNuUWAoE38jRZDxg1n4avBFo4qkRFcdIHg7FMW6Ln\nU0CE\r\n=oyC7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0f5c90cb229738c20d37786042607ebae6d5db2a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-0f5c90-kremznkr_1626941569150_0.28240380370404705","host":"s3://npm-registry-packages"}},"3.0.0-feature-e74bd9-kreqpz11":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-e74bd9-kreqpz11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-e74bd9-kreqpz11","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3ce3315a3e2958644678c7f11bdfe083f737cf0c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-e74bd9-kreqpz11.tgz","fileCount":148,"integrity":"sha512-0AAxcWpMgAQ/UkqjoTrGVHuf4QmZDS/ewwznAba95JfWSFLODCJd2bBIFO6BZaoMOhpKdt4sxxpD2+qF8guBQg==","signatures":[{"sig":"MEUCIC+Namh58OjoAcgvVNfA6UTD8q3lsIaz3mKoLaK9u27XAiEA8p8hqpC0qzaYac5VDai65ftOmSXTA192iVxSYjmyMPw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+UD2CRA9TVsSAnZWagAAiWgP/3jNxkZUvNO/+kPLI3l8\nHTLTWFZTmFU+2WMYp7/7FD/0oouIJC6Wx/23pWIvwisG72rNsWHlkvvuPBxO\nzk7BC1Hjj56YuAlQdbki30hc0Rf19jeXCRtMK+QSosFNZ78cQ8QEQC/fLOW7\n4FScZG+i76i4iWvSmdYQETzWPLYb6CxWaqwIst4YvEKaPp4IUwIGHERq//xT\n59oBtrpnUtvCsHlo6TrG/3aZXA5bJS7GVYmMbU8fSmE04Ff4NLALNp75OlD1\nacIIvJgWIDy+Dlq7XhRAloL+WKTeytd2z6naKHznF++6tJ3iSkNSvf7iiUrs\nMYrcNtjuir0C0nHWtngCWUiVBKtjOVT1mA7yQVG5toDT8xt2aLnkrUc9pSzY\nnZY7rZhgwHERzkIVHkyfn30UTGWy3KJD3mXrUFg9S0yHwSVpsf7ogRjRLVqS\n7P0c4gz00q9jCSKeQddcfbmHNAny3rUwV6UsEb/iqK6lFYW6cEuXhEnWPL9k\nmjbaORhaYryDujNwtcZKrnXRluTmp7U1SvLJQQlThL+W5LiPIb44sMaxNdrr\nfaPFiDi3M0SsJArCb5KVjUH+wbOrElFsXrMrJUrVdwEBDUXAXGWrX4bTg3Fs\ncJ/18OyHIm0vkmyzQgRzIDqiSt+a8t7iQlbzmvdjrafg+uIz3SbxGJzqZRoR\nfIP3\r\n=6kIk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e74bd90fa49281013b4e296134af8f43ca03eaa1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-e74bd9-kreqpz11_1626947830695_0.26920951413496197","host":"s3://npm-registry-packages"}},"3.0.0-feature-e884c1-kretd8p2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-e884c1-kretd8p2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-e884c1-kretd8p2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"edb5181d64ceb23e455c055235497f76d1127f42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-e884c1-kretd8p2.tgz","fileCount":148,"integrity":"sha512-LnsGUgE7zHPQxgl6WveZWAGSbkv7OzFYKlOinMDcJBANDteG4LCHb76kRMakV6TaQodTY5MrUwDRIjnhZG/ETQ==","signatures":[{"sig":"MEUCIQDrVOFxpR9y5uhSxRv7mHslgZnj/IB0Qd/Q+4VgpffW+wIgb10NtvqpqaeSxQMPkg1qmx6663MP/k/YcOBUf0EmetE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+VJVCRA9TVsSAnZWagAAR3cQAITlz7YFuRcZOH/IzAoN\nC9U1+xTi2vZhB9mwfXYTnJDBWbdXhIAi8q4ceoJn9bQcQGa6Mo49bAhaZzq/\nHYucgRAdmuKLda98eKOE9dohrn86Q+HTBGcjOnbIMsUCoK2OsTb4240Gmq7a\nfKeNR9VJ6pWWPPZ4oLyPNhkGmGygvULyYaPbZBQ0LQvftYEdDBJ/yHkfNYYT\n3U/r0SERv/cv+FRnujYsQQI45R3GIZWhjBYhXfSp+mGMvGYpEAQY9cW1nIhp\nfVx2CRjOzz+7Pfnfo+nci/lib7Zp7vj1y7BRqrunPlN8qgiTBHzHlEYyGOP2\nZwT+rmD1eqh6nIZzoL6OBEdZz6T2wKwnYeD/7d6Ld9lwJTSdabmzyESpvi9J\nRWWxgu3eZPwIY7QSRYlU8p5kF0QhmVkXtxpvOj9ggvl/eLjUb2CUKqW539Bt\nO4/nmncLXkiTi+1C17sp+337tRyylWjxh2ZDsrfBM8381gAtpahh5YqKr68G\nWMAfHbqDa7H9BUWEB3v2oqHYvOJK8dT4QIrlU4Exo/30FolQ+KSXE6sMnbUy\nr47ugR7e22axSVh2eKf6U6b8xlO5M/t1NF1eNVSacDrwE09LBQgPi4qYIzBe\n3duyFLfqZNlxgveaHNdK7CT3abE7f0vyTLn+GCyaYvGUYwZExcDdDcmxKRnb\n4fHa\r\n=MinQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e884c120c6148b31d125fc1dd1afc220c78da644","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"feature~increase_pr_consideration_threshold_for_release_notes","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-e884c1-kretd8p2_1626952277274_0.7646129282614889","host":"s3://npm-registry-packages"}},"3.0.0-feature-a7d9bc-kreu7pob":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-a7d9bc-kreu7pob","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-a7d9bc-kreu7pob","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9c751328e388a6889e946860179cfac72b73ebf4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-a7d9bc-kreu7pob.tgz","fileCount":148,"integrity":"sha512-021tRO2pn5V/iZ9DHa5spuCRaFwbjv88uUKz2uGgCNmL9/bKnVbHyUmNRMOMOjwhdIMclYBoAV/NfxyUlPWdbg==","signatures":[{"sig":"MEUCIFAbnxQFPdApNxh/xWU4Wcg4/GE3H9BVuq6477aRFY+yAiEAlLQnQcyvNDPOUBJ2fPokAmAZnx6EyVp1Cwjyr4WXtzc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+VfiCRA9TVsSAnZWagAAYpUP/jBG4pzdqTpk+9JkJ2Jn\ngtOg31FjIr5vAc2TevyaBlULPZWCgD457JWFy7NPhHZtZZ95CMGuR8pJodrd\nSAazg9l3HtH4VjUgX3iQlJoqLx4HobgqBEoXwPnrg4SUV3YVSALirnbksebU\npbGubdypZZoAwlLSYsp8oZz0MKsWGKiOu+pwFh71rtGNijkZRMhKuwvMJHR2\nB/7ny8v0+SC69i+bNL1Q7RUcpkCpDRG7eUREa2B5rF2ZbccC3bUFZ498p309\n0uSnPcsydxZO1fRX/OPcRnyqa4tHK4glm5TZT4b64EU2APbC7zaNhXsIyvps\nZHhd0JcMJ3XgA20ny0lvJNBWEyx+rHTOpWbIUGk/6CglDLcg+OFZp7KnNsRa\n0oEQgzVI5FvuDs4Ckd6P3rUUhjhe9FOtyX3Z7kjZAnr1rOalN+H0J31OlLIq\nIxck8vyOCEjNh+xZvY5U24zGfXoYmSvYrc+9Jh4+yXM56NiPtVdcc8mQ4DOz\njnDS2Xx0M0YxINtDMHCWPKp04LwEL+J2+2o1C0zLLszWQ2CR21GwdL2m9t8/\nQ3jrj+qFkJJVQP/JDKpVN11GdrCxOUNMh5dUUdu82AlkZ+M5Fj1j3lXpwpWM\n0DkqaeEOSsNLlDnSKSt08K4n5lwyxD9P1xascIf8pCm/twGmvCCq2FssfzSb\nfBf1\r\n=aC0N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a7d9bcb99be0fc7742f43044dcc05646e6f71c13","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"feature~increase_pr_consideration_threshold_for_release_notes","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-a7d9bc-kreu7pob_1626953698601_0.9569704321899701","host":"s3://npm-registry-packages"}},"2.3.7-hotfix-a8b9c5-krfz7y9j":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.7-hotfix-a8b9c5-krfz7y9j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.7-hotfix-a8b9c5-krfz7y9j","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"73866ea837853de9b65c45f9b8a572ad3bab2f64","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.7-hotfix-a8b9c5-krfz7y9j.tgz","fileCount":633,"integrity":"sha512-ymZjwB8NcqiBHpTdwIUbA06Qhvuwt5TAU1LVUqaQT5nSNOuYBq8WG0NM4THVUQWPtFXoddsKv2JDxji9wSuTOw==","signatures":[{"sig":"MEUCIQDwfq/HX/9aQRo9lJ5P9u+jrtMe7Br4r/G3f4ogkWMcTAIgA7Ij4r8Xlt84Q9RR7EtffSj/B0IG2PEO3Ah+TplbJ3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+mTwCRA9TVsSAnZWagAA148P/3lrEQSulCupr+meijbR\nZh8LRumQHYT6Nj8SqdE+CZ0mwBnu3TaCf2Up+CmHjkFVBsHGWymPBiIluxrm\nSTZhntu8FqzsVAdAsIynj+JIdgm/jVwsMAZVQO3u2jpbUo0n1GCFQ7r2h3F+\nseR692o/ZE3u3SL+xv8A4Qsyokv0Ex3NE+wBDJ3dP2uFCoPode1bhMNhSa6b\nnFONnUeN5LndX3M0OcQ2WDTssrZ3zHpbl/hXXBFbSs0fCs9wtp//8ANf43Hy\nal+RQBQXUcGjNUYVY4c1FimnjQVG++zHIecl1p/vQEeiWxb+AQAnXZLHCccq\nLm46K3bVzGoG4elDeI5kpAx3Svygwf2c/gyGlfwyOZNQ9F2c/NWvNQWddEz8\nBbDZU8v0ClsM2oZ0p1mth8RE+KBGFbORf5zhVDX8EYItYJKaMgUpjg3xpuHo\nj6FMO6uJI0aMw/9mokUWhj3e+Eir6bQbBAE50/MV8M6QtQSchylXf1fpsR78\nG72WXovnTWau2I/a68bslT2iNLWRFIwTBhBZYpq6App2dettos3R0uCxy2YB\nqL8B4994ZBLl9NVUJOptV5jqTtv6p8obal63mML30YUczkOlTUXfOuvHD5KG\nQTSmuniKRbG0mu8+qIP/uvT9PinPITRAYk0ln0PFFdCPuCBoWBkGOZaq82RF\n671O\r\n=62Ic\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a8b9c5570b0b5a506aeac891241755545def9a7b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.7-hotfix-a8b9c5-krfz7y9j_1627022576596_0.7507698998816164","host":"s3://npm-registry-packages"}},"2.3.7-hotfix-16c86a-krfzco6z":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.7-hotfix-16c86a-krfzco6z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.7-hotfix-16c86a-krfzco6z","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"90d79c7183900297d824fb880330ccb988839304","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.7-hotfix-16c86a-krfzco6z.tgz","fileCount":633,"integrity":"sha512-bis1vZ8d8EyJr2LUpeqDeqqjgq3TqU1Q9B9OWTd8cXe2FgNLsNfvXUmVS+cWY8I8DRNIXsh4g46tRHDvWvzfew==","signatures":[{"sig":"MEQCIEVjNu9jGGmckJadeyggsZZ9S1iJU7UlhtJarpLoy4h7AiBoTe+3o891qYffXgPTQR8GGoOdTLRVe+TdYwFJjX6row==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+mXNCRA9TVsSAnZWagAAIMcP/R46PyIE80Vu2RBgaczu\n6zn5G1dZnnRrb76OvS1hVY7iw7iCTRER5yFrBAWETmuIZhShfET4Zvry4r8l\nl7SNX7ePt4sjKh/f6m2CE5IZGjOS0WfC+UsfsgVxTwnT/wsaFR0uOSvRv6aX\nv4DU/MeZpGvQQKbHRN0rhP+YmdG0CSUd49iLluigqPfH+qoLoo4eq67oHNJ4\n8trfYhbxgNuyVEGnRMsTLkSy1EA56a/WzGU9ji0MW34853pXf3o0k+eO2TEr\nlIWhEEsPMmyFteW6wUZ8G3oRfZFZ4s/A0PqVFTWsF8A8oZYm+fB5t652txtb\n4IRChxNZLkW8DiVSY5wmBc1GEVJY8plsFvZH8xPhHB9JlKHCWcmVmfipxP7n\nBlGLHslDk3ugUXrTHJPnCEwSz714VS5+AIBNOQ7vEMrgsyRZjOR2dM2mQQ4E\n4hqGt++YqAppgdQGF068ZhsSGhbBzOKb6a00HBSHnYb6rpeyWmzFOH/yISz+\nIEbNwhJ65xSs/f04ipIeBx7UoTOabEAm+T71YSnYz2j1mX8IhkglCOcTfPDz\n0V88W3TIPxsehn6YN4bA0i/431Qht6G7Ckro2hUR9Gbee66R1ILtgK4KHD1y\nWs/qUoey4TLYeonSukLsefiYYugY80kUF8n+ndRJ1qVTWsUyfaz/8ZE56Evs\nBHIl\r\n=sl+v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"16c86ae9a3f4af960e3c4ec2010562585d610e76","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.2.1","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.7-hotfix-16c86a-krfzco6z_1627022797103_0.5758261242788683","host":"s3://npm-registry-packages"}},"2.3.7-hotfix-87a708-krfzrz6y":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.7-hotfix-87a708-krfzrz6y","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.7-hotfix-87a708-krfzrz6y","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8370e0f2295b301503a4d736148b2280e9ea3e33","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.7-hotfix-87a708-krfzrz6y.tgz","fileCount":633,"integrity":"sha512-VjrRaiBlKL5B4tc0H0h56iHC11csVwcfq04Xoes7vy9jTU2bW7+GJ6l/9JekB2EUWJ05a8pmXgLF3u3aqjG+kA==","signatures":[{"sig":"MEUCIQDekWoby050kZl975fEZ1HVKybD+f9pB75J7AWxUtztqAIgQ/IDAU4/VB8AxJyDfc8a/LOcTefrhtjKR2TrgCX98a0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+miYCRA9TVsSAnZWagAARckP/iAAC6enWlceLk4PTMqZ\nI6rzibT/h3Kk1OXCk4QI+ut0AucY9nkloMNJNy91yO/XJO3cwT0ip8bLtoX+\nxNnRiGMDtHjCZNbwV+vOMqQPYM2jarmnlhuzKLriErU98D2sN6P4BjFgWk5c\nGRC9kjx1vXgMQPMHWbYglEmEfb3nVlKM9U9tXB8/Lp0ks6UGljUjZAsHhJlP\nCFbYvbjV+3mFiAr5ley2RObNEqw9th7wRlR+vSkTBjA1i+7qFblPCZikguh1\n87iImXxe+OT0P+uO6W3haITNG7iY8+KX1Tgv/3A4bzgNmSS8YpR9BNEz7/dZ\nnYRUubKuDSUGMHgBzMOmlzzREgyZAZubRdMeFuz1FndBBZz/WNws/V2zyP9+\n/ERDD2JP4lYgY2rlk6nPeXCtZlfMvKYGmUadlY6b0YKZI2aokpJ9IYqGEDfz\nHqOu4t6VwYG8KAPPKTv8PI+DSosKgOKfXnbHJWdk1pr8TXwzK+YX4a1KM9TU\n5oiea6G6ywEUVdhUb55Iq4kDHbn2MWIEyjGdWzyhAs5TYA60Dn/MtvQY453T\ntPfawBEa+S6je0N8+lww3Y7wZ/WWqSWu6IKAcBcC5NQQRj3wGoSiTYGyKbHy\nkOhrtGUuzhmdKVw4d7jMnmiqj4fe8uZ5KJ/fC9NNbjMola/knhkpDIldZt15\n92gx\r\n=0JHI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"87a7089117484d87b2b6320b40d19f5b99ee24e0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.7-hotfix-87a708-krfzrz6y_1627023512161_0.0991140287045591","host":"s3://npm-registry-packages"}},"2.3.7-hotfixes-3392a0-krg0cr2g":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.7-hotfixes-3392a0-krg0cr2g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.7-hotfixes-3392a0-krg0cr2g","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2a9442609c8121464f52a9b24be18f1fc6032198","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.7-hotfixes-3392a0-krg0cr2g.tgz","fileCount":633,"integrity":"sha512-zxipkbnPz3vhiMo1QW21rhCzRyxzzhvcsXbxBJtf+ti045HXl/JCjIKetm3o1P9enlzRGhURHOrY4+zivtCtSg==","signatures":[{"sig":"MEQCIEv3pomzVJ/3O+towUH//VC0h1now7F5HvRZdPGV3I12AiA1qznklzdqMZr1OgQFFxX/Fn7bpDFRQGsXGYABgbS23A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+mxlCRA9TVsSAnZWagAANSUP/i2nT2/1FeaB+mX2TDha\n2+MQo8Q2BJckdQne4G5/i/QPkQ6FFO4rFR06JpJyv4zMUqKY8BBB5YNambWv\nthDd1EefDxlaxrk1EkfDpo4g/YijUXbOiR0BOgro07V9ELKZoNSlsskjVT1W\nrqq2bYP6mIV/6qQK2xVr0MQYiCZua83WSRgpy9kk01TJcOum2eJ5TZYqS69K\nE3lWx8oN1A2HFsz9ZIhqbhTTJbmPMBqJylt/rE9MddkAqNRKzvCmt4cVCPRe\nlWQYTH0/y2woBzTjW/Plwa5qzT2Bw3bEyPiJkUtycmegqxQqtPnoSrqZRnA4\n4bQeffuZ6MLziOQtAKG9rSjFIZx+lpGZJt3+cU7scsV/Jw1VJYZY42RuVSF5\nw5ySyb3a3C3qXM6W/3LLg1bK9XclwE7DBRH82JBn1tVQEP15ASrM7tPqmVrD\nCmfKKuz8FZKTVdwltrWbWSmS7ucvjAHIY7Geqnx8rHSdeWPDGoMAHEm0q8zN\nTDuPbz6A9jx0SjUNp5DA9V0Cpb/QdOCanKWkLTwpkhJ90UK8sObFKDiCyfLK\n3RzcHPaaxQ9PeTaJH2pQAZvYNl7i4TUYglqYRC5gCzX1+jPkQkWHCrMcnys6\nKFzAnXcDrr8XUAeWMqhNs9XTRIhEGmKngSR16TzbtFQ9XUPgshbT9T93SEl0\nGNYT\r\n=SWPb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3392a076896b789591bcab2154c7cd9a330d9e13","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.7-hotfixes-3392a0-krg0cr2g_1627024485396_0.8633401013146369","host":"s3://npm-registry-packages"}},"3.0.0-feature-b81d1a-krg11tzo":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-b81d1a-krg11tzo","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-b81d1a-krg11tzo","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a3a8df302ac0fa5d6525a350ee133e273551941b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-b81d1a-krg11tzo.tgz","fileCount":148,"integrity":"sha512-SOMVFN9ATglLn6+RjRHYusXZHw78f5qcBMQOUtydDIAzpbPGuLmzKQePHpGs0USHymC93cUT2QJW7rwaQ7k05A==","signatures":[{"sig":"MEQCIHy5iV8qp4hc5fQZOReUU1H43bRnk43u6iO0AkZrNwXQAiBtMXpaTEg2YcFYsU72I2VvRKbxJBkIHL4MaqAl06+ovQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+nD2CRA9TVsSAnZWagAAGLkP/AiUWg6C+Xx/iKcyIJ6m\nHOSpEEnTIfeKRrbGldJeBl8QWGAgnodNt5QJcKkYgAW5BnbiGGBuPSMWVgvk\njrHs36vpIJzrLNWsDRhdD4a2mURJFvR+WB8sWQbAyJ3ar7hgr6c59TTKivhy\nVWd9VmI00wb0mRubuKsBOUCTLFTDwF/Z+hA8Kjrg9XBHYzoxDuMPGnbnYzPP\nju8zuK1MzE36CYnbBpEfj+cukP9BYfEFMSsY7jrh4dZ2brfqz2bLjr1ctfW3\nWkOpFkIt5eVK7kh6/hHq313+4eKiqo50tv+cPWxz9SVjtiV+cUUhXwWksnDQ\n7H+r7y0ETknPMHWaM69JsvTPK5mq9iGM2Hem2ZP0LAHDSeYMDqQBZWOnnx8P\n+V7n1r3+VIK+10anI/rCZXa/cQ/e8PuZtsNzLGkNVDG2QO5nLXct5d4ewsyG\ny2EPLienTCilSj2Y43DN4GKYYyzqbVeFqcjXvTzSmniUeuVJDzaLSDZy+Dv2\nGbli8ZY8e2tu2c97LRXv1mr2RG3oLTQRI+FzESA7EJA2zbE6YMPs2cARbfke\nKOZMNp2WK+T6qXQjzapbul+p/0vJ1OTb4yv+yx64VgiJKJ8LWUvIA9ex4856\nePgI2nVRETAmEQQgrqvXOMo+RO+Eh1hSwt0MJF5u2Ez1sf7d2073HXJ1gW0p\nbqwP\r\n=T+bF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b81d1aa413203602215d47c45252c0f873439b0f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-b81d1a-krg11tzo_1627025654017_0.9050164734144484","host":"s3://npm-registry-packages"}},"3.0.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.10","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cfa0b75e3f72fd5b53dd5cfdfff405f122053ffe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.10.tgz","fileCount":148,"integrity":"sha512-wcOzspiwZSIh6AghZJLYlWuKy0Iym+dO4b0zdGio6preLt3+FunKGIApSPXb240Wd0DtRMcpexPwpSexWSXktA==","signatures":[{"sig":"MEUCIQCaDWuzS+2K+Q2F8oW6vVMldpeimP2t2nJQAytpyfZMCQIgKX7ITm3cZdW0IQ62NWZ0sKjUCoE9QauVTVT3+IjPyWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+oPPCRA9TVsSAnZWagAADsgP/21cBLuUpp3VXd7+7r0m\nzRTELOvyMxxwgwRn7xpeF38xeF1IU/DApew/jq1NcQyfNnwGe9H3RCzz6mzo\nRR7NUIUJxBB4g1W4Eu782zLodCSftQA5Ih3HOTVvezYwBzf2VQ3yyy/x0qld\nGZ9Boaq8fXANe4OUmDe0WpPhVZi9/vAQAvcwXmbD2MDGyC0TQDdyXpDbS0em\nhmhYNwjzOz2shkeI1zj2aRBeWU8uSppgmWokkC/fcFEqGErZ6Xg7L0CYPFOU\nriLoE87aSMChM25BCvBTYFBo76e8xIUxdjhPRH8TVhHZKMbEGvhVN/x5yaKC\nXFLEo9khrXshLJ1A1M026pky8V1aQZj2FBtFYfA/BjoY7tT/wjgVdxCZ+PiK\nkd7eHsvp7RvWAfOvKbv9P2uuIkFMnm3sTLCxh9ROjeaP1wP77+A4TdCxasVn\ndZSIZJxM7dUMiAoBtSfs002yul44USu1w4u4PXHLGgfElUY1ckFof7yHd0M/\n9/88SMpSjN2KiBLUhf/io5kU33fomsoXOqCYAU5WZR+epExtTNNEN9s6/thY\np6SvGEWXg77yQ/Y0ghOCDea91CGuFZGOiY5o/bk2T7L2bHKzlCjwHcbcEMRZ\n3mZXL3ZpjC0OXl+yGWydxMZkyX1YaFiXmS04gKMJWPDhy9jZUuhRrAyUXr/Y\n0Jfy\r\n=Wl2W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e3a4e9c8556a2fbd13c57ce4e53dcdcb043a3ae4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.10_1627030478873_0.4410752792443864","host":"s3://npm-registry-packages"}},"3.0.0-feature-5cfc41-krg3y92m":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-5cfc41-krg3y92m","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-5cfc41-krg3y92m","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"14d93b8531729a07398a9580e287338126acb061","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-5cfc41-krg3y92m.tgz","fileCount":148,"integrity":"sha512-yhp29x7yhBH0+CTZSqPglz/KlbbOBH1c4KVPrvszwqfen5NB0uz0TAxeva1DcVKLGsUZdBPVQeYYEp8ncHxkow==","signatures":[{"sig":"MEQCIHN0vGmPD1K9fKAza2DXEaP4CeE1YrrEmrYAmN56I98vAiBVDor29ktvCcdZJDD9E4BUfusOSFCH4obcwrKd30COFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+oP2CRA9TVsSAnZWagAAPvIP/1NCL/5LdXCYrOJ8a12W\n9cKaGrAzcBX8y7+iY7D//x8TMqpEVBC6bsvXnV0Vbw6Dy5fo5vsGAd6x33MH\n7aKrTT+vj+QHAHPrucJnDwwzgJvm0OFdId1cZ1kTf5ItNNkAQ2jmyHADHMrr\nBNo8yAyaxYdKz8AaO6wF/vuyP5Hw7uaCGeROv8wWt7uM/VMq7wyZDOn3r56D\nRcDFhUMhqjXQF+GG/1VpTcAOiRmDk2NZJNY5jjh6iJt7yOTt0MVQGha73MG1\nSUA0MuvIjKynH7Y3efc8SZ69yAr/sRp5fxxyC3pdqwMSnm3V4sFDOUwhLkoO\nJbcVwrQqaJSo6c4fL7phpIeobiNC2ziDG+16U1piViUmMyBLT72MQ17jByyV\noGZ8x7Gak1F3Tq6dGjP65mXn3hPt/feJcoHSMWSQtFOA7ANeRrWZU04Mz5mg\nIEO5m03aWH4MzchnOLTcc++0G2aeoiOVtlXsuD6hSFfvOstetTbrO+rmQjcg\nVOK6/uPqE6W1kp7VspC5lWC+GSPWBfphXiPmB/c5eUnECN4jfZ+RG3lqmzQN\n5sjnNHwL3nreOpukV5HiBNjF2Qhka8bA4HzMGqi6v4U/Fv/uVc7YiaEXi4MW\nHEPX+D5ZWXG1iPcuE4XA35X9LDVYnJkBhx4EOy1Eb83WW7l0wqix9sFkIZOy\nFNHv\r\n=FjGm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5cfc41b1c1bf2651c40c9d4ebbb6e73958264b6f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~configurable_dummy_token"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-5cfc41-krg3y92m_1627030518477_0.3114414774575185","host":"s3://npm-registry-packages"}},"3.0.0-feature-628ee0-krg3ygc2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-628ee0-krg3ygc2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-628ee0-krg3ygc2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"76f9e0d23e3a23200fcb536447bfd8ccc44c6036","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-628ee0-krg3ygc2.tgz","fileCount":153,"integrity":"sha512-/sppd/9AEerUQ2B/fNCfeEBoWpgz7xKxY5bDrPX+OLnHdAbMzGKyjlFuNmP/yTcP9MD/k/n4nKJTYB4vQYxqUg==","signatures":[{"sig":"MEUCIHQ9ZcKW4Wru/Fr1TnpRfRwyp8ZJwSyCjVt0FvYUt6QMAiEAyMs5fxRiuV66Q4TZnPLUwbhCNJak+/iCG4X3LLlMEng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+oQCCRA9TVsSAnZWagAAue8P/049aI4/M6WjkhJtxkuZ\nEPNHl6xuIT7UZ+Zv31UalYAhX7YlMXUAhoWISMV6Hpcr/ioVyAo2qYHvvhGb\nS82rZnc3c110CILlH2sgWL/RrEqofh1TdSxEyUo464fSCreAIyDWizv4oZcD\nydBU77HRClYL7j+9Orl8GjR1e0qyAEcKzfwNzMUajM35zKd9pAEKByYsqpRm\n5ssGJ/D488D5pvpzUq95AhbI9aEb7gH+BogUZryHeXp98LJlrtVxn5zLfxkx\nPYzKrf3FvjJj+oyieK10Tl71owOVwa1UK7pMgVbMGauSL4iD+YNNnGmVsyYC\nOTuPfEo4L7RRCuX1P9mW9OmQVVLL86F31kSHVNaK29Mqs0eU6mUVe92Sbf/t\nZicgYMBTLhLtu/BAxpDbuQDWvcgU5+n7EqGaaOPcS0ZqrPL9jAfo2/+z+Uif\nNYCyPBFvZjpRAWjG2plMLRhE9krw0+67vpwUU7oZBAtizNNfKtEt+klG5wKE\nz/AeMWc0WN7Q03FMqafsLHkSUJw8W9L/MFpXyZjhzgGCC4SHcj9CTA82VeSZ\n78ApMwWJU6pYyVEIPab8NTf//mila9rvm+dWRn74ICIWTbp70UWJRGblFJvg\nCBDs7tws8xdq4uH4ejBR31l0E3Rc+6ewV2Q3zacNHnwc4MIt1QjzVIafAdjI\n69Bi\r\n=TlGx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"628ee0c68b88ae0559c7c91c205941e0c1d9d536","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-628ee0-krg3ygc2_1627030529782_0.24759744579630927","host":"s3://npm-registry-packages"}},"3.0.0-feature-2f11a6-krg422tx":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-2f11a6-krg422tx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-2f11a6-krg422tx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"addd7c33243272aaa497c722550ce3720f9ba855","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-2f11a6-krg422tx.tgz","fileCount":148,"integrity":"sha512-zDSB0w5tIVrrLgjctkfsMTmYfIftDL8B/f0NSXHdNOnbOniawvh2B6z0vz7Ow1fom6Zm0kkZwC4xYUmrwQVQOw==","signatures":[{"sig":"MEUCIQDKrmMZ4lWZyWD5I2RqptRqJE5OQkUAOcRumkA3cLbkwAIgVFOIzf+ilmQRG+oa+xCHe9PM7sodBmvI9CXgnhMmd5E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+oSvCRA9TVsSAnZWagAAmyEP/ja2d99N+0RE5NkxVhYJ\njl0UOiS1lM4eiPmUbYViL/yAmyQqozaDsRY2awm6Qgg32aKE1jRMEaP5N/JI\nmh3vNMDqxJD7YyDgiK5c26vEPb4GKfqpvMHz0Yi7kug/C3ZYkHGTWo8yv0sM\n4lPfgVnjwTnbALOHl+/GvjdLjDXtstN9kdlV4S6UYne/rZQwKKqdx/uHdiB2\nFUDJR+b2KH7ewxoL3N6EgobxsNTrbR0LOdZiLrWiQnDbK5yfE+dobIrwSjLS\ncP4kgAgR++ULFWytTkvEfW3+s9lxsT53ZapSakjDH5cUTokE3icfXA6MV39+\n4k7l3ezm5PV8OEIyoONhQk6XTv1tHb3+AJbzLiY7qRC/ekuru9K3H9CGwjJx\ngBIICyTAW0X/LfWI7SbpRw6LpSwqq0OZNAAkUKZ2WOcQPRFCF6DYWtkrLvCD\nwvXvDsVdTxLEQTM8pwY8rZdBWiTefqXLrDuMHhjC7pftvPtWCxskRjdIxmCH\nDuw1dI7r6KeU7+4nkA4Ss2d16ZSrxW7Zg/8eK0F24SPQvGoXdle6zsfebprS\nKbV/w78sI215cBdYK4qbflVPL9cEhd9BqDcppekgitu4d0IlH/6fRdrOK4ms\n1fRV6hJtnQTAAJcyP+KwYfTvJ+aubbrJUi9IJ5wcrxe6GUSoh2WPvIBSzQcv\nZQWh\r\n=QLAN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2f11a6ffbf672b7b272dd898124c9c0d375c9ad0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~configurable_dummy_token"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-2f11a6-krg422tx_1627030702938_0.7450324297565822","host":"s3://npm-registry-packages"}},"3.0.0-feature-3bdcd0-krg427h8":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-3bdcd0-krg427h8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-3bdcd0-krg427h8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"42f8f0d0d8b79f3aa2690ff43791e4668d8d663f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-3bdcd0-krg427h8.tgz","fileCount":153,"integrity":"sha512-iSDwwQr5pJM3bymNEg8BeCBDJm+CUG6Z6zJELkHIS42l2VP12TWXlhNtCwbcy9aBSxxMOWEATGoz4AaBlFd0Pg==","signatures":[{"sig":"MEUCIBq6WBYN3tAAv91/Cv7U7ZWerNfj5F4vtss56J9SsQ/DAiEAvU9zaKsmTmBMFQwqrZDWIESqlFp11uuH5e4LZ9uLdrY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+oS4CRA9TVsSAnZWagAAjSgP/i6VajGMJpNuIIL+4Kir\nyzqzZlZXerpNyxlta3VcerRNLU++4wB0joyEyh+jk3sF6wt9+1YqqRVTbSZ3\nziMllTp/5+jrNY8NYjEVlCSAWP19UQEOfH7IrmFCRVwrw5MnXpIbyAsQ2Lur\nJjPBonr98YbFFJVcEuh9B8p5UJep5uPBTmPG7bGdX2TrUnVX1imWZIoAlUCm\nXa+k4WQD8dwnYKgAgPew79D0Vo8/aVOaYJL4vVojXFHWJqpzulaVV8mT2sZe\nkp8LtHOwT6ufyhE+q46BJdlb9kntpNrwCsfKRtcfnVly6TI2WQ8lBA4wT0Pb\nPCGP1enx3nX0+d8KaN2QsB8CUFUXMV6mzQwQ+No/5aCoCiveIwXeVXkki94f\nzHcZ1f6Qwf1GLVu1Z2xHA5LNcWLuKfKQ2yKmq4xOrEAO3aXCjkTFYopcJ1Ju\ndHQH63Xmz68YN8MTyc4NLWv4aIjoOkWSPfPzSpYtIS23RdSTNS6CkOlStxaZ\n0ksOlCUf4acPs4q4PJiWpDtsR41zdgUUUzpVPBv232du30C7dXMlaPKCI/TR\niWxmWyB4MxyoL3jF+8JAV2Xl9AXTPWWT/S/DY3NzeDLoV6/vjSd3nL4SxxkI\n0oP5JcsfTDT+TVMHmTbljZr9N4x8xSqbgSCQOv6yYqJUh63aE+45LvARXS2V\nfWKD\r\n=gFb4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3bdcd0022e055de43b5b52387c99d18183ac6363","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-3bdcd0-krg427h8_1627030712777_0.7738390055799302","host":"s3://npm-registry-packages"}},"2.3.8":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f3ee0abc957738750db44a20869873267df1114","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.8.tgz","fileCount":633,"integrity":"sha512-UgViGP9OOZmgbwjMyvAMRQNAy3nEz5/wGdIxq2s+N881R8tBO6BhSscKDrbiTeQi8s1+e+uC3fL8Wn+hBYTcuA==","signatures":[{"sig":"MEQCIAgCNkF8LBsJKNomYMEY4OmHYzFkrevKxEwC9CoKRMgpAiARmmlJTbB9Eb8Govw7wF4uLYmpplHsN+vtoOEeKfWi9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pR3CRA9TVsSAnZWagAAeAwP/3xvkhWCKzxb2pkTvUg6\n6TrDL7FTqyfaaDcwZvsWbotkXHYqennX+O/WdlDZaL6wYVyZPoblSwy7cGWR\nWmUQdcBLHwtaUKl045K5pNTxW+F+ZCqaZxpoRUbBApMlowNXxUTuC2h53BzZ\nL6LOVMEy7/ZQZ4KOFKa0+H0rqoO8Q5Rs/Vg6wiQLLm0brOdrIe7T55GuCFjl\nzRv+ZoqpIJv1mkOxfEQth0EdIy9Gxg3NP/OcPG1aNemJxr6RBtxpV2B5XMOy\nbV3M/4OmMCypD+a5qmird0OOPjm79G87v4E5Osg6Msu2ooBYvHsq5DukqzyT\nYgDEL7aVGmNXxQYHhQV9p/vEk0gTg6gwlOIH/LZfg/XKnX7psmUacBr2AJPl\nYk/zWeziofI0SgfurWSggkw8ceRlQd6/GRKyxpzNgBYZ35GS3jMj66ejO/0x\n1OZehZNjvPFEfEWLkiILZqSDlpwxMHri3rX76nzHTKMhhLdCMmA0CKq7fR9d\n5IDcOcAVL+YCUKtI2vNgNnRZ66kMj8QEdw+yHiOYUWGDtZksb9A8ugSjpspi\n9WdPUKeDbTW0fwZQqnsrIzA/wKiwaKIsBTU8U9MA/mBnahwP2H+v0kL99aUi\nC6IhzCPRdGhubAF1zM63Oc90esvPsIQnsSWZC84upg7JlZT2+B2c61EDqvvR\nDDCJ\r\n=vTjm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"fc146efe6d8ffc760d9a024c0cf91f01fe28a2fc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.8_1627034743479_0.332691910203712","host":"s3://npm-registry-packages"}},"2.3.8-hotfixes-56401b-krg6gpit":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.8-hotfixes-56401b-krg6gpit","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.8-hotfixes-56401b-krg6gpit","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b21093228c2c4eeecf7364838a5db2ec1fa5192d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.8-hotfixes-56401b-krg6gpit.tgz","fileCount":633,"integrity":"sha512-+fytqLHjhRX2zhjoXkcuRbeYS1ddFOXoGQdLKGQPlBimKQFx48FJz467mPm/kT78kW/9FezReuc1zSXsC714GA==","signatures":[{"sig":"MEQCIEPzjTsNpXdRPKhqhuHcNrDFZpA83JFS1uA7IU27yFeSAiB8WoIMEv3h8fdJc4LESKXzDwzlEMVraO9nvmC8s8WpcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":778502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pR8CRA9TVsSAnZWagAAkRIP/2P+Vc+Un6E2upHaPdYa\nCJNiyqMorSzYksOGxulMG6cUmOy83ad7czr1bmt6ZejoqsvVeLmzKB6XFpTB\nW3Jbi8cDdOHQHvOY8FyfQnYSo1XbIefoq58e4s9glDU3kETVOHYXzs0bxrAp\nzPGKn5bNr/sRsHaA0l/bHAzXaAmynD9nxu9wOkobBP1DDBwAp/Ark896N/eF\ne+9PNV4l3YZEd8kCM0fRQHrEB0QKFFflEHqoqrcZ3dym4jUXkcGAafXrP8sA\nN1sClVzUrqp7IK2pB4NSO1C5CBWTO2HZJtKaXv8vbZJtDH3OJK/TU9nHHCdw\nfSHjswRyGGV6lkSM/DCDSgyIX5DgIpN1AnC7D0f+ve1QdY723Ky2RB4l8vQc\nCSMk8S4OvImCZDNoIudBnzg3aUk3PoIwr1auOZw9XAC9THc2W5r5IfB8IQRw\nuLHBXWJzbikjVAcYveUfReVhNx6XCM9ZQN/J2bAvc8RoayKV56vfx6/AWo6N\n6yHkZ7/rmM4ohIMQ9hzkykOWEUsSdMTXozdAIUH9lZwoc5JaqhyvW7z/Kt9Z\njn/lAs2XgLD+2fXhIUpfL8HiBYYhQsniEute/f3urZsCol8SGlgusuUwRVWF\nlDYZfrCGkBOeX6jPQ7MbQ5jtv9VqF2j8aPeyt6yEVctGjkAwL3YDWG4JIT2+\nQ8xZ\r\n=RCDh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## Who should use it\n\nThis client is designed to let regular users access the `AtlasEngine`.\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` - \nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"56401b2cbc642cbc1924a71dc99a5561c6a2b327","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.0","clone":"2.1.2","moment":"^2.29.0","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","socket.io-client":"2.4.0","@atlas-engine/iam.contracts":"^2.0.0","@atlas-engine/process_model":"^2.2.6","@atlas-engine/error_provider":"^1.0.5","@atlas-engine/event_aggregator":"^2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","express":"^4.17.1","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.8-hotfixes-56401b-krg6gpit_1627034748507_0.8419574705917288","host":"s3://npm-registry-packages"}},"2.3.8-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"2.3.8-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@2.3.8-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf32276680270c0ba45162a00c0af4f96f96d364","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-2.3.8-alpha.1.tgz","fileCount":148,"integrity":"sha512-+kLJWT7qfJ8ObXZdMFjH1QQayk9kTGmKHuwk3AQjvWs0T2a42hQexDJrtQz3nzqV8YZZvqcAhRFLnnppSIyeWQ==","signatures":[{"sig":"MEUCIDFMSVeASY3OF3YXJXsTUOht+hnJOmQ8Z5m5fCBit4vmAiEA62DAjST6o8UPuLRzNLxRokQI1wR0d3dT5Hqn4LSy2s8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pSLCRA9TVsSAnZWagAAsbEP/262b9zsZb7miGkmwF2I\nDEwDULZdT3cR+mMXvOIKk3BfVuZMD1V9rEQOFaxk62AoaAoHPYpgZHBp3ia3\nzSpzax9AwXAiHqI572o20GON/8t97XBCf7x1ySMweEgnxFgV45BaUMufsB71\nQvE905BDMZIojDmV4KamZnSbrBWJ5ogS3xhsgkgfGhDzd/ke+R6jnRQ0MxKM\n3mFNnrqRjs9r5BJE+s+84JYOgC5+CJ08k1ZHlXtn2wxJg8xsNAVjlBarIBRA\nZBXI9b6HQQOow1Bvq8pz9SCjQlWnoKm1W/vVVg2uura1X3+ZA5k0iSgFpYXf\nhVuNCBZClRViVWWA4GjfDuF2d+Gn2EOIX+jF17WRlV1kPjeSzYAjf2Z0P6wL\nYtvmD3tIiZV5D9SfK/aWVqc3XSeIMEhWJVVz9MjXR2p/hbOogK6722Ki/HUE\nC99dFeuiGAjueR9dEt96ieTLqlBTi2fMnO5DJXsyVGZjgoatJOMZ70maiE6B\nhQuRLz9V1jKhrG7sbOYtWrOYrrlmGJaMqDdPzpY4xAb5vabiG4RH6t2AgACE\nmulnlh3A2KW3Po0O66FxDq5GkuWhAD+jpWKf1lT7x17KxHgQncGX965vTelS\noEH4euDekWs9idqBWkg0v8nAq6U/UuiKrxrgPlYT7A+7iUjyxhG7DPTrV4Kx\n3rPY\r\n=1OET\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"67dfd1eead5bda119b08bcab9d49d28bfbf94eed","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_2.3.8-alpha.1_1627034763220_0.4494469789296016","host":"s3://npm-registry-packages"}},"3.0.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.11","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9c1aac046dbaa62fc7e4cce962128755c994f515","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.11.tgz","fileCount":148,"integrity":"sha512-d/I5I6Vol4kl+aPiytcC0bVAIc/V3jumiuXaUa1FFdYxlsylwCaCgKifMkJFXg5lWzixtfHQT5MIKadU1l0G8A==","signatures":[{"sig":"MEQCIEnsVG3Z2ZbfJKl6X6xZp22URSaHX9lUyJfpZNtzK9bOAiAZA9W+zizM+LKuIFMPAJyqIlr3DEh5mZQa6LTLDcR5nw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pU8CRA9TVsSAnZWagAApPAP/1kn1DIqGBaJohOU8Fyd\nwNyBtTfDnXX37ww9I+HYStzefFxB3nQNSyqcjvfkWgD5TWsvz0dxiaEe4/qz\n2qkXYB91ycenoCpk6ilo62cXkq8wDktpv7L3mK6FgRY8ZHBqy31KMKWxY23s\n+3eBWVjpDcIdkSu1W28ZTfxlzygcCSw8trlbFSqqa7LE8QKDzj1BbyhZBTIo\nUykTMWDFFSPcw3SIDyjaZMqXWcZiJMsEvZdY4ZkMHA/id74TtEIsyFod+qYl\nP3+R/1VMKX8tN28gSKcLx59YvBA2S7daHqedLMeY15g0XO3cuK5HYsQr/9PN\n3tLMugIpO4tmAoGcw7OAj0y+gZXp4wKEBcqWl7qSntFBBvBvuUlkH/BjBIaU\nG0ohI+FVN7+Z6Q8Q8/m2mBN+Ur9WDmLnwN2R3uy+VhPVz7oza7RNes123/za\nYYOfzv4BNnWUdsShzEo5s8TaYheG6AgLjduaHtjF3vF/rrzSMOuiuxrzK9+T\niCxGeGWgpYBhJ8pZdC5G3OgFnxuDX5EHEKrmKbkKY3t98cOGnlf4Ocl6ulg4\npDS5SzVQfv19Ng93sYDoRNtGZw7v4eKIUE8WB2LliEqbJBlAziNIfN2riO7V\nc3PqIY8hu1EhuRKQkBG6B00tAlVP2Mauteeo0g9qP5dHjI3Lq4MAo8pkxaKb\nm4LT\r\n=RZ0V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1fed2ff77ac06cba17bb2aa23292d1f86587e6fc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.11_1627034940551_0.9716982544378605","host":"s3://npm-registry-packages"}},"3.0.0-feature-16ef0e-krg6nj80":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-16ef0e-krg6nj80","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-16ef0e-krg6nj80","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e075b076c30b8a4cf311c9f87cfea6cb56e3fab7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-16ef0e-krg6nj80.tgz","fileCount":148,"integrity":"sha512-Gr50xmSbsn+GXaDwQxfhLQd58QYC3/NF2ofqa4Rb8qPAQkaMFrygQu5FlTZN37mKGpBSy0Qce9Mdo3rBcDA0Ew==","signatures":[{"sig":"MEYCIQDYLXubhQDeppBJt5nfK86bwIni9Dqv+OAyLlzcfXaKygIhAMbOOmqAfGh2Y7swBexoQnpBnSHL0P29g3E45hYqFi5p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pWzCRA9TVsSAnZWagAAVgQP/3t6DnY+rxITbPlV7LEa\na5Zpd8ksGZVvM4Y8gQ3qasISE52/eaT/8EBd+U9eYq15aADYimrgtVefjnha\n9cAZX2DxKLzlSIA4E3LEQ+buZ3+lkWaEOgcTkLHnie3/uh2MH+wu+jM8FQs3\n/zn+kKqWCG9V/74+XrUKHdHnpyhpMTl5chUumLLb0NaBJo/C/kKLsI3U0Fae\nWayXfAQDf/vcMinS9Y1x8BRtb+m/iG/kCl8yMv9w25El6OdR//OnNb9E85KW\nG/4XsXWTFQ4xHoExUDD5ExYxg7rkOK2FMRUwU7qeAQa4GhwA9068Tl+H7Jw/\n65MOoY+yetjnC80QyqFfL50eAPlxVNAMLaH87/AGAjbKT2x8cBnyuXBpSA5M\nquE3HlKiEjUT+/MmIDmBFpvX8/f5EWCcqHldqJHAu/HNWlHKYK+PpQYv+PGL\nm9QePmgtpoUdt6rqyLHa4KdvcDyjk8YoAdOhiJNo9Jm82KI0fDQT+gk3Yhjb\niywAotvkcujCXd5WSTOMGCELbBBjodDjWvGlrtAMbArV6GtmtKrOGp5VXzqc\ntlx4z9Bg/ZSTcUmR5beaDVUBFauJj5GAWsO96iFAtQNNwl+byBET9FjXDV8x\n2qFwDqerCNxJWeIcZLYEMWd6zRf4RvdNJQIB0x1bly9mQ/J4evIbWfrWkk/v\nJ9kL\r\n=cDXP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"16ef0ea9399cd324b9df3a8e79fdedc2eee6fbb2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~configurable_dummy_token"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-16ef0e-krg6nj80_1627035058990_0.2348500339310131","host":"s3://npm-registry-packages"}},"3.0.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a59a08b30a05b2063fddfca911c06231f794db3c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-beta.4.tgz","fileCount":148,"integrity":"sha512-ebGkBNnS/N8QhPWEFhlTfnyg8zlUEf/+4NT1t9ayhcnQlAyCXjC1ChLdPmbGrscIxL1fCcEjUUy1FpXkTQFUHw==","signatures":[{"sig":"MEYCIQCj8FI9u9e2VlEKxFvEmQOEcdTOG/v0sIc3VCiOqps79QIhAMPM4Vxtk8S2ti/aPpAHW5ITD8X/1QchM48eaRjE7u8Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pZeCRA9TVsSAnZWagAAYnQQAIVtVnH+LeuZhNHNTRmb\nDalTO9DAslvogcB361Ereh2RC0wmdF8J0old9BsRa9T96fsH7IPAn4iTN3OY\n2Sv/pH5z5a8FviVafB7mnPfiXB4ItPhVZ0cognIRkmVeHnkksFC5M/65ff/U\nu08FmkMBn2CjWwJs968gvNOjyojSQI7JU7xxCOfbGmPRI1PMvUOvqnxchgUd\nbbHGOu5AayplHcmHTegV7L2CE2cE59+t0u5qdr2fTvvqJUoTRYZPJsZEZw4w\nq1/XVgst0RVgCPssa79ln1PRlyjqcA/tXLKsOseb01fcc4hQ0ObVNlZy+kpb\nAD1XkaCIVYRMX3zolPVP8JJ0uqCBNzNYyBDsFGPJwni5zbMqWMx/qtXDc6Sl\naLeV9a3j9BK0w4uie2wcRPrYPJOyVe5lxvLNV6SJ+7KfWJ/IWNjMssLqPbvV\nnMIe6QQWpFo7Hpq1/d78eDDC16pbpwJH1ZdgEIo0DuA94OuzuBT8in+SAVSk\nEl6Thf3xxCFLdSAwz6ojYm6FiO7Ba4KNdmYctkE4b8vPRU7YwDZRTMDjfnsD\n5BzAmPsY1oveSO35USc7NfhF+blQPwvkkqukuh9qgLkszFlB3iWw7xB2nnZw\nn4ltflxS853puAneezGjDTT184zt5zVf2e6+8iXlyU27Bx5UqrvOJednCGHq\ny/Rv\r\n=XPBY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f1889ccd566244c57123c1362982d28ae7606c11","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-beta.4_1627035229891_0.2771838224316159","host":"s3://npm-registry-packages"}},"3.0.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.12","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8ab636a9fe12de1439c3739230d71f07fe6877c7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.12.tgz","fileCount":148,"integrity":"sha512-m6l7Qky1TjzW0wWnSRJiL2Qz6g7644Iq2Jm06RlJjm/fnn68Qx80VOYI36M/6pdZ388mP7JTd0QQG1d2haYb1w==","signatures":[{"sig":"MEUCIEGluhGtdScVuC48CeiU7Y6od8zQGjXwZqKuyLJcbsksAiEAydh54UYIQ43HWkMW4kpEAZIhRZpYugv2vxe8vQv/66I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pZrCRA9TVsSAnZWagAAwsgP/3BO1UhudVVbrPtal+we\naLQ1QIB+38+KC++1UtX7hioI3xSB7uSpYr/bdlLlTkG0WaiWpGTZZXzE+k1S\n2EC03QwhK8QDv1rEndvpATzimRRoZ5+BYZEaWaNGBtBmV9s3Du2aXCzCnram\nUdwwJCeRIkrt4CgKGnRpJopghbNJ0S4R3vWFNnGanEv8LyTfJGm76fYYx2Iq\nCpSY0aV3QhOjuVt5cCHBwinXQpg2oEYsf2vqvX3rJ4s0J0sR/EHx7FWrnfdH\ndj1OBAVr8MIx6BWx5wC7LCc177e2EZKvIsk2Os/XI0mwcrVaN1bodafuQDLM\n7pcaq4KEnbnkT9WbL3U4LZ7xU+VJ3OhpjfC1hTwzIkKSta6pwwBZHL1fq1cl\n00bO/8THV/3q1wuXD2Y3ZyparYpmcPNLoVgjNQqLuG7R84a1c8v+1dQYlsFi\nr132dfw2kNwwjtwpBg19eWr2cW7GTnXZCjr7vS3nqqFr1qbzu4afxti7pZa3\nPbGliWQ0bLTjzSJMiPTxX/7su0vRNPjKsz5p2SCkl+4+K9H7nehXDff6A1lb\nmz7TGJJYSjBEvid8tKMk9SnVL1jPfbmWcxd8ryqfoMQ+xgRh3Erh99s1r2kO\nR4f2nvI4odx9hpzgTR7NxsCHeF21Zc+k29bdyGDgfNYFZjhb7tRSmk1fWapz\nIgdk\r\n=6/MH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"618376008738f394f378018252f0af9fb9b0807c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.12_1627035243591_0.9213391270004996","host":"s3://npm-registry-packages"}},"3.0.0-feature-845c9c-krg6stkt":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-845c9c-krg6stkt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-845c9c-krg6stkt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dc5d88e28f516e62c90aad27363ec5942e3df991","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-845c9c-krg6stkt.tgz","fileCount":153,"integrity":"sha512-7lhn3cjvhngY7LycAF9gDg1MxXg48EL8hB3M/tfknXpx4Yl+fCzz2s7Vc+fR4Wk7OOjmsUQNAs6G3GgVfFP3JQ==","signatures":[{"sig":"MEQCIEuc/WnLfiqYZu0eVkvQebayBEMFO9vtdVhYOhM5OQ3RAiBJov2C6BpqbfBIZYUtCBvlF2mAcj7aWW+axjPpY1rSJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+papCRA9TVsSAnZWagAAtJ4P/1W/fT9MDjtT90r/obt7\n1ilcXXQKqZDbry6VgPdxwx0C4bz4GAa2lR8j/qSism4eMHuWLMevmVavp8Im\n7gQSAxzBkRs8ouTB4qfpf60iFhm2m+EPUpbZ4M+LGDMydsvJ4mK2V5NvcvzC\naF3tDoSD2lxbbz1gjefP7/3vr3b9yHl/0PRdO7Yn1Kr0mMafXflsWtFkM6YI\nmhqcjpxHyVPzsylWHn7DnNSxJjv4ldnb3hIKnN4M+Gp5BGLZNns99OC0LqUn\n/VAgZUpGzMNGt8Rmrulyz9bJP/nJPUcKMi2VlB+Rkc7Kw4MqBHaXZJIeVAPJ\nObwSvOCs/EvhMcGcLXaKj1bahKXPNSZQnZHiZeIr8omSTZjCugWSUQJ7CSPD\nZ/doTBUVIf8mXT7jrEBkO3g6JS8pqcdlxUGlSVB1sHK0AwnAXZ6c1MJYJIHy\n2sE/qWocIzfPlnStt7cYOr4/TOpfUcANbz6ADpSeXQz5jqdGIByiH6eUjpA4\ns5AVbThNKpR/vLsQ5Cv8uWLB6E4+djVgeuyZUpwoxXhXGZ5sl/5G0b1ieZ3K\nMR4Ansiw9qzDePZNhLSyeHzs7B21/hLPIgcGC5rU3FyVh/8VW8zFDt4UjOUS\numPiQcvRMJlJH0mzKMfN4o3uB/nIzgnhPe+0dY/Ohc3/hQipCNentQY5pKoj\nlzwD\r\n=9O1r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"845c9ccb89620fffd06699ec9240cad1266b1827","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-845c9c-krg6stkt_1627035305552_0.9249122128688898","host":"s3://npm-registry-packages"}},"3.0.0-feature-0d34a4-krg6t9s6":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-0d34a4-krg6t9s6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-0d34a4-krg6t9s6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a36a4d4192dffef7c355691c3d1245b99cb1c4c5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-0d34a4-krg6t9s6.tgz","fileCount":148,"integrity":"sha512-DxLOqsYNIZGfYnB1Oej3x4a6aclRYRFHzlen1QbEq/T6dzdPAnNc20KCazdpWmg6AUUs1Mh3Bahtjwu5AQuGkw==","signatures":[{"sig":"MEQCIGCx9riaux7fqkuzFKcEQBM0rAjNeFH+Aigzdkn+EqLRAiAGE75D5WTPEQAsc6Jd7LBkFXV1ZHA+sEl0aoVdy2hu5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+pa+CRA9TVsSAnZWagAAhY4P/jJzfTBLRIYqNyRa40ID\n5Uf7wNvGfro4hZFPWgquPbJci1oGbAxk3b40KgEUtB6NE4BfEkyZ6Jxs6teZ\nLdFTjhFqkWBNraf0YXpVoSwuWQbLht5vh+k4V6kK0r2nIhABmJheFw5mycBT\n1ePVfeu50Zqix8EvWzgpZ4QDZXgnwrlnB9hzSwKLBjXCs3L2fdYpJsNa4vN7\nIhyQoSIKNUIlQX2l4+QbQaUBJuoUib+sCy2lgLLO9bQhCR7rmGNlfLQTwKnV\nqHlN9dbq7NjmX38x3r4sUakTqNOtUf/ihp5yfVYtWiW6qG2csYG3EshUfbK6\nYTGCNshI5DRtRyFPEEpm48hHLKiJh+xyX3UANqjfmoPT9OZ+NJSDqNOEm6pN\n1ORaJXicZgZuGX61xtJ0hTIWrzBeP1UJHwwu+VkSzeHlVkLCwSctfYeMivtR\nZ2ulNXJg1HdMCGWnatQV8KWz6Fm9w9kZZL0sYfzaVisoF4G06cgj0VzE3azi\nod/yMPkE2wMoMogA1h30ff9z0iK6zZurXURVWwSr4jn34tKVzJiteMCCJHR2\nYso4KV4wQdS47H3J/If+1g6mtXG08Hi5PR1aWmjoMN4ae+ZiyE3aKmpaPllJ\nQdRGhYf8Bb68cTIf7Y1hy06xNLp6U6KxYsAiegmGG291bP8AXQcNwM84l0rP\nmf26\r\n=S0+l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0d34a4c316ef70a31e2500b10760c9c13b8da78a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~configurable_dummy_token"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-0d34a4-krg6t9s6_1627035326676_0.8075274095884788","host":"s3://npm-registry-packages"}},"3.0.0-feature-aa9697-krgar090":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-aa9697-krgar090","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-aa9697-krgar090","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"88a058f0b134ac3462256b8aebe053cf228ba237","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-aa9697-krgar090.tgz","fileCount":148,"integrity":"sha512-om/wFtVF+Oqr6Zq8BPXgFJpyfFzxxF2+z/SvsIupQohpmIqBlUWbb+zkwM2LX3KdYFbRUSD1KgSPIVRH/QYT7w==","signatures":[{"sig":"MEYCIQCp6bHRvNA/dVQ7RIAJ1/dkjQPkX784whL8yxxhOPJC0gIhAKm3nez0q4zezT4UlxL6GKFkQoEpR0jenrCv8/MXvlq9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+rCTCRA9TVsSAnZWagAAz+AQAID4d/Ta6VkJnwNaa9RW\nfsnywYelPlvAg0O3Gbw4eezC4ZppRTyO49HBD/SjnW3KWzVSD6q0N8uDYchU\nLJpIVUep/OzNwqxk53bHL31A6Mqa0HB5vddTADeJwFWgOMdHcACuOVljoAyF\niIWUwPFhKLd2bFb5kmbr/lU5sBQuHPiUZdtT4a3ujqEZJklvVSJwMvH8QtQk\nI6RgI+EJDGdRT6DdZ2hMGbdRyh2cYZ4bgx2mwRXsgefMYRfr6mTD1NfVLMhY\nCz9X6gmhnSUfD+0s+1zXsY060RfdnGHyV2Uft6XtOmysPtjS5LUGLmC3PQGh\nf4RyWD+T77f5JNV03cYjgGMtkd8xRSXchEG9mLM/QNXq7o7ADoLpIdUfBDlA\nw0YTr8Xh4qHWhFTIMF1EX1quZ5FuBQyUj/33LOVQ2HrkQrqF21TEiHLIjI13\nTpsYWN23/durcXaJ6Ys+dwNnC8vmeneRTrTL3bflOJUYbermpHySWqgTIGGB\n0/84st2mPaO1bfaL2TGotz8zkKPDmM3iF7N8lzLFa9AOs1HWq0EgPLjX1mi/\njLkPq6Wop06osd7gRyGMGkaZkKAeEG5R8516TW0aZ6jr3fbpGMNSNel5NTmZ\n3AUdkTwCB/yORcBe8o5ab4ldB1uNNo4M4mtj2IXC8nYk2R9gKkv/O6wm0lP6\nAApX\r\n=gGat\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aa96976da415bd8c8fe888eae6282821732f1945","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-aa9697-krgar090_1627041939213_0.626875738320956","host":"s3://npm-registry-packages"}},"3.0.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.13","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e6313e0a0efe887a148d0134e69f638de822a385","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.13.tgz","fileCount":148,"integrity":"sha512-qhQDMyMQSytnuryDhxUCVwBcf62xTxMvr49dKeg1Ag/WpG9ISiGYp2i5qEO/oP9pY9647uK2Pqzd508Qvu+jaQ==","signatures":[{"sig":"MEQCIEj4Xgl0u0mAbyUHPZAU2Qc6FNtksDllEvuVss3zH2P3AiBGWmvumxYaH2vNWeaGSSya/3lss63gn6SqHakjCSQF+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+rFZCRA9TVsSAnZWagAAINEQAIbi8injd5v2DTyFG15E\nMs3Q4xarBbljxyvFDkinisdoRXINEuqit2L58cAmmq3J8dnq+xBhDy3BdmKB\nZlDqv/SKGjrRvApypTEz2WBpQXSS+SemTBzqIQ+f2IVylCWbfaxT6tFIH5tu\nKriRXGbE9n+PzQscYe92myES+yXDLmUH5hdQ7sJCEMAZy64aaEB/ZzDdJqIb\nEa1wCe9zaghCHKk7XqSsS6ig0lg0lxbIjyUo22EPSONPnvKq9jJ90sK/INTy\nStJKzFY3MDKV1MGlb0ZdArkuO6vmz/XxzHxDwsfNjKvBtr/Vmqc9dOGyuTiA\nZT3lApyPXfNZDEiDOiXbaWsAE7atbN10UQAO9HSoCKys7Sps0ISG+YxhcWST\nMQqFa700n3aRH6Mqe2IiDpfNGffHBHKmIMVHzgAraCao6SeKqB65uyhYNkyz\n3+VJqP8FQYlGFoq+nOj0poNAOpS/NG2o4crgdNtkAaLHvKIJRTyRYSP5TfvM\nSaJbKRVX4zr3b1yrblWZqjUSM6dzr848JwR1NWv8zyXGZV2baLpfpWGCGGwn\neF8Ti7RtU9mpTJih4IisrbMrVoL9ycT/HRdLrafPf0m1qSENSjN7HJs788G4\nK2tbAf/Hx2oKljVQfz9T+qsk0mBcH7JtvlHAMWRJU1wVoF+onfTeMLb7a6h1\n3Ke2\r\n=vCUD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e6791d40580301ad680749109c1e517e04c2e446","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.13_1627042137616_0.5841310851354073","host":"s3://npm-registry-packages"}},"3.0.0-feature-c46bb0-krgaz3lq":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-c46bb0-krgaz3lq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-c46bb0-krgaz3lq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c4483ff5abf9a3505ef396beda4e00e338ab8473","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-c46bb0-krgaz3lq.tgz","fileCount":153,"integrity":"sha512-qIqdPJj2eKK+C1KIaNU0N3h/0GL2x6ia9XiD6OSr7A6QxfThq2i/F2CN0nj0lINi0Oga3uapxQvdZ+j6uIVf3w==","signatures":[{"sig":"MEQCIHRfjd5w3GZ2n6a7dEzntdXgFkKmaJFupg4WwelIel9WAiBv13+ctLT3amigv5EH8ntWEt9tmCSMQ0GXb8uI98f1Dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+rIMCRA9TVsSAnZWagAAcX0P/1m9FWwtem4TfU4WjEFE\nt5PtCA4mAZ37Om494o2T7SXRH1oJA6f/DRjRpeYyQDqaHObOTQPeTg5Ym0M0\nlQHTlG3daBKMPXEA40yXtxc9kp+mI9g6rfDtvJ9xkyGlH6c9Pd/tpEZY3q3u\nWArL1XJyOO4ODdja/iNvBntFyo5IU/acd8hUtKIV3O1kzd8wJMi/JCBJWKHn\natGiu1mcs8N7HsFTmvjxiz48/7jJ1GmNVJy7MfgzSoNuAzpnPC1WsA+jRCWs\n3spqgtHNOQxPatzsZPV2FMtfXA4ki+ogJphcJG0QMgWzwgje+I3F94OaB8Id\nStNbWgaKhijBNQJTBEb8JtAbvzGXolZjJEQNI2o6EmMf3Bk5TtY85MCI2Yq4\nWWGQ2lBSDdU1JquaRgwbT23THbE9F8ZFmK7qRUvnV6dJpxaJxg2n6nitFj7/\nLJ+tU6nzVIcoRBUDke78zX+wf+xbz3qbDDmVc+mLu/moSJM02Kusa3w4oo4T\nzhq39X13jfIhBy085r2HDuZB7auPnbRUrq/PmH0igo3LpfA1EINMp8q/LguT\n5hnLLKAI6MlZvM09iSirfnsHr5LEqV7SwT6ZbfSKkJkx/nF0K269I6iNHj0k\nyj23JiK+R2N6KWzYsbTXgOiqTKx8NnuIx2yTXaxTV/7dnUvlcwBQKKDo0nK4\nTeHH\r\n=FYZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c46bb057e70f1e76e106683dc5b2346e56af17dd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-c46bb0-krgaz3lq_1627042316786_0.13471918076285272","host":"s3://npm-registry-packages"}},"3.0.0-feature-82d41e-krkpr5ek":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-82d41e-krkpr5ek","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-82d41e-krkpr5ek","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3bfb939360d709f6754c701937287103d8d8c378","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-82d41e-krkpr5ek.tgz","fileCount":153,"integrity":"sha512-iK4plmcIyOydqzVK1Utv2RRv/7A2kO5VBX7cuXk5mDJ49TksmRhZSvn/ycKqaHb60IjMbROROQBRILSZBhEdrQ==","signatures":[{"sig":"MEYCIQCZSHCEQLF9zqbNGoVfd/8NbBdApc/JVDlO5RLoMC+H5QIhAORbkZaljhMKP5pzpDHi7UzWmudaDMquJX0ghl6RcS8p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":439322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/sPSCRA9TVsSAnZWagAA/8MP/2ny4chJoVRrFbGBBNeA\n4LJJ3lZgafaBfq5a1XSvPSn7TUxSzQXt3/PO1jxmIFgGuk2JZGcjmeexjzRn\noCHw78TwsA+vuYf2r+3Z3uf7gqdle1EGYF8+De0/RFV+k/YxYVVG6+1GFwli\nQo7BlvIs6vsHJbqinC90kcSF2EWHCv+E0+OJpQIsyEBdSnl3O7iwbGstC5xo\nGHsueI6tyhmIiAohIsqMe9+rFUFiNn81F0SN0ozOxJBD2mUxpz5ern9td0hE\nZhpZRl7vOVyMW49KRIRlMfCTCPfjl+jj52r5kJph5tNUae8z2hx7eLBkc04f\nPbYpqqnTyaFEZwsy/fSMdYj+yDTvxBuXkE5yneQUXN9e53NM4sE2PgOId9IO\nHI9Pt72dPf8hFp0emEQwRjwzCqqyQxVO4Ymp9Y/7//KUbyHApJxiOQtfWBeO\nUETvXCnK6vVx/7TUauA0zHQXoOo1dhCCOUgnRmuHAEqj7JKsyGbxJd3R20BW\n5x+BBu6z/+7AWLX3yst3aoBgoxtD4IrcIlfM1TaXupPd6+/owlP7kBovwBWB\nOp0IUWnem4Ix7mVErBLbmjqvSr4pXilWnNiJ8AmSOzsUga1Y36idpCmAu9yN\neecq4AYekHuliI/rlDOtIYuu6MhBhxC6fyMSNPgQQzxQpOEn8iJSndabmbG8\n9k6O\r\n=5Xpg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"82d41e64c9f2207a4d9f12aa32f8e9a0a00a6107","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-82d41e-krkpr5ek_1627309010314_0.8154842678977787","host":"s3://npm-registry-packages"}},"3.0.0-feature-9a5f47-krkqvt86":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-9a5f47-krkqvt86","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-9a5f47-krkqvt86","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ee4057e467a54fabfc1adcae8336a927e93c37c3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-9a5f47-krkqvt86.tgz","fileCount":153,"integrity":"sha512-aFTm0g7daAWdK2b/MFJPku8DQWOLl7EAT2YN584weBxZWQ4x1xC9a5pYFXHTru2ewEgVQjXG2k2qpR6VS4CkQw==","signatures":[{"sig":"MEUCIEZucE+Me4eQwQoQ4Erx6toWZB2O3Y/iqpPWW88e6ikLAiEA90WlpQglqDGEa5FqN48Rol2U5V5EaDfC+EdU0G4r2tI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":439482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/ss4CRA9TVsSAnZWagAAFrEP+gJRm6I+G4FNwBlsieBv\nPSRVGIaNrztrFSQx9SP8MOzw9ENjCIyJBCllZiOwvYzOActSkF2n+cbJZzQK\nS8fme0TYGACnx5YoGSILOYxESbbufdMndSDD6iWxfL2+gmiQafsO/XTS2h3O\nXx2cjurVt+zCL9ADJMXdlxxMr/dIHIziVv8E46AvzjQBpVECKRHK+tHViAeY\nEVNfHUNP/Wck3nL0zsc0EO8PB5Svx5c5u25G2S7rHyLOmtuij3QQ1SGo4u0Q\nyU0u9YbQYMgCyg15yBgjUhGUCP66pJUs844nj+VQdnrZIJhRMRrn1YFwLVP3\no/++F1WOfQ5tP8gYY08nhm3KEecX3Da7qw94ZHpfx0zAlVd2TkIQmejJnR4b\nJdl3WJFKgJiHWebVTC8NlO8/6pSmltQsorq/rkdla7AbrD2NHB//PVYOxP9J\ngwuBuakIYpy0ADTYGHosKIgc/2n1wKlVyPPGRJ/Klb7HWqjH6y5T6y1GifsP\nhlMPqvn2f9XHDDJlKj3lYXahGsKJaltXcsphg60Uxay/f7EThmFzBTWTiwUU\nTti6kYAuzmLfqvec1+HjYTPoPuzDgwAFMRIboK1gcLeBv6qzHaDaAn0zTKLI\n+eAFwJeV5oQjTHlWgwVqJW67gkBIMgRSW9D5VFXR3bC6V8m34XCbFhtaI1oR\nMJaR\r\n=yMlh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9a5f47933302920391688c752da1d5665cf1ac63","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-9a5f47-krkqvt86_1627310904658_0.33624106239654683","host":"s3://npm-registry-packages"}},"3.0.0-feature-af91db-krlswxxk":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-af91db-krlswxxk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-af91db-krlswxxk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4295e6b93452e8410da8592d576625cae1e856e1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-af91db-krlswxxk.tgz","fileCount":153,"integrity":"sha512-ct7bsOkxO/TNc9/U9sXoWrTWUaahAvq4+SOOMA4qyk1TuXHME/UG1c5sFoJev+i+d96E2w8k3p8PyHhioVCikw==","signatures":[{"sig":"MEYCIQDtwCy2qn1Bud/qJyhXP+wbNhWW63lvLzuULlsUiCuFXgIhAI/2hdKnObV0In8s5y4IEIzWLRbPimUf2ciqAFOfwXVP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/8S+CRA9TVsSAnZWagAA5QMP/jddygUbMxS75Dlh4iDV\ng+1xiC/Ry6MbAK+7x19vp+/TuzKFRUvu/2kYLuxTeFfw6Gt833Wos6hEJ0RL\nGYl6B6zvB15fHBXQKvURHBgD1y1hHRbG6yAR25/VNsC3NVxrSkJoUDPuI9y1\nnxAUU0AZpRdsDe1ILL9vyfMYvaMYFO7aKgSrBvt9BfG/tXxDX4+ZG5beB9Yp\nn3zdkPdVTtNli3Rt400p+DHsA8PR5OTbsLQnJ2DqOMekBaJ9twHYJmbmPvtX\nu36GYeEPctV3rlmZcfdOwqS2PRp+bxcfyjMyhlU/3TWOiWqq2LXlyvG4n4Uu\nBx+HW/KwAn63ri82xyNR5Un82s1n3TY4Jm2rRO2zj6WD3kS8ssFgLITwRHnt\nQplR4tdNGt06wNpyRLYW7S7DlyKRY9Q1PE96tLKEd5aW+9l34FI2ji9/GWaH\nrj6Qgm4Ncfsowl9oNsSmFwF5/DzqCngOzJdqvN2BITvhfhhnjDAhe1gY1VML\nFOUMm2YbUP4a+pFutpMN7mXWRz+Q48We0cJ/3WLUkeuowzwfWwWcT1qOPRlO\nXkkyBCJHTxDSvS72pxrOGds1m+H++HJ7luAI0zjVbyuinlf1kXBrXf8T/P2Y\nXEiyvYLRCo7BH2ZVhytZlQXesSh3SR0C6RhCPlhi2Gj+XfXaJdn+HESBAE2d\nT7EL\r\n=N2z+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"af91db416084225d8ac15e5867f296bbc2acbf8c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-af91db-krlswxxk_1627374782760_0.8621894484521626","host":"s3://npm-registry-packages"}},"3.0.0-feature-2d1dbc-krlzlp3k":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-2d1dbc-krlzlp3k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-2d1dbc-krlzlp3k","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"af2534f1e8158781c376f41fc75fd0b27d959988","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-2d1dbc-krlzlp3k.tgz","fileCount":153,"integrity":"sha512-X9DTAUgQdMjCWlwnq/5g6awhQa1fVKp/VGTPqQp9MAn2SzWJAmW/UTmFxOJx/KHeqS6wsbchKhI4h2sOvT/70g==","signatures":[{"sig":"MEQCIA1BQmlsKpndy+Kf+ufF2qIRBQop6OU1EgEGDeEpavY2AiAn03v8mZY0rmyLwsan1cHr59QfIV2Fkt1d7C/wGKU/MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":439482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg//CdCRA9TVsSAnZWagAAoRUP+wT0RCDpimcidf/NTNkz\nH1XVLrBp3XMgl1G+V0kHeqcNAYQWz/u0LH/B22ZsKHSu5LQE5gm6/oX49tZe\nwCz8kPgvxkL1zQM/IjN7GeF1SUK3mppbdPLiJDoan+vTLhbOFjhCEes4Tm+d\nhb65r5RJi4nGBampkfCN84xfLsDPwKAbkZhFCG4R7KRGUdGNjpRRUJ90SCBY\n3yWNINIwbuZjjYCq6jMSFcQklfG1Q+3il1SQaT4Xh9MIJU0cQZMHtbzOn47a\nBcunn6tqKBny+sFcN1npMr7zuVm9PpwdoL71+oU4B5jkGbguQPyjACd8jj64\nVQoAZ2G33Znui7nXpxYKIhBksGG7uc1in9wAwrlOSY6lpWN/D/WpV56QF8pE\nK5LqQFqi7Zdly5zgmtWQDZAqx0kuS8H1BQgqYuVyWyTcqbv64tYicp83Cgjr\na3rOG9R2LdbDR1QlxciiSh965Xgl1PgulrgolC8PddVpnVp4ca1AHKzLgzm4\nhCQNjzUJFNeIrdHMgAgWATkMKVdOcdUQKRUcu8QdRhPmbmdMUFSSwA2nkwAB\nyQb8daaQ+dqUKFWNf2Wm4eXTA44ooY/dxG0asPOfkuuqbZBqm1GDtH1dtrdP\n7uSEpgklT0lWWpEwFxPCFSZ8jHzRbKnuF38Ma1zrY69ekEVcAA6M09GAWuiG\nxKB+\r\n=ZXNY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2d1dbcbb9f837772a7dd88e5be3a1b6a073ecb38","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-2d1dbc-krlzlp3k_1627386013314_0.29415393383223476","host":"s3://npm-registry-packages"}},"3.0.0-feature-c565bc-krm3ptce":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-c565bc-krm3ptce","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-c565bc-krm3ptce","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7f6a0f0efa5a8c2566561ea32192ac6d3ba39dd5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-c565bc-krm3ptce.tgz","fileCount":148,"integrity":"sha512-El87tiqqNo2d9v9kZ6sK6v7umnHUhQFEnxzmCdkzXXdIRhtWe/ju02rIZpccKcdwAxRekBuc0HrqPT2Z1R31xA==","signatures":[{"sig":"MEUCIQCOnZwH267fyzRg4mgb63VtiYq2ZNTlqLJ+aPaglasIdAIgOgh5qu7E2CiuUWOeMZNAioJjU4EyxGq2UFa8AU/mmrg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAAucCRA9TVsSAnZWagAAGvwP/i5EuqSx1Ci4XtImwdO0\nV2JIWdybZjRA0QRBCrxCpUMHVSjvq0daNKxH4gzlogdZJX+ax2lFersLcnxt\nnUH0e+FOp9jxSlvfGuzi5uqYjU97ijrt5NHbpMQz+6YjJ4cvuB39FI5pk5Lr\nTo+GIuA/nOkeawh8rt0A69U1VOtEbGFfwHH2WKKQ5ZHc9n1+kkOE6uUeGuWT\nxCEItbXwPJCHyIRJmttb2DzUE4KNtt/7Szkn/fNEcDoac3P8tDTWwVs2RiBD\nw2Q/zTG4tCqFGlbYiYzWYLvbdvqACPcjTpcv7Xk/UPBCrKMuS0Z0vPqynw4n\nMZBscAjkyiBTaxnLDyN9u8D6mO2We7ds6iPmEiTzm2WmMHlFIfcIPwNrU3su\njhGd3nCjO97ucciiVwkBzfkoG43G+Y9hXJvSrgWLVsC+KGfSSJChRHUfIDK3\nx07nXiOKQMVS/SfH0VCh/e9abFa8BV7WE14ygyn6j7m1BFEBooPWjAQb0H28\nmOZsMo66FntAuLLUwT1S0dAHzTN2ZwPkfDPG8jOVSVhBvJViEZZIIUHDi+EW\nuweRDWmCNB+t5tTRniYYm0Xs8MEuusF8o0dpl+RdiPinzgZ/Tb9d36MzpCPy\nCtgzT41VHjf1iwXvquuO4kDWW2h9zFYUUs0C4crWLM8Tiiuo4AWFI2UMjZTw\now+a\r\n=KFqr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c565bca39c7ea0dd9ff6fa7cb7eae2be6f06f0a1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_startedByRootAccessToken_flag_for_process_instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-c565bc-krm3ptce_1627392924220_0.8439388432050248","host":"s3://npm-registry-packages"}},"3.0.0-feature-51f0ac-krm64alc":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-51f0ac-krm64alc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-51f0ac-krm64alc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"24aa780b3479a25053ca7d5465163e42b3e3e561","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-51f0ac-krm64alc.tgz","fileCount":148,"integrity":"sha512-BR9YufkhEiLTbX5OfoaKI/BTxHi9cq2fN4rvrJwEffdIrjVX8ecpRMKVHOOPmPEbNLGgCBPHByeu0uDWgqiOnQ==","signatures":[{"sig":"MEUCIQD3b1k83jSLMDSKkHn2UjbK33ThhwLyNTwnRWULqpugbwIgcFz5D5vwFjPnZjlc+ueSZiEKqUoSlN0HI4wZ5kRCCkE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhABteCRA9TVsSAnZWagAAC6gP/j2UNt5gwx1STqSotN0M\n+44Rj2pwHcR+gULgu4zkq8y35XVPWiY+yzWY6CQkMYiPd7+0SKunTrtWHA99\nI3EiltRczAFuz7i5VcHaeZunS1mlC7/MuWWRjgmaaXIOB7if5X+PALq0XM7C\n83ylsMu0X4zEmCFHlyybrecL5GBncO91a8f5AQflK/1Ln4ANCadzCLvtnQDT\ncrm0E80+B7iGt1nYc5GpJMKIOkkt5zwAPcTGu6m//JYTMw6siqFnpGSesYpc\nU57XLu3whfMGmXOFtCRFd2zqdBg1vyy9At92YzHaIjKVYLuI5vmCqXm/TxAU\nE1AHuS9F12K/p+dGa9TeoYQbupvyXv1fmAC5L5DHy5lChKt3IJbquRBW0p8r\ntc+7ggliMurBlq5AXQ9pJXUaOBOGj6XC7GGiZ5YJVocxd3ClTu6sMrXOYuRi\nvCKDCCFROBe9bN5JORmw2CsLB9t9mgZupJauYEaNDHc2PGxqqTMofnOwa+9x\ndx5x6T7aZU1MO8tCBBl0DCXH6YLJWoyUZsboos13hnL6Z8jirjkAqnYp2c6J\nMgtSUD+f4ENL7ZUz9p5J77tMVxxPVw45mJq33+bkZdIxfdD4ysN0bOO2YUQ2\nVuWh+lAc+hbv7OD88QwsrrVEJFKNRm8UmIlO6BMNZf6eb3kkGdwQMHs68fbn\nAbMu\r\n=f0o7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"51f0ac146e01015757413a677786bde5d4414f01","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_startedByRootAccessToken_flag_for_process_instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-51f0ac-krm64alc_1627396958637_0.09789924979690645","host":"s3://npm-registry-packages"}},"3.0.0-feature-c3ca8e-krm7550d":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-c3ca8e-krm7550d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-c3ca8e-krm7550d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8fd6b05278d28609f70b61c87c57a4bf5388846b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-c3ca8e-krm7550d.tgz","fileCount":148,"integrity":"sha512-/Et5VErWQstXctfg2ttSoiX8cf6RaPznyKrL/5J4UEAhgkthxOxLTpbnOkXiZdQjmJ3MNXlYtDoDLHYtpcPzDA==","signatures":[{"sig":"MEQCIDC7x0yvODRtKlBFMjnr44uc/RHB6mULi3ANRJXM7gizAiBLVWL1A5NRNsycXEp7RmteOHBt1YwLvkjZqr1MgosH9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhACIVCRA9TVsSAnZWagAAa6IP/0T8OBOdTmA/bNEKkHN+\nYR3kTCrEwtBF2pkj5guBTxw7SlLfDcQvFxlayp9VmuL/nGthnEd6TBJT+bkB\nnjAuXDtMmoQ0RJmI06+1LlSitUT+43/FHeLmFXHfYGUc10+y5wrUAMpVRAXu\n7XW4MOnScTuO4eXMoPPbKPfeyaV2xJfHNP9RjMq+FudpFFgohGoJ3oC3tlbw\n+U18AX00BjGdk4xXvUzoG/Tn730vwd6QDL2VlZQtiEyJ954mYy0KtiiZzPIs\neu427WTlXVVYqIBbEVCtYlhSQ7ugzPA15iZ2v+P5ZeCIt7JMQAIRDIC1auej\n3ZYlRQlHq8DHss8UX0KSpN/FlcYTK2qf+E5q4TsGlziZmL+2+HKq1WhXtSDg\ngiXG/F4opyEDYd0UWgkRoVIPXi7vvAdg1wL9Cz+do8NW0YHW+LiknOV9PRc1\nVXZaZ38/n/lLlGhOV1JcLcXRciS+0jfH8vrMh7eg/n6/oEr9owKA5+Sl7ytL\n6hmzzQohf2OiWqW7KCVpctBVN87gDfT6w4lUAPiavUrYdwBPUtLxV84du2xn\nwlxpIqkiFZLSEfLatkDkGlpRIL0O5/BGQtrCu981xUpG8a8epOxitzRlWtRS\n3bVVm5dqJ8KtBc2iNO2jkIDr9SO8HUd/l3Mi+6JDAEAmQmvxhlfq1wJB5NFm\nl4Z8\r\n=7AA9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c3ca8e0946a3c6113a03c660ff492106666d22d3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_startedByRootAccessToken_flag_for_process_instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-c3ca8e-krm7550d_1627398677657_0.3523419816222937","host":"s3://npm-registry-packages"}},"3.0.0-feature-930014-krowp856":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-930014-krowp856","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-930014-krowp856","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e1e86c37fa7a0ed23c1e809d88e64afc8d101bd8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-930014-krowp856.tgz","fileCount":148,"integrity":"sha512-9MBKQFozQCA3HBEpHN6dQMznCBBdg0EdfnwhM+52KmovPF3sDVO5tUBK78O7QbpRM3P61MuDeJw5Mtx6qOeLow==","signatures":[{"sig":"MEUCIH2HkpO0v/zR0S9eQ+/0R6/s5v+15vjI0PzT++ysyEhhAiEAoVW4VKVPNwwKqsC69yKWEGSiLOYxjeFB0ZBmzPV4LD0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAqInCRA9TVsSAnZWagAA8PsP/iGOEFkhFf6MDMZ0wZd4\nQiO3SqNj/dpOGWXbjL5UyuerWmAre2lylfhzQwGfVofIFoIG0lJMeP0pzoyF\nIO6HbwksLEzl9AJDe+VJeuUPuCxzSsVKEecputU65gw548RwaCJgpEW2gwef\nco4cIMs1PU60O5KaMaocwGgEMP2amLBjgO8v7jF/m6GZ11xiTNMXKc+eLmrh\nj8CuKIU7ZSKuwHggICxz0dtzR9LmfwE7dqSAjHJgKSy4JqrzRSVcXn9uqq4H\n4wWSBPPnNCkhISDguSZbpZDV9AsgUkAVauEhW3ZJnrVTHOWHDeS1QtXoLsr2\nSEkN9RkaYF41olwGAILK9LzVkpCOsFuZ00nBAeeCua4WZLNGbbYR76XAddvF\nPYUSvrIblXt6Wchux2Y88kZiXjEcsB73kDAOUiJt88oX3FLv8VfsZzeImuZv\n0u754i9pjnBMFOlODuwwNAJh3w0Z/9Ld1OhYnOzvHQ6AK5dG1RMe3z7w+1KP\ngdX/6S6TpVKipUNbqWKoopSP5dVYOmdLFq1lNxCU0VoiGFourAsWuMaE4IwZ\nCSIVSZCIojMxomUTni3DDOvWkfHNOg7d52jYMgByN0pCbMFl3HMl6UXj4HQw\nHW4pv9c4XZbVADX1j2Uxrk9V+e2rwNcdZOvBxgBs7lwJ1H74CpoRrFUHQiA7\n7wU5\r\n=auNq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"93001484f1ae31173c5a39e8eead3c4df59f16ff","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_startedByRootAccessToken_flag_for_process_instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-930014-krowp856_1627562535756_0.47727523743845746","host":"s3://npm-registry-packages"}},"3.0.0-feature-93172e-krp873ty":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-93172e-krp873ty","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-93172e-krp873ty","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a6eb56e2195ef01fce597040d525ad1a5c91e6b6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-93172e-krp873ty.tgz","fileCount":148,"integrity":"sha512-cKSFgBdVStDySu7yKwyJZYvS6Ok2RHmBUszh+aro/9qsQU3L9kg56+dlUiRXhAlX9tmwQ/MszAOEg9uBbvmxsw==","signatures":[{"sig":"MEYCIQCWYNA/IkmWHMvmI+hALLdhMBjp1s2UtffBPYw2YhjGagIhAMXCOq7CLLEZwUEUAwwpjIesQX5HCoq3CJ3aMW/vHE9R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAu2XCRA9TVsSAnZWagAA9QwP/Am5Y2S74eJxTHYIv3ht\nrg7HDhP0zhIN5gfDDCK79LR4iHFiEr0uXPr5+gKTIyJUfaxDMsApqCdoQMLf\nQeoooNNPhYsCarSJ/5UGpNWIDXwSybUAKV5R1tvaQP+g3m6CZSjXr6tZ850f\nZ9sOBvJiqrn/PR5u5R20cSIxNPSxVLdP+RYNG2ii9TuDN3SRlwCf+GDW+jWr\neDoyO97oLbSI61AdP7vY0bSC7Ly0rlDRJRyACKFl+z5SXxNOhd92kHW6if9o\nhtcWwrgiKZ3LSnei5uyuvs2jt5AyY27wb04AlLf5t1rjlesD5aHnofT2ZXne\nOCcPkw7j48YI31nhpBagoBMKqS0+nv1QakYhvZ16rx8ZyQGJoR2oGXtdevM9\nKo6lCdFTtZY7xcEBXyE0gigA4qBURsvgrAyIaxj4fNENuu7fPkWY4PS0j7bp\nVbd9R7Eb1QxG7Yij2IdB2gytnPd1L4i+WQ52rUQWm1osrwYv5EJMbutenr7g\nM0/z0mh8zipDz6699SVyMI0AhPtf2c2Ki+6674E+2gQoTjGSXtv6T3GQnVwX\nUUqHa9TwdLkGnkh3cTF7YhXI2BKDFVnJaz3x0lg9sVsLgnagoq24CdEdG2di\nq3frRhjw7TFVFW7RX6nzx2/TQfsheoUFXdsJ9gz99yo116a2Y3NezmRpFK75\nlJA6\r\n=WoHA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"93172ed8b69090b7dec97cf7bf717841023bdb10","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.13"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-93172e-krp873ty_1627581847525_0.8936438073577953","host":"s3://npm-registry-packages"}},"3.0.0-alpha.14":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.14","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"de0b2810fadbe810ca67b53797eb4c50351a403f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.14.tgz","fileCount":148,"integrity":"sha512-reCau8Gn59+5ClsMerJEmbdnpuS1jWkiLFdcbifBMDGdGg0vCCYKpHrwPSEukhzaNuuFLaoNwyQ3hQGmNmXMJQ==","signatures":[{"sig":"MEUCIGPBKeBx95cBlpvzVfsO/0kIkC4EmDSsyObGXQw01tCpAiEA0QEFHr+jYh9ggokBM8NBwHreG6uJd7RyVZ+SumxknDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAu4ACRA9TVsSAnZWagAA4CQP/jfuhDZxD/T+K150UYAJ\nrIDl69C3WFCRU7cmZOhM9G3pBAhAl8Vi5Bxemtt8uwYv9JhPWn89BxaLsOFc\nAFtaBL+VmP/PnT1hKOW8IS+yoYADieGGorP3ptt1U6pzzuYGUA7EHAPGYweH\nNobG9GzC+865+5MKQCPL/6uVVSWiQRIiERDk7ApwsgC5IycgSjqcV2nQIs0z\n5a0B5JU93Qdpp+1TXsYuZtt5TtpTYIcmquw29+0FY0M8glC8S1Nqlv7r3ZSz\n5jCXxPzz3Jf149rSnlpouZOjtIMrktjiaOqGXkoHf4scIDbF2eXCm2NS9kxp\nB4QglHX0YKI7rZfUN3/bO8NUntkBrOB/pTQfwKNoT2/q1n5IcMQ9fuy6QxqS\n8IdwZI3buZp2UMcYf4KIiknRxvJR1nbpe++6UwMpqRvivSNcJNf8EuXphTIZ\n3ssi/w4RhdJTnHSsQkvPjFK9twKrujYNs1RitUwEtM98Xfw5pn+c4S6t+r2c\nfIK/3kB2RUGDYR7nKES9cIgbdIC+/G2w16bPe90XgGPC9Nz5u8+S7zB6txG/\n/Ni3gHxi5NfB0Nvq/vrQcco7YVOsGT0CXR/fCTM8ghYJ2HXIYBEtmnbcZCT4\ncCIdMKAkH7SdcuB2oiuPmfdxK8D09ry3fDqgvjiU7I9Ao+88+JWK65lcbpFe\nzmeU\r\n=NvEe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b363335f42e33141772dd7cc544e5d7bdac6d985","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.13"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.14_1627581952235_0.04164928745213348","host":"s3://npm-registry-packages"}},"3.0.0-feature-b9f41f-krp8eask":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-b9f41f-krp8eask","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-b9f41f-krp8eask","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1b94ee998ad2cdbea6816127ca6694cb03b2427d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-b9f41f-krp8eask.tgz","fileCount":153,"integrity":"sha512-9W1X5cR+LfEwDQUVPy/rQ8JTfDP9bhM3ojbLTUxu5k5PQNuFByBb/UHr+Fb8pUB0XTftCcSd5Kg9ZmhKkM15gQ==","signatures":[{"sig":"MEUCIDv9vJxtTTGG7Tcu8FBzoE7fZJqRPJIi0OuILk9BYOtjAiEAvO8+6kB1/RqSJCOFEMIk3H/9beeXakRatW6S/R8gZqs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAu7tCRA9TVsSAnZWagAA5Q4QAKMfusIdI3WTKMNqz+lA\nARsYprmO3e8PTo6EKMin3UUxF+PTMMXxJ/HYdZ6/het9acQIrT/4yUcvvk+o\n32CHerNxTSgQhFFcknAkkVMdBQ9QLm8SCnZJ5t/jBI8CsESwS0LB05dzf155\niZXpczVUSZnkvvCEPnk8eRr8CCsSsi3hFLsqLQ4+5IXgOy6Kcn8FpElpAoKR\npOFp4HAknznjFntF/zBfFxGE/KzLmYy+NS3qOT7beeZ+owEQjM0rhkb4+4h7\nl738lS06F53ND+Yh9LgRUECq2HfBFOfvks06rRktvIlFYFZPAeyDkwJwqN4b\nHPQTsj8Yc14oWffdF7Dh2kqgGox0dyOpZjphcS4KreheJwKuXmyMTCf/Y1oO\n1xj1v3sxkY5P8+lckrxJZxQT7DFWsyTUCjpwZrT+BIPbSS2jDEkiUBnouhdF\nFuHUP41cqlxhEboIkj1T5CLyoKbhg9KBB8QnU+inUvmgZpZ2jOGmq/ehQ7ok\nCho5FKHICt11frUKLKz5g/gHYhP/FSBEOd88uhUtjGf7SJJVm6ZG/m85d96S\nVAOaC95b44citE8feyvdv+QCG6JQTIDOG0Su1ZNbPRBvbVhiZWUADdBZD7yL\nY5cWeGtwh0vTRfi5inokoBKiYiMtYgrJ89eHkduIQx74T2fz5yeWZTsZjACM\nMYmA\r\n=11zx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b9f41f30418ed51e5ed3dd8b8114948d0dc45e1c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-b9f41f-krp8eask_1627582189149_0.08635008178304249","host":"s3://npm-registry-packages"}},"3.0.0-feature-981ac2-krp8fx7q":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-981ac2-krp8fx7q","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-981ac2-krp8fx7q","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ab34e4fdfeccd6c1fc4a6765dea198f05817212d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-981ac2-krp8fx7q.tgz","fileCount":153,"integrity":"sha512-J3iQGcK9I39zCLLACobJUKJYlpfO4a3z3es8Fe/XnsaDyNZ4slXyw5FovQGCCCC8JleBJLeFz/FbuXVwChkasQ==","signatures":[{"sig":"MEYCIQDdQMJgzraY4nqA5vuDBJSF2K/VOGY1ef6xEEN09OZOHQIhAPMDcX+nWziAsg5xrJFRGTEqFlPBhoNGeH+mlGKDPxl8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":439686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAu8zCRA9TVsSAnZWagAAAIgP/3YvIjAmlzFvUdEfO1IY\nfQ3ey9Sfu46BrkEwc9UdGbI92bT/3jaXkDBkKJYnmuI6vza0vD0hp6IFBxUJ\n1vQ0hOcPe/Vqxh5wx1pKmSAValLmH2G3IfbSm5wkzOpYlc1z3kEFuYVkzvDl\nojBBbbCtkcDwDsdWSo8LjzJtpPCEdQuRknS7Rv742PHZt6OqkfiyzQ7ndH3/\nJFyoNWuRLhvX0+bRc0xg70eC9Y7eK6n4WjtYx2GBG5/fz8JBqQ64NtaCcWtC\nrP4cOhktShhm48xa67TtRDBxZtJ9srKNExvLkBnM8tdCftEAvxhipel1Epzx\nTAqDAcRpVxKtbq0WskdXYoHyE0RYVXLBNxqVMaRi08QntdmuGy+D9/aIGvu6\nqdH4aZcSdO8GMOmzcvrbkS8TB8AQN9AJg9cH958FAxaaHesbbBlraABwIGFb\nwHv0TyY5Hmqnt4RYu3C+BEQKKevWCL4PjdjZIiqxNsO5i3mf/g3VZ2mTwmdT\n7H9MWYYTysqb1ikk+k27MbE3v0ejYt5B6tL6v25i0EYGhghCLNxvSABU1DSM\nN8ZPKc8me/3yqGjJDEkn8RxVQIfeuK5TqtCamT8KG14An1QBaHWZgiF4WMvp\no54C1NPUfxYwkH3ciDO8Ls0X/0+PhwmQy4nhELBbIagyNaaJBi6HFhIDx4a5\nJfdY\r\n=xGJA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"981ac227c45c811ae2b67466f3106c3d213f79c2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-981ac2-krp8fx7q_1627582259213_0.061657409509239924","host":"s3://npm-registry-packages"}},"3.0.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"622c6052a0bb29e62bbb136e2be4023d22bb0273","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-beta.5.tgz","fileCount":148,"integrity":"sha512-snFPcPzpPzkBhjx4MR9JrBGtTHmstSl/uPySIcYG6RwP+egqNb6bnr4/o1hUlg8bNfK9g3KBUE1m+6pdivXfCQ==","signatures":[{"sig":"MEYCIQD2ZRl/0vR3gyIr7sqtB1t8XDvb9srIUCRK/j9akO+KGwIhAPUtllsDrt3a4Lc9aRNjSfNipBmvqGowAnE4fUSfsm4e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA7MACRA9TVsSAnZWagAAjPUP+wTuF+wq1QoOFyoOtO6H\n4s2VydjR9rXZmXzN3Oz2Us+NFnUol88N5NqxEnegcWQgk3JyjZBwPWHLmiYR\nzxbujypZusn9sSrDX/c9ql8DMqH63tgEPaFBv5yBpg5Vn87b68/OSly81q2z\nd5qpedAizQBS/DtpI5ufEGXxP7NzR7E006lHEy5ZW49djxkJorhpBxwiaVuS\nIAHTu8vO8joF1mgVtSKm2APWSyF9ThpwDZmoGT3N4O5u7WhdgYJSksGKrrpL\nVNUIRcUIi7f9hb0w8ej/66jYIwuOLPsMcz9pdn8vhzaHcovQU3MVyCg3w6t+\nQZ318axp2KiZzn6PhOQb173x/nR9p+PABtD37mwNBpSZMxO5XhaSD2R7y6PS\nlfA9+IslVv+yjjoavoGV9vy/a4/UvBH9yYroxRZij8hjQLU5JYmkBhCHHVNZ\nWXFr0z6tQ7oyObFmhJo4WTkoeo8MOSdH1ZGa5A+7P/CVMAJrmp+p4Zv1tbVq\nosWcGk9O+yPONouHCaBhp7fRSHMu2hmg8WfKZIZKgeCbFOEYhp1VOQ2CtnrH\nqXZFXSU+vUhoW9pm4960H2e0Q63Mkb7wbriEDdp+dJOSLQ+ScVs63arwF7aN\nJGp4mvLVCZP5G08mwAkV+37RZq1mkxznkx1+NXERtD7ALtOeHUbU6osPoOux\nW9Qe\r\n=VRhh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e681c638edf11a3cbbcd00d301b8e45b82eb29fa","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-beta.5_1627632383907_0.9772743311422742","host":"s3://npm-registry-packages"}},"3.0.0-alpha.15":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.15","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.15","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9432264be1c553cd6cea64bff32842e0b3a3a6e0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.15.tgz","fileCount":148,"integrity":"sha512-x2gKWgvivc8r1HE6wuVT/30EL69vyVtjlBvoBfqmkekE0QknuvwdlYEjgC1xCCLaOp5G+xLmbRDRCbSmoFrK3g==","signatures":[{"sig":"MEUCIEeh/eZPRpegHRFNMG08Xunx9V1nDhIlJtYvJyCRRsJ1AiEA5ocriclE3EV/Q30olNx/2nsIIdXpukLYFcQh9MTMHro=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":421489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA7MSCRA9TVsSAnZWagAAwFoP/1jt7qdFcBQfAALAG0jN\nB1pePBDMf5y81vwqbq4FR6PwsfaxfNaAq3bAwOrz9gTBdX0a4mIC4qq+dORq\ni3ptHvVN+lqHuxbwgEbpMduBFspHABwf2maCW21nmGZL3+Q3+tva/qxBM8yU\nbkcPjcK+bdf0Gi9E8pGONP1yCENRWN1ZCpUP/0nuPI+w8/FXiECa0SAvtgX9\n4PiMbnSeeuN6f/3W1vYueYb+S6dyvb9hh9qoRO9e/aa8bfFijDkskBMP6O0y\nL2mlrNc9mfBsqsEOLTKUWQYDW6i+HN43hUcmaxR0g4mku7B4jLWqgUEc0R8v\nv3Yt9gLGAuaQpkcJ2RZlIt6YGth2zAMlhdp0NVBKloW4cGnJyucOdyFGEIQ3\nSkPtpyeOeP3RzqYvbDp3Qmi0xhsGt16NJy1IKEX9uwR7pYUm68MRCOp2VHXB\nHVoNM2yqbPXUDqJctzzK9WxWlGSe3VbwKWGP2VX6id0pdJBV8FgSW7rZ87Il\nmKyNJ+LJG701qiePgH52L0/oJRDse+YprHlRZFc/HkF0Fmmwvc0AjOmazSP9\nHLG4UCkNr4HtjZV1EPxCv9O/A0jYkERKt28gv+GUK46302o81E3C/RIkwkCM\nIFZHWI8+FIHiwHJC+oSWj+cYLQjtbMHUVQmAM+HgRqycqWsLE4JebhAeh1gM\nLXQY\r\n=T529\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7ca6f986e1400ec99bb67256f98e3ccab1b07659","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.15_1627632402065_0.6328804452279349","host":"s3://npm-registry-packages"}},"3.0.0-feature-ec37a4-krq2c3mf":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-ec37a4-krq2c3mf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-ec37a4-krq2c3mf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"43b6d77d827f76858a7922a286a2b891f16eea36","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-ec37a4-krq2c3mf.tgz","fileCount":153,"integrity":"sha512-Aa98wl4ecopDkSnmlYYhT5nRsT/LTxgWnG/AkVHhXNc3WDIJFqFP21Tw000fH/5UlvOQ2lEd9dXk67e2/EHNxQ==","signatures":[{"sig":"MEQCIBCCM82PZ9/HMpBjg03lQ3G7bisULJ9Wx++pEjBej2rMAiB8x2ZV4lfguc2Te0bgbE8FJjKPGLrFFzmlR2pohbTENw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA7NVCRA9TVsSAnZWagAALfAP/2n5wgf+0HrL8mJYCp94\nu7ZCjEzZM5oq/4n1N/YHzfp4afcG24yZ41aoDDJqMbyMzSRXNjYcTvoZADui\nilZy6ToEXkdcOJBM33ZYzElwpBivHXDhgTgER7BdNMMsSZgo7T8GETK9kx3s\nnQashKu35Jw+sMkFm7/NcJkBp6VC1EU4kmA31DmSJLOQE77MKMQxRkEdUxAt\nNdNUcWgu6jbeAiYt+RIOPHl8iozl9MPMM3weZ6Einsl8Tfp6r46zOKldfEUo\nsrMpYKfkKhizHH+Ga2qUOLM2zs3ASqcqa5O/CJSpM6PQNMN3Mgei6tNGYCuZ\nBOAdjdv5MQ4WnkLn28iQYiXBHg592UwsvDf7JaEJalY+74Iofhc7/eeKwD46\nFUTF083rCcmdSUe4xo1HNZJA+T1UzO0YSvEWF6W/RWatUTHV2eM+eRzcaRX+\nUBVwm1ihy84nyXCPxKeX1ASgC8uR3ufFEJSdBWD7em2GMILHr4UaSyd8tbRk\ntCCa2ELHiTBAZLDuYDMUZY8lDUJRgrV4Y5cOpMT8gtfDgR+3+lmd05MSGQ6k\nNwHuihB5CO7NUQPJDcCQfeknUXqvffjNCDGjLDJwWf3MwF3s4ZJlI8zFNcvW\nGGx3GNysmwXhujzPgwMoZatj+cpiXc4Jq8M71FQS5RaFwqToarMwblhQ8yMv\nmZ/X\r\n=IpIV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ec37a4d7f2115202d7e74d961c54a3d47cf7afed","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-ec37a4-krq2c3mf_1627632469572_0.5430974713292624","host":"s3://npm-registry-packages"}},"3.0.0-feature-e627b9-krq2p1dm":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-e627b9-krq2p1dm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-e627b9-krq2p1dm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2c7f6fd066abcb0e2c227c68ec8d01deee3af40d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-e627b9-krq2p1dm.tgz","fileCount":153,"integrity":"sha512-h/YSHEEihZc2fNqEN4CC7QMG4rrs9PGsAIdn6WEGTb2Geu6VQrL/yY4y526JwMkQlFXnJMl1qJofBoIB6ApPxQ==","signatures":[{"sig":"MEYCIQDM1Whq35aqa8VFDChfSWvVtGAbftWhZzp9lwjd3VLUxgIhANP9twZWdkfdNqQrXieOvvIW+BdtPx3z8CYz+P5FU9ne","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA7WxCRA9TVsSAnZWagAAkmwQAI0lq+rUHogQgBaffziA\nWjSSBGpdMpdir5bK4QJKP1bqdbnm5R7Atui/gjCA63P9inQukKlXX3yRfQzU\nt+4lBaEkCqmCH+9a6u0yPOPTCUiWW/qaSYKZQfsJpMp1vtzgwsE0mXJKijVz\nqm6RPhFawYPT1RFjXEAjG9xeOhdVBAQGVGNzJAPtT0NpigJAKDpRF+aKMV0q\nqCXaaUFILbOD+ncu1FXBLwJSBrP3UlC1xm21+wwLcb6sUHgHwoNzdnjJ3N0A\nfLYhO2Tj13555BYgSsPvd7Pv2oEu9hbxJUdj5tmBqERjP1TcGFP7faoDwQbN\n+oTPX+YW8Az2zjJ+q9S6Rzk/ykDxld/ArQP0rOxfgOziQqic0y/2QcajsnDL\nqt6aJ7/2Qc37CZK6hHOkDlz0+/m+OZBJJj03ZjNXni9l78W8J6BT+9V6zgmG\nt7yNyAKAW5HR7+xpaTddRD05FW2H1cVbj8WT0Er2tZLq4GF/gqdZlThen/fY\nWvKQtUl/mDsvY9wZ8cJHgV2iosY2X8DNuFW9jpo8Zi7z96kyKMR1lPcd7x61\nVUDbjfF/ACwa561squsfT9KCFWdUoHl+Ee9+uMxQvf00gudKHJNmX0e/Ebo2\nBInLWQj1SqoiCFB044SbDhsv64dz62odj4h5g1Lajmv/rgv8i5/mBt6rPFgv\nbUO5\r\n=mgTl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e627b9d28e6629b5a7fefe8eb83801c12fef24b5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@types/express":"^4.17.6","@types/socket.io":"^2.1.13","@types/socket.io-client":"^1.4.36","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-e627b9-krq2p1dm_1627633072902_0.5971503578353792","host":"s3://npm-registry-packages"}},"3.0.0-feature-11c0ce-krq2qbl1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-11c0ce-krq2qbl1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-11c0ce-krq2qbl1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"755a6b838839bc0b12f3aecd2beeb57bebde5285","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-11c0ce-krq2qbl1.tgz","fileCount":153,"integrity":"sha512-e/VL4N3EIhuBcwcsFDxnZYiBohrijB8enEP/MEuRY+1ZlekRrgI09TwpQK8ar5sdZK/nHUyTynJpvfcPCAz2Xg==","signatures":[{"sig":"MEUCIHF0eDZOvJBrEUekzi4HV3epzEgkqdThZqM3sOf/fvpaAiEAgYASdMjCFc0j5H9DkuRrD3jpSpQ9PkVH2ki9gg/GhcY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA7XwCRA9TVsSAnZWagAAoz4QAJMg88jD7Rd+JVYFVX3p\nfGIl2rTV8sHcTs1KJGnw1/p6rJgyAZdITRjUhvkoxS3tbtFbiE69SoGEOj5t\nI8Fxp+ANo2TY/BVG7rNr+LWQQv5R+EREMB2Q2JZyTQUqZ7NLroZnnx5lTdFM\nAAz3/9zPuBEZ8GlnJPuVOU30kSwT4Q/h2Vi6HXiJ7XMyoGT+2eQAoSwYW+Pl\nH49E8wuN1+W34tPmFs+TwrAq6Uz/ZnHJ1B5LEfZzNA7uyiUh6FmzEHBtkyVB\nLLWXpvzBQhpfnASmxj3+At7BY9MSWIwWqXINbnbJCRtwGew4XE37JKHFuQCc\naE8z+BF+kqZEQCgxkx3uyDyxFguYPx5MC4wO3Opn7xrzrH6fk5kozAWujkjD\n+5lCMBePjYzpfjwxlroD8WFZNW7mG8Xbw/KRaWWC4HDOJKrypjf9v615iCVr\nTuUrtil78VLutDvUgXC6K3meMB7pboBrsaIPe3g6xP6mMPKto6nLUw/KQZRN\nJhFnXHZZbBJhDC6lVsJpj4kiGl6SJprRAqwvT1xAoCPVTfueHgZ0qGVCpOpd\nAjjbRuXD3SiqSVwhSwbWzcbXVtwAAsZ0TDHU2Ehi2DRRRq/U2R6w1dgJExYb\nkOfkYz8THjAHSiIfgisgLq2Rj/pL+8Whzz7Ajv0w7AFALn9pcehbpd/bd0t1\njYjT\r\n=cPZC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"11c0cef5d0420592c32c509cc1c1cf698c17b310","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-11c0ce-krq2qbl1_1627633136657_0.003797783931016596","host":"s3://npm-registry-packages"}},"3.0.0-feature-5e4d1b-krq8fcty":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-5e4d1b-krq8fcty","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-5e4d1b-krq8fcty","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bf37ed0586bb53258159e8e9c2a3096896220a50","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-5e4d1b-krq8fcty.tgz","fileCount":153,"integrity":"sha512-R5wtwuDLgY0GLlMNKCc9cTSP5g95rZeMQozkbCOULhMbOUqjU6xnG1fe1kVSYV6XJcQhITsZSfSIIxcW8xxSXQ==","signatures":[{"sig":"MEUCIAjRz68pWNtsP3/OvK2SiVThanIk71a16qkNfWfuuzQ8AiEA+V16WEyytZaKrM//7d9DvGjo8VtrYV1v1d3zZeSagbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA9tKCRA9TVsSAnZWagAApGMP/Rh7/AobQT3Cog2b1r7R\n+gcB1RRVgsW0AVxza0gM5pw64gD237skjvubggbnZXWS4/Qce4Pdu3fIA3qb\npsVW1OmJIumdRI00+zboq78rE4aYAU6hQQ8LtLwUrkI/TSotx7R5ZxhS0tQ1\n9bofGH89O7fQV27InFDlgzws39PdUvPCieIbws8uCI15Wa6wWSmQUZ87etji\nk8jAFjT5OegQpWsmnPA92QO2F72/oIgoTohlw5FyjuVQUCJfG+czNPnRs5bl\na2os0jCCYSAujpuv7oF8t3ZuNCsKZA4XGoz/BSiqEw5VTeEDcDg0rfcwemF4\nmX17ClFlMacr/HhvXzf4ybmzxTtNs6ha8tHcP4Nx0SZBzyhSggksQ2gXlD4f\n3lJJjPvvigdW1vbYwZEQkSGKwKiGSrgSfoyWR2pcyJtEzgDSRFuHRv+dtAT4\nC1eCfDjOR9vRCZWDiyaL37CrHhMZINQ7ezoGCWWguhm9EdkSI495SKTIA4vM\ns/AoGGjBexDIupLpaLBM/LQAAMGaEC1MvwPYIi/1TWgbWdkSNmNAKi99yiFG\ntZQw1GcXKVp/WIKz0Lx2/wWC/jVPGx14MU61rRGyQFlzB4o1fMuC4VibIiiz\nCC05E30CC9PLAk/DiKrgbDECb9BTtQK/HK433KjbUHFlsIOfAKGQGQjwlU8B\nmCeQ\r\n=NX5m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5e4d1ba57ee7b4cd29fb5a261c06ce7e1a568c60","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-5e4d1b-krq8fcty_1627642698771_0.10627733145630391","host":"s3://npm-registry-packages"}},"3.0.0-feature-a8d43c-krqb2z57":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-a8d43c-krqb2z57","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-a8d43c-krqb2z57","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c115f3c127b5241eee32442d5653ceac59161767","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-a8d43c-krqb2z57.tgz","fileCount":153,"integrity":"sha512-5BLO4jw1Dc1EH2xs+1bxrd3BW2it9x2uew5ETrqYq4Mv756xbEADIxUdw4a6SnDjPqxquNp9ZkXwH0d6OHjLgw==","signatures":[{"sig":"MEQCIHq3Y1wblVCObZuTmqyc1fQGPUDKPjs0+SR/iZVDBvZiAiBz50hjaNyYMlXaVxSppGmr5QuqJqdoShZDqF4VscRptQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA+y4CRA9TVsSAnZWagAAvIcP/ip9G7O3x0fpSw3bhSq7\nSwBfFIkFs80nMG0x9f0s9wNj4XrIJv8hKeA7YBAbTJ98aSrfgtDAJApvPdVv\naddfXrzsqTNWeVLbfpwPqC7kXzo4G5s8QcOyAoY0BuzutdqAknPNWR3uT5ld\nkYtvm3f6AlPlWRvwhCuYrxBRWOdwk4BCCnWehnkLCHMc8iIkz7C9a/cs3oMx\nRAi7bw54ks6nqjc9c53/650C9uKYYeJdf2ghFwf88Ty2mAt6ANNZKUszu0tD\n+YkQ1OieyODgkGDVghYgxHxkb1IMC6ukV13tRLAh6twBElVk48Yh3cOkYtCX\nKJ/yA3sixwOqAn+Sp0jv5AU4KXA1whaq5Zq6b7sO/bZgpo4PnLaRGDGMSTrx\n5NmkmYzz7qCldNky49bxcYMeeFsiPqdZNC5LTXx37r84QOqEtufuPoi1SO8E\naqUYiyRbdoZgdicb63fPZqCcjDSqRONaDsr3KwPTkd9jzUW2urxvGR8FGjyO\n3of/RSG1NC4xkY6X2MgKXjOa5TdyTlqIykrmi58Ihuhg14BseFkbON7K4cp9\nyYWnOrHUicB2CZ0Ux8+5roJkM3chVooCiptlZu8U3kblXhjvpcZz8LfnlRrB\nzN+5ZLMLUEsJQD4iNcCtcNEcKti/+rwB0zLTnDuO4jHbbofQL0S/+cjzQSe0\n7QUG\r\n=h99m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a8d43cdfc106b903466e4e043b115165760068ea","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-a8d43c-krqb2z57_1627647160324_0.4065604214324299","host":"s3://npm-registry-packages"}},"3.0.0-feature-06aedd-kruv6aw8":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-06aedd-kruv6aw8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-06aedd-kruv6aw8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4503c9bbcc7364a9aadef5fc2c270dbc99491454","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-06aedd-kruv6aw8.tgz","fileCount":153,"integrity":"sha512-FaPQZEMNB0HQB48q1oIQAlhtGHSh3vZsvBdp0W05cKNNrwvNbArKPTeyWfvsTGvSyZS+HlxVMFOlDO9sXoGV8g==","signatures":[{"sig":"MEQCIH/45X4N6oTdYTZVLeMcCaLdA9tMkGycal0mAExZXBWNAiBaNeQnqlRea+LF3eUM5w4aKfRQLvC01pmK1GxzIsPeLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCCFWCRA9TVsSAnZWagAAaMIP+wQE1fm6PQF6FUbUbB2g\nlBHuES+0sGsxIBUbh1PWuWMNf0xjjll+KmSperleu6di71hdNLHcMvht7jmq\nXn6bB/y48hT1nZ67J76cZ10Ze6OzSTMjTPJDKQnrmMDt9s3M3hFufDBTh6nD\naVLH80CyKTX38qoKOlAududKKr9bTANKJ86i6OCm0cNEzHtDJdQwYHKU8/Jh\nvVZ7o1R6BllIWPwAOcS89datwBO/Mwd8LH5yveqCAOzlK/PmbRsb76Tx8K+v\n6pTNMU3zjb71oCS9yTxxH2oSu5aVtzoCYujSPW2h2jZtZVPapiFCFbMuxmSz\nbweqgcVC7o56fEtgljNgvcDeGJTvWdwVngykB/aqgiFIIQjsxoV6/HT0lbbP\nyeouzyiay7TKsW4Nu7WLw4O4auDpS3fburz4X6J6oQZBmUEAKZbiyWlNygn7\neERsSn3icCHrz8NLJXvD/fK4rD2Mo8eXVhUk/jofXeTBsMOWsW4SBXm7d2Xu\neUOly8IyQ7xTYi6jx+p1c3416p2oBM0OmH1OQf59vZXNZ3VdsRwDPY6xykUa\ndUoy/Sqd8dL3JARVe43ElvjRtLuqAjIpiRPnqDehKy+/VnKSx0B15P5mItb1\noYno6cT8wToY0Y0sXfu4ifzpX3qdAdnrpc4ATS8lFTsYbPga66PB1Q4n/ycJ\ndr+x\r\n=SihR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"06aedd454d2c6034f527c21102850f13b5f9acd5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.15"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-06aedd-kruv6aw8_1627922774389_0.44318242648030615","host":"s3://npm-registry-packages"}},"3.0.0-alpha.16":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-alpha.16","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-alpha.16","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"78869b97a7e389e1a9367121f6ca4abc373c6dca","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-alpha.16.tgz","fileCount":153,"integrity":"sha512-/CNzq3Wf4LelSCxiL+/FsnULq+SPigGrx9dedanrMbSzGTNmH86j1iE8HTVc1VXn6TSLaXWHuAB/+S8GRaGSZA==","signatures":[{"sig":"MEUCIQCctzQBjrmknScaXFAQ9FKod5EdafLA74OYyVrzVqvr3wIgWJHhRG2OUuYwkX9hlTzP+hpu/RJNtK4nPNSA2C5OJ8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCCG3CRA9TVsSAnZWagAA8GAP/RD5xwVI3yuZ2zhqpT2h\nQ5F+cPTghlRXlJlHVBuTxdjhSEWxpr9b79GhDy1jMzwnz0KvPYNYGWbnHPbD\n7Lk7QQ/w9/d2KZUESFlsEwhaxaWDtyJPo3Fz1yqCFqIWLCqCgbc5Xc3/ADfj\nQ3ccgBjPQJJMMakuXs8XXQoXgasRxw5e5vxfyvsgmaKHlcaLS3Ja+MymfNA1\nS5yxulQIp43vWfE95KAAUwdLxWvIY8z1Ba44Kx/CmxDFBnuPEn8K6BEcpn4i\nGbDI21sVyf/IqsKiQ7MZIASIvUOx7XuxYM4qJmVc3cRYs6iZk7LdTltNqIR6\nV/YrgsbTxJU3PF3yScSCnK7mhlTk64qtP4z4Qt0lqynq9QmYb9/y5UqjmB4F\nEeOsT0koDQAxufWoxhbJ9DrvHH68Wj6PXf7zVbk+vwEGbDXYa8JtptX3JBIN\nL4hwjlgCJRlAlSeYNo8PWsOriXGxe1fgXl6xb12UGiEwOmqgZOwlFF6LJicZ\n0dJMeL818uedUSPYhKoFvfDCWSfJTICQHZf8viC53xfsyBceqKIlt9wdDSqe\nrABO1B8GbP5aSxz81umQWuBvGMqFsgaCYpbXuv66gQHF97NnGGo+kE+Lnnvh\nzUQgvWjOGTCh51fCN0o1bopOj0YDqzMlKkBKwqaTqkOjXcQ+AGPavJ5Hlndv\nB1Md\r\n=BEyx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bbc8fbb7e85fa00088eb2a3a995e4c43056c2c0f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-alpha.15"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-alpha.16_1627922871020_0.7658309409015205","host":"s3://npm-registry-packages"}},"3.0.0-feature-08df19-kruyxag0":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-08df19-kruyxag0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-08df19-kruyxag0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e09fce89003c55e6f4e1607d3821057790d87bdb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-08df19-kruyxag0.tgz","fileCount":158,"integrity":"sha512-3+HnXiyFxfrtqFYfle51GSdK6iKNj+KK/7kjUsXXPyNv9DhGyTVna1mjUBVUHkrT+42kzZIPvn0CoeLs1CQHag==","signatures":[{"sig":"MEUCICbtKvoGOOr4PIUnQcDw+tbTOtvCPbHxjF1U4XS8rZQMAiEAqi1GRhsrTq1ddd4h/qe4DMMedwE2pN0ZpiBW3i9rFz0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCDnyCRA9TVsSAnZWagAAR7YP/RK8T5g9ZqiX6UFtdm8a\nWHU6nh4QuAgRh1W+NuLLl+bHtg+4S6dZyrYTqVfoDepajd2ljmf9fVIfPFDP\n9R8cv4fhNkna8OT0srKz5NB+E/dRdDn9JYHVhDrmsr0/SaL9ujJvIoj4Cd3c\n4GUMjuGS0L74amfC111iKAJSl/Cva/rwP4XwW5cJZ43LeCZnL2vgLKXAtk1J\nWduQsU6Q7vxQKBgRS63sZMsfbJKPrKI96l5Z47G3O7JiY9yBa5CtxMwcveTv\nNhgGYm8TTE6ZfV/3ZkTcR9N7bT1bHBrQ8CDQTYMBpG/ovcgiPeqNjFd9OdBA\nXYUjmkZ95v13Y5HKeW+22FE5ZKyw7C7dzrtrKqKlcMG7wr5KnrEZGBISsNgz\nNVEeMsJ0+PHxGV0B0tFp+5AdkqIZ/sCM5vaFgcMIofmLLsycfgBUC3SapRw7\nXiOHQ7cQq1QDiaR3rLj0JU34igDt+acRlxucKa+VwvfFR4bX4/E9u6jv2zor\nsBcc11zEF2mLa4wbC7QIXlnLXd4C8Lx/m7nZJsR//ExvFE70r2i8eMjMtk/z\n/D9ehU460PdJv5GM7/BCGgp40cWOj3FAhEoNeLEW7tABAteiGWfEpwlj/HK3\njrd9wlbWX+0uKXsUC2pV6vn4Z8VqKK4Wd2+umrWf7twv9M2iCiRiwLsrE/EO\nR0Jd\r\n=wB1F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"08df190504ac0f1cd186c671041d6061efce0c89","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-08df19-kruyxag0_1627929074300_0.7966914157820542","host":"s3://npm-registry-packages"}},"3.0.0-beta.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-beta.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-beta.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"685a423f31155146a6219b874ad128dee3bf458b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-beta.6.tgz","fileCount":153,"integrity":"sha512-n9JnEwhxf/Vpiu3ds69Hi5gto4bT+ZchNPeKxSSoveUi65Z4NwWukpaG8M6bPd5h9wAF3wNQOXufcMACVmkUlw==","signatures":[{"sig":"MEUCIEZFlVAyiuHAoiC4psvPfHVvAxM3VGLCJnI2V9RvnBDQAiEA99i5E+boUGidhEBCtXyA7G2uYWVRpex2B6c5JQti6HU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCSwZCRA9TVsSAnZWagAAYRkP/REbyiF2YbRXNL/USRNS\n6Qf4pKEYSzUOs6EDCrh0PEEZx+tEvhOfZrJJFEfq+XW3PIkRZJJbIUhpcz9x\n8LZ5eJWB1uCm3T8Ytokx0q+x625jeCZ0MZ7VGimITq+N1Q+AF8BcLXaN6S1G\nRv451LyqJ0BFkWIJxK5jHBH4pOubfandY2yN4Dy3FrLg/PBfOF+kQnpz6t5f\nlNWNVVzVqGf1Tn+8MfXC2e1I7g7pIq2+J52cK5NadlaxFi6u1EHQui9htZx9\nT9WUzINuEEluSNcwnnvkrC4fQ4OiG3ONQ2wA1/K+0MZADg+xRZYZNCi8XCpl\nJzeFRNKJKKy3B75V6/2aH96gO2aP86T6m2QQ9CCJEfgNGbX81gTb3xFKoowa\nnVnZxvY2jwII7amcRMf5TmM+nfQs6G1MF2BBi79DfdNPMA2TolKoKU1Ldw1e\nbZBEAa37qsZUimmdxGrdDhKrwwyYwHCy5Kh1VuMSUg6N5qe89emFQ4GI/5Ix\nzFT/yEbgLc21uFbEee4ukweGRunshloNxoEy9bvocNqqL9loj/uM1kcDsDtW\nt0NnR5AlzdYZyT3YJEjnIs7XbvpyeXKGrKc0ljxqt/BqsMozSG3hKpcMjCEr\n1M/pDcla7WuH15u8yOFFZ8ov9Fg+kjp9NoCg/kI3HDRI1VCtpB/p6zlHc6K7\n8UOX\r\n=g/F/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"68f5738a716d27e9008afc39738323fccad45ebb","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0-beta.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-beta.6_1627991065732_0.5294822162365205","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"544fbfa9f75e17fcd7e481b375a4f254a191dd59","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0.tgz","fileCount":153,"integrity":"sha512-V7nX7si80xlmVRiGMS3LUxE9/KpHHcVSrSgapZlCA/xb0QYSkxv7RDPws3p3BXZMlG53PtqUbPkvsOgKPQwJOw==","signatures":[{"sig":"MEUCIHWrAb654V+vqMxMZRlmf69OAZyNx1KK1My1XEv7M9reAiEAkDmX2ktgmvwhv5sC8lXdL/ypr52610WYNSTVL5ABGeg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCTgUCRA9TVsSAnZWagAAbAsP/3EJ4Jov0jgTeg5ZuTpX\ntqD1/qCzgoFE8sC7c4sC2EJL+JB8ygTfUUypH3gAxp0lPe9BN3hUMku1grHh\nE0PMJuTFDoqcCMQr6ktRPecEKZs98KqvlB/wAsv8oDscy4hMidcHxB5THpqa\n2kuVSaLpQwTy31cZGVBOKySSemdS8UcbKec3ZMiPwio2rm+cRI5rRhfo73jU\nLJjLQyOj/DHj8mrfzGWLe3qz8ExfuuZXzoELwezNap/XIBpGA6ZWX4DTTpHX\nN3F+Cmc3DqSRFTsnJHaVQfxT7i5mPUMxkh9uFi61ho2SfAFDFWPLAr4RJ6ee\n00bIRycUGD8ewMhl7IEnzMV8gt2j5+60RxJg1IJz/uoDZdQPfHnI4Zi0bPJl\nbYEbUDiWgOP8DfXiC7mTAcxawlyPPdoHqt9OiWLZUB6XMuBUAHQDH4Qaw+V6\n2OOChrJSz1Kie7WfVaRu50n4bEQKcWjAwfu+6g3AaEFZVzSFx4Z+fa3A1d1x\nW3YNGJhF5SVkGV/LBx9JnhlIcj5pEPsI+fL8vi3sSA5vBtqmLquyibxAB/F/\nBWTSMPKlfAa246ggdVX3Mbw+gl+mbauePU3Z4g//HdV+Dji2p5Vsby2qBdNo\nrJQI6Ql7svCWk9LykQkKP+WrscqM5VcrKD8724er1IQZwTfReF/hRWeyShds\n5K8W\r\n=OEmi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"51775d0d3be025d4161e4120e1af4f5dcd80ebb6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0_1627994132710_0.38746952948072155","host":"s3://npm-registry-packages"}},"3.0.0-feature-41475a-krw1rrf0":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-feature-41475a-krw1rrf0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-feature-41475a-krw1rrf0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c740ba0b588a55e0fa6ba2e6676dda44fc6b9472","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-feature-41475a-krw1rrf0.tgz","fileCount":158,"integrity":"sha512-b/pbP2EJs4zqB1b+Wajsx4eN6nbC0odnHPDzqRWz2agQhzWWGVOiN961egWFnuW+L4YKrvVrmQMjvwirnktcIA==","signatures":[{"sig":"MEQCIAIV1fhhAKe5M6/5SPTyAE6GN97Swfv8HV6xaoVkv65uAiA2SiwW1WDTxZnSYdzrhctbWNsCXZLR5DmwjgUcrJR8xQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCTjNCRA9TVsSAnZWagAAEkUQAIdr0vpC2Sqf5KoBy+Mb\nCAf8bV1K+m/7G+UzjjY/TAJC/XAIHOL+MNvjNhe2IsjMHW+jFBCvh3vnAMiC\nne+kcdMGjNxjAW93mMN5Fm2RnPR7u7tw25Lngj4LuJOs2LXipxK5YaDhqyyE\nxujYsBdSEOzedBqqjOtAXSKEO0UgRZfRwgVW0T+URrLd8aahibukEXse1BET\nfxG2yPKkyknFzDudqPbZiycfJKpcsjWxCb5NYolX/3N9a+9EbkYbvYFzcYqj\n0BCBtkKviq+4ue8Igb8rE5kSMuDlIePKyjBMKEciMzC56ExzyB6SJtPfMmjG\nblrL34ZfsRyxigFnRxHHJSpOwgzUvoJVa5CoIefrwFWnl1hjs1N3D2c9qpRW\nXtwVEavSiqQBiYOVuSvcLK3xeJD9rJWZ60NBYyoZgHWra1BbRW1lvHUdQlIo\nNIcogErISobNYqhQ6/JDSq81yhs7IHgWxvKXLk0AOlQBBlILIMqAzCrtTdp7\nj63tAMCD/FamstDIjgEc0kedWZ1RIzcQ+Q+y0dEJ5Mf/CldlPUIXFaPjxvEQ\nuHem0OMISXTZJEfoI8tN4hlbFz2K/r1i5wnuoqKg9ZxiZ/htdRY0Nj4uN2pQ\n4zN4eOjQaKMFojv0W6ZgIarroYZI17cbj/9NzBIFohFd382onDmdpbNA+4lF\ntHfP\r\n=4j5l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"41475a0a8bc2ab471339e490bbc234ea3ed889e8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.13","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.3","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-feature-41475a-krw1rrf0_1627994317708_0.12683419860340983","host":"s3://npm-registry-packages"}},"3.0.0-hotfix-85515b-krxhlkbp":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.0-hotfix-85515b-krxhlkbp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.0-hotfix-85515b-krxhlkbp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a6c99a0d1e76e5a52d8913815fc9e910421c9442","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.0-hotfix-85515b-krxhlkbp.tgz","fileCount":153,"integrity":"sha512-MgHvtvp9MOVu1vwG1JC9idc2IpHkAMVHrdBp724o1U01BGxuAVgK5F2YPnLC7H9LlMgChwKDy5R/OP7DgKG3Sw==","signatures":[{"sig":"MEQCIH8+zEn+sI5y+NxSfltl9323mC/zcnHoK8PLq3neeEXvAiBUtJHsoSOh0gOb2Vn9afpbLoTlLIYXYo4KoxxjLhLxMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCozcCRA9TVsSAnZWagAAQtoP/jLPs78LZdDGu80iHVH4\nEb+TH9BL04ggUvAetuoXfd5e3J/QhPl19UedzRggv7WMBlt5i5+RtLs7rCp3\nqyIZf2wxY/kqlXIJ9UtCzsbXNIvUCvP1YudRCrjT0q2g7lnx6cZDr1eDROcr\nLNscUg/Ne242RG/AHaAYceTTn4kAFLlBA7yYzArDZ0WLm2xg3TT+UVltXKRk\nn9a7c6yNOq1cVVnEhDiRJuVlV84tClMFGjJAyi/0UB/9/2cZnFvfKTXAJcTG\n9Stb7t98c+Ltoflqa5CwELSm3qM1dPfz5KCKZeYyRtoCm5RsGyUuycZCsI7U\nfYvlYtk+zXAYNEgv1FXVzP245B9M/PbUEfF1voybLZdoCBVJihy2P23+3MDF\nReIA0G0t1gFnQZehLd+8UGSqoe6G9290f2fKozyQSYa3Qjk8e37Ggb+7U4vL\nr+SzWgYgaA209fMe1yU1DslvpnQiBpesIpTOHHhhhwRUSaONEjGTIRzG6lfQ\nG2HkpGJ9ujr3RXgULEF19pBzWXAFL4eKL2pcCZBnv4/FVp+nMCKnIHYWHGiX\nuVNEvq/pIS8tsCD6XVBLoTmymZHZ2JThtewxsLH+5w9ANlX51dMmarzN1/JX\nuC+syN8mnQFI/ORCSeNKgoZYS2YdILuZOqPsFjBWAUEI9qwUb9XKWkwgwaxi\nFZNf\r\n=haUV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"85515b09427ed954f679ae72db3610f0372f8b7a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~fix_pino_creation_for_browser_environments"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.0-hotfix-85515b-krxhlkbp_1628081372181_0.42813948869764173","host":"s3://npm-registry-packages"}},"3.0.1-hotfix-3d8055-krxhomu6":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.1-hotfix-3d8055-krxhomu6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.1-hotfix-3d8055-krxhomu6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"39fb7797189899a97533b4f3dfa3b9317d509472","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.1-hotfix-3d8055-krxhomu6.tgz","fileCount":153,"integrity":"sha512-vHeDOFGn9yQ5iLbqolc7ESRtcChhXmIXDfSwifRBeDHA+c8Me1tP2Yrhe/NdER+zzwAOE2P5CJrbSVT/K2Jr5Q==","signatures":[{"sig":"MEYCIQDbPTs7B4CyIgAG46D91BXWeVsQ67GQn2xbowqg3PwAXAIhAJ9Cup8SSkcELaHUsSu4esmRN3OO06BHem4jhYK1ikNg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCo1mCRA9TVsSAnZWagAA7yIP/iT1Bd0a+z7I0RqcRgFx\nuqpJDF5eDBXTJlnsfvVcHr7tlbshPdjd0eIvM8wPfsPqpRXd62RL1omNFAJb\nNniPVslnKADB9WktZh1EbXYMsiv6p2alasgTtYq9aAl2no6I+TS9b3XkNREc\nF1lENioFXHlCnVSUNFc/l1NmG4gAopdiZwRVw7nuJVIYaoTfUK10aptwtE/4\nNDI3ZDx3fGFmcva9sQKgVYvPePvQEYTaIczAOzU6RdnISlqQzSXN0AZTDer/\nC9n+F5yD/vnTEv5v6tK/LAAOzzjYr5GjpS7TTBaZZAnb2UStPNKTQOYcXb2a\nppy+XzjV0B/Nrrt66Eu4kLj3Y6y9KSYA8mzX+8d0bJjysoMV5Pngx0eCUxCg\n87dMCpxBwv7MA/EgJxzpNhCBdMRGp8gDt2GW+Ps5uM4BT2TcEOqsfjjRqolJ\n7cO/uvfN7L3Dv9v4Y59SHlpXmHkeET5y4D9852yxu42W0mPFxqKlimuHzvGY\n71qaKueaTDtFn1OmzxHJ4jmeqZpNbuGBf+hY2WTbse7T01swYVOsjUCKSxXd\nDobaAZl7oTWUzrzFZZIHjc9S7w3ZdkvxSLtaOco4wU9ucElolnaYcGGPGfPc\nzz5MZZNGjCXRCoua7V3ULouxwVDVWP3+qPjKewIxEXn3gkARI6K3vHJyFrxN\n/eeJ\r\n=ABdQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3d8055f13cf5eb59c886f0a95ae161ddb1724cf3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~fix_pino_creation_for_browser_environments"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.1-hotfix-3d8055-krxhomu6_1628081510596_0.7772833847881235","host":"s3://npm-registry-packages"}},"3.0.1-hotfix-3bb287-krxk66za":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.1-hotfix-3bb287-krxk66za","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.1-hotfix-3bb287-krxk66za","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"65c3a6b8929ea20fb1d2c04327b9c96f975e791a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.1-hotfix-3bb287-krxk66za.tgz","fileCount":153,"integrity":"sha512-GuUtNXock+HV8rIx7wQPfq6j4uz0LkUElIrfFDVoFtkabFXkKOkz9pDYaXv1KBV3zqzrQcxvarz0DSIlmwoAow==","signatures":[{"sig":"MEQCIAa/BB02v/zjdrYEXW7Tt5a6tu4CTDCBl3QcS6VqH6jJAiAKXMQ2GGLyPbkYA2fk9lWBwPYC3r+GgoJrRfyocf4dnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCp24CRA9TVsSAnZWagAAsfgP/213NXgxzsy76yTYfcOJ\n1ENPtFaO9DEYiVxURDL0Jt23pM4Z/idXH17LskPRnolInTk+fixpwXNVq0qA\ntPpa7Z/I0L++lv8ATKPrAcMqxvya68wUd806SkM4NjPfPEkBfwAKcQhwrySc\njM069Zap+IunJA/53XIVgn8PyYM1NTEv0+VPukngzcLD41XhSIM3venymjkF\nrltqFw2su+HRkOCiZupfs3qaqUVNolG7p2f/QllO/jHjBSaoyDrWzU4nt70X\nSKk7WGuXtremIf80EqICZ+G+45Um19id3bbtejKml23K0YG4V13aPFCJQrb1\nuXX7CZMFzD+d7KgZt5hVskzKVapvtfS2Kx507fWUYWri+SqH3xx9hCFaNzEN\nusMgQb9q9tbLVMEMAMj07gsm/t8PLFRUaaXhbqJIPc0ctbYu5lYW66hAwyc2\ndFmuN8/2XsQpWIECzJlmDQCDXR0HOgyXwhzvvCsE1DBBMzRZFVsuByLUBSNF\nRinqkVWqZw/WMiwyV/R1mvCTGzvqCdS6ZlRfwTFa4wzUrAkFLc9cPRRoiK6C\nUtN2V7z9XuVzTf+ceEczxMjdWwOx2runpDU2SurHSSV4PCJ9ekeM1PQBb8nk\nZUn7OBQY+dCgawplw9qjVAzXM21ZLeECKYDassmFWJn3rpnYnicpsI8I9Tmh\nage7\r\n=+aui\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3bb287e2739b62804fbce3007977f0629e2119ab","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.1-hotfix-3bb287-krxk66za_1628085688216_0.6207104256927842","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"adf425763abcab399e42f7a1400f07129aed3dba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.1.tgz","fileCount":153,"integrity":"sha512-CgRqYOBAAB35N2i+oZW2sXUkrp2Sg4QBpLBKqfVyaOVPDnWt48Tqd3IthlQ0+PPvqt6iYJ4e3ADx3yu2k9ZRdw==","signatures":[{"sig":"MEQCIBKP16uKB8WVfRnKA215ATk+cMmeAoBR4VjNX+//gBveAiBber0rcp6xq04uixut0Io/hiecTGFhb4IccmTgRrD9DA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCp4uCRA9TVsSAnZWagAANzgQAIeXg7m0TNVj5FJyxFNu\noIIHkFDEB7Z/IQVXTiqfJ8w9DQBaZVqlzHhFzGq858MPlgVb9s+fKXn/fsuJ\nMiZhRULKvaExvZQjUjE6lktltQpotTR9HvM3tRoNYH+Pd0ZR82oT+W3FY1Hh\nAJUlSYmJPYooyckeDmgR18p3vDpsWHg0Q9+3JvVqz0eveEore9vWrNLGKgHc\ntnA+OT1jpO/r0W+YcEErcR3SBzrca/NCc9IFV4mShQRzXMyX67hfgprBvTAC\nSI/r79Mj3gLe1++iGkZa1xxtgaDwq9gP10CExcJjXzjhigYNUqCXWJ8l5mr+\n/QiEhwGvlG8VC9fxUy2YYzgFovFnTn0rBlVmTz0JU8HbmXstx9YhuEbutdIB\nSg9Yu+O93rjzQe0nzKEJAiWgM3h+VQBImrUhtjCHW/mf25tAoBWTRXf20Taz\n6wt/99SvtJJLqZ5zVVpGXdQVZTsKHxdzDMA4vYqtly/POnhmrEjNdb5TZ0fX\naruu2UBF79Ny2NPkBXoExgx97ce5axA5DeRnwPRygAeBtD//YDFDP2scKxQJ\n+snhgsHKTmwJBBtcCgz5TIMIWAAwoYXrRiR3/FbMjTOWgxWQk/mQdEv9ER/9\nMsq6wmi71PzFQgVuEMXeRVNw6qv36ihIi1RW3fNhAXOGaNCYwYs5lxJygEdA\nTier\r\n=UXCS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"5e2f4277c2910d24c4b7237514c54114a3ae0251","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.1_1628085806168_0.25496014167016057","host":"s3://npm-registry-packages"}},"3.0.1-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.1-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.1-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c5b7071f4266a595d9f6dd97148741bfd39c0e99","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.1-beta.1.tgz","fileCount":153,"integrity":"sha512-hCsxaQnNVFMf9Y1SNzJqssaiD0nUqw5DNOZyV81sI5DoDZU0/ZqZ6E5S/1mOsKzesSEbLeJ9yeVjyFtfuSfsnQ==","signatures":[{"sig":"MEYCIQDLuUJUBb+jHdlAxqGOcsA8YXtdkb967oTBx2+es/BXdAIhAPdYdYZQUP23k9NoB8c5koFjUrTi4eYr0342LyOkCk4Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCp9SCRA9TVsSAnZWagAA6H4P/3pnLXxfZniRngTIU+Pg\nq97Qj7NKeEa0ruX2WsxBauMpkVuLq6PqK7RI48yJe1magr8YWZzTzVaNCugb\n3OljiH2RJ2fqpGt7o9gMAP0HGggukCQrcMknLGM5ptK5aQSWw3k6NYcFJ5Ns\nLdCBHVzmGKH2vEDGbG39qSZmytVM2EpBb+2Q0h2CJ+cPUOypSr65HuovGlbP\nMUXe+Nt4JgECuQekjdHpMeq8l1X3/iQlRweDdwJxGqZzkx2kVjN3NXog2fWW\n1kuujULrIBGGSUljtdpdLfAIZKrGFmx6mJFDR70TufVzkQsSvZwlFw8mq85t\nhM7vtUZCUCr0n6/PWQ2MUaLSXGhgDR7z4b171pPJzOsLyLPdhYHxrvKOuWlD\nduobLnGLlSvAhzygIiUVMvU8nlPJqsZrYJ58O+7oXs1aq4/rob2TYjmxmpCJ\nMfKpgS7okaBVccRklhEbFEo+wi0SuZdhHzVeYQztCtrlIFSjgpCqlK6dhAul\n3bWXmequ1vNseX5solIsdfAskWw4bqYWvE17uBXKqhUjHvnIw0+QP319PgiV\nVXQRhbGyDHNiSw2u8D37RdQiTr+I1R9mtSFSPFeWF+GQalI0cQJz+uXC4zwM\nvo/VNsZPQau+jd9JI3eQpZbQuMhQ7cu7U55eh6VMU/YbIkRaxT71Z7w0EUPY\n8WON\r\n=glVa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d136b6f8533ca6d443b08495dd8da8b14ffc83ff","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.1-beta.1_1628086098614_0.11605696540754096","host":"s3://npm-registry-packages"}},"3.0.1-feature-1700b4-krxmvnjb":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.1-feature-1700b4-krxmvnjb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.1-feature-1700b4-krxmvnjb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4d0287235c0a0ca2686b5bf3a5f20828948c175a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.1-feature-1700b4-krxmvnjb.tgz","fileCount":158,"integrity":"sha512-9E+LmimG8ocFrkOvPlrkzBaRHZfuOkvE53wZ/LJROaAqZ11FYokmuVC1pJzKI4X9YTmczMirfvs1z375Jlv8wA==","signatures":[{"sig":"MEQCIFzUjAB3u5/KBr08ulD2szwLiSb0sA3v/dNHma2Ubl6DAiB/s+5m35yLRc7dG21L0a9am0gyaHFyC2ZET+flOEgdVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCq+BCRA9TVsSAnZWagAA02wP/A7U56OoWFSQUsk0foR+\nEPFyfyYoHk9JFOtK/rZMyEJD3CL/hnw+zKLA2EpG1q3JcOJt7/CWfZYC5SIQ\nYP5t3IHUxdR+SiT2iNHWNz5GArdg7cboKpdDAb8nzbGfOnCAifxmcjgGiqH7\nne8EkjF6lH6+m947w30wKWrjsHz2I5EiP6jQmI9XKZyINOnia6vTTcObhxGr\n70rmGdtjGy+TjmBqnE+urUuq9PgdP7i7TiCVlGo3ti7p7HPT0b2gxGlSkklL\nRyBzzNWCHD/PUydXCZisYTGxVUxQBLf4rjLnC7bhiub3h0CiNHqIgw7Hx9rl\nHsqK9tlWkPyoyDUcb18thY1+lkMR0LF/sIfpRXK4gKThARmSwbgC7Jrwt6A9\nPfTe5TWMEcjYHsTH4MesTezivO7FfYK52mp5kvCegP56LFRKATHngSBci7o+\nn1MYfkPBplJKEyN8Ufiy5NM79WEjrbp6DHWkEj/tSJTbQj6/pO3Em3vQ4tyh\nRfot0zAJcDLY4ZbScqIwetibipzwRiGN2YtzLXoSM1zT1U2D814RcmfEe3dO\ndJumPqFemnW3rGjewurJuTzIunI1dIk469qg+TzZeaQ1t25MjR4FzWZOZBEG\n/I+Ha1HKkxhAJ4nCrsVypDlv226fta7LTMeYAfzBaq99DoNBdi4QMnkaGN05\nmfsp\r\n=+B2w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1700b4528741c7ebc7bc6a377d19fe3351b0b44c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.1-feature-1700b4-krxmvnjb_1628090241752_0.18155579816821743","host":"s3://npm-registry-packages"}},"3.0.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"21854b9062351dcd334ec390d2a9fc616b64c2db","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.2.tgz","fileCount":153,"integrity":"sha512-TwWpxMMB0T0XUiuxkGsfA2kx0j9KkH0Rk1pjXSzo7e42jTa3IIGPHp9WyZ//BadJetAegBc/YLmN5rsb7NxIIw==","signatures":[{"sig":"MEYCIQDWR54bO1F1SSh+8VmRJ5PdzRSBkY62vltr30KN3+OlnAIhAO100Qczb+vg2G0OmcQc3o337IHZPpu3b87xveiCKNJ3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhESZxCRA9TVsSAnZWagAAYjgP/2NVlEX7BkgAv3PCdH29\nMPzKyQRFP2rCLXKBix5Tb+hrMWCJE3H7p0SAFLECCVXknatSlvlIW8dFARbh\nSypTWCBGovefJ9P5ZMTfRa1YfJMWYPHO+5qt8n5AmeHcZd+A2/PctbhPt3As\nGBR+esoyga07TjNIQ4IVQWApJwdFYj9PA8hIba+hdIb0ssFFxCIQ9x/fknt8\nNjB8ck24ZoazL/G9hpTrhh0I3I354DlmuKXCnaq9KcvQkKbxj+Ygq9j/YT0s\niHXDQlPjIDfGrFr4gl+HP+ROuH42tddBAu9FP8gnMelPSU4rtBv6UW7B+uWa\nGlcOAnCqVw9N5BXPYED0F3ARkl+aLgyErU40163h5TC3UxOpkMz0e5yUe3kN\nIsVgVO+wTwtUHJKFGV9ra/rlMct9HOEIi3F2itHn3ZsmfFF+gvIgg/qe/Fai\njcR9wY7EWtGCxdgoLkC/y5fPDSc53rpv0xsHcKNnf5CYKoq/SvmZ63+HLTid\n8+hSHRQqLdfTsCoSxQrHrCT7dRMI0ZVqEO3+VMZ2JeS2y0y9/qWn6qjJ4tBn\nsFThcUyVAfZbaUqd6eNoqhzQp/dcXSmzTg4Bcnz0xgmfoxQDbWl3q+5YmkZs\nMDa8wxj86h6/FhygnjrlkVqAotUkzV2MNR/aIbA5RLNsrqKmHdJwd8AWfjO8\nB4mL\r\n=d13O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"0f93085736804241c3661b98969e5d1ca8556f6c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.2_1628513905249_0.3610078310862588","host":"s3://npm-registry-packages"}},"3.0.2-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.2-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.2-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f5b8468f64c6c42f8d729333b4f15d25d13ed22","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.2-beta.1.tgz","fileCount":153,"integrity":"sha512-N/YNTLH/alVaVIL5pFLSe7bhHcuFWda19tHovoXp5PbK0GgUitZxtNMYhx3w9MLlCYUJiZQz0noztDYNttajRw==","signatures":[{"sig":"MEYCIQDxLQBocKr1UNhveVW3DAjwxkBPCKJCXfHxj2SIV4bCPwIhANiqs6SWxX2Ti4wO43RK5YOE6O6bH9mta5Z6zQnGCf9z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhESaXCRA9TVsSAnZWagAA2+IQAJYnVf9ZeeWyq4BekV+I\nMeD9zt5fbfTAM6O7GzhIu0O/whxecPWqz0KUSTMimKqIrBVItA/VZcmbSJ0z\nt9nQyYUN8llyjuW+0CNiY+DftW2VX+xiSZr1hIHnU0GXNXiTe7y0D6Ie/Frz\nlJFD3Lde1hZHEXC28d80tfyoTDKE7Vb9kjbjl5GrfrjQl2RoxeiI7YnUoUhL\ngWGuPXB8ELA25S2JG7jkddGchzCyq6fEUsO7rLlmaqcLuFqUSMXgquFJAaoc\n7e1lSVrfzivu0ZFbQgOhz3zLtrOBt9dtRTeOHEl3Hc3w9HH9RQGsMneSE7yF\nWbLYULkt6p7QNVj4yy1gu4ZH/6xhXqtM9L7tQGxeUmM4fSA1+MyLwcP9ucm/\n8KWTxdulvUxbC4yTYvMC8cVED+W+5tawgmlWMPexUv0LCdbbYv+xqrO3ETGE\nUYVdn0W/I4Gz1Nv0whnGh5BuSBzqt/er7xdz8MdTXZAEcgB01S8buoSmZZn0\ndcGL8lftr/6b25kyE6jcLd6CxwhnjrqxFIylIVH417a7wI37yVbITSak7rxn\n3+tve++QxDjhMvHB8WzrUQcjPahmp5s11ySqBh3ijfwPgeG+yXTGr4Cfdzl+\nuPbgMqfRFGi43kIDpxmO8m2gb+FVcHXWAqT0wnmTW3wGyzgIaeXINa4iI+jL\nqZBg\r\n=Y1f1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"837e5d4922f07771da13272409ef1a04c5cda9c0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.2-beta.1_1628513942974_0.5623234892168323","host":"s3://npm-registry-packages"}},"3.0.2-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.2-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.2-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b2e0a577bd5fd24ce7a3ef5f393fa98a98f5c16f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.2-alpha.1.tgz","fileCount":153,"integrity":"sha512-YYRVaWPVxOj4Eos+bAiGNLwcZXRIbyREDGadbuXabIS5x12HdgOc/ay9HqLDCRzztSFpeEptCTL4XUqH+Up65A==","signatures":[{"sig":"MEUCIQC8ZjwvzUcQjoSU5ede4WDQDv4+PGv4OPcZn9G4Y2tRCwIgYfuz9G7w1SjNbbZORPLCHh1T2oy/i+U9Y91UVL4ZVG4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhESbMCRA9TVsSAnZWagAAKSYP/jTAInjtiNmc6AFiSUN3\n9d9K+7lIsIgy5tRcZeUtoqoP9pSIXWtw9z3p/sZ57eB0zLQxpSdJ1CRTKS4j\nVfWv/E30slaPzIb4kDeWyq6KZc+qAM3hPJBFLnmMJs4UI6gjCHJ8Z9KmlwoQ\niGoFg3D2qk7pZ9dANNfVMnYzdirPVC0BjhwoimGAf7J3x78+pXRqKPpkALti\nQq0SY0UHy86Umj9AAR9/RHBX9klgHmj3YACxVApaFzcPa5/MWhP2/AHBM8wC\ngyhyGwKXlkUm8MvZEdPiP2oynXzM54B7YHaHcKOtMhiLvwi7xKqhOa0Cpvhs\np+DR8F1VhHvluTzXUdYg1wgvtd2EpsZvz0M72kfOi0AO13KOmjcFe6Z6hvNA\n27IiXcSQw4L1dfiG9ESTJAhya6EyFwylT1IGANFCQI6LtOKTSlw2xIezjYka\nnzL6kdp81Jj5826TOlO1Jld5oRfLEfqrtLkvKBNAQzUP4WdUWLvZ2FcDvXEj\nrmE2TY/XH8SwHQjcecdtz/q2YUxs305bJLpqkvJ49hVlr+Bo6x9N53P9t7Sz\nW7piaRe6hUFwpCHKsiiJ6AboAfJ+U5yXxwaLEzODD3j15+QVTaEbNL5R+Z4V\nJi91g3oCJq9F07Hck9b7peJiJcGU206jtmyXcOrf1TDx0gXr8/cEaUJTZtPO\nW6At\r\n=P1pU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e6fe3b313abbb5fa64fd7f5d1618daca06976657","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.2-alpha.1_1628513995912_0.5881618878523969","host":"s3://npm-registry-packages"}},"3.0.2-feature-d39293-ks5seqhp":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.2-feature-d39293-ks5seqhp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.2-feature-d39293-ks5seqhp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1e8a12f532756eb199d3435f129529ec657a1751","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.2-feature-d39293-ks5seqhp.tgz","fileCount":158,"integrity":"sha512-qWZC6gKbwiNtbo6n1OlFmiy4VDiK+hpZ8ZMeSrkeA+LlVqBQrc30YDzoBVZvygxEymhR3zPZL9J8xb84Pj/oeQ==","signatures":[{"sig":"MEYCIQCdVyEch/Y63N8NE8OdOqYdmuKIFt8MTTqjZRJCHWo+TQIhAIzkxgKP2B28wLpMrfBio9WKEQSJYsr7wf/PizLHL40g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEjVcCRA9TVsSAnZWagAAhAUQAJfUWwtgfuCFoIJ2OGGH\n8687JZgl/0W4ines6Q7Fr7Yv8IgkwnVuIKMatpPPX+oQGiWs7PzQMpPyuy4n\njyhaV/plAaGO3Not38yZ2KCuLZJGkWJzAFWsrxgHAiqfioWY6MQQoNbiplRz\nEhpQXnIIuLlGw4dCgLEEGHgRP0YaO9KUBp7vukneKg2XURNKTi12pKHQamiB\ncn4gU23ZysXXJ5mLfKVS0EVchFzB9SBQYS2t3cyd/V9KmzzF32cDihjl2HJ/\nJtmpKJ55zIhebd6bf7+Gdi0hZsjazmAAQP+sqf67EfzcxyxOysZ+nxLtQmnJ\naxMv64IfrnteEbacdGOhysHrFQE+cPtdUaJGjzLcPmmHzv2dF2ZcX1jWcU+S\nTpnQnVvP9QYb7V+Z4/sppNdCInp/W56TDAgO/97c+nzOvF+fLIXilWYeG+um\n1VPb4iPDz/1P9rAtkby24VzrfVzW5q+KwhXd5Sgu9ZXTyGDQc1CDMO/5eZmj\nowPHxJVdObF2qZB9pbhcvnpngGn4xNikJiv44oTRkRb3jJRPAJ5UNfNWTfHd\nw9qWlkqbFOQo2M1bCGKl9tCr3pz3Ophg2F3VSQzxeVu1K3vr6KX5bqHHZSho\nxpEFEj3GHA9fUJHdSq3noIs+icZv2Pc0RVh8QBurRRqfYEQeK4PpFLOEfXFU\nzQws\r\n=vUhX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d39293212ecb63468ca071940b2728a7065b2165","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.2-feature-d39293-ks5seqhp_1628583260397_0.8944164700272133","host":"s3://npm-registry-packages"}},"3.0.3-hotfix-57a74d-ksa79jgm":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3-hotfix-57a74d-ksa79jgm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3-hotfix-57a74d-ksa79jgm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ccacc6c41979706f7f24a63711485737d9d0ee42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3-hotfix-57a74d-ksa79jgm.tgz","fileCount":153,"integrity":"sha512-Vj6tCUYoPmXSzh8hHVvDdUb245OWDu1Uk8x3QBQYn9FAOVDVhqxWqp3W0q4mNxhJFbrIfvdNG0Lko6sfqiLLeQ==","signatures":[{"sig":"MEUCIDVjZN3qrEvGK4WrNh7896nwUkLDv49NWl/6TROT+3kUAiEA+o+cJCYyCn9B4jWOWhTMx0zmuQ27MDuw6aMRAJAQOXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFkeaCRA9TVsSAnZWagAA+U0P/2YCKEo4IrhaRPKCYhrn\nLtP88m85PRT2oxjeniZybLt/JgfDBRkauEhaB8drkTX0vQ3vWh7KC72bOR6w\nmCbbKTz04MSJFhtiZU304PkuZHQAVCfrPOEklKc+t71xPkFvWxQBEZayh//t\ni2r+2PWJWyuAksunyhIAk6Qqpn8n0itEmFyvJHN3nS9tUo2hIgBCOimRSo/9\nEFO6qSCRXrnWn/mjg5EXcYO7Sh3wEIuKon2tzKtMW46hrgqadIdb6+R6Ws5I\nbZKj+wANq7G06QFCyVcaWmSRNAIJFpXq+NXRA3YTYzXJx2asrAGufBYrdpcv\nvs4o3MQyQ3+doZUwqahNAo3DRtN4RYZoZI34/aOJhciAqPYWyBDx31ForcGe\n7CSAXqqYoY9+5CJBG5/xQnrFgtAqArri3+cL4BzlAaK2brNFkAhG0u0VYqHe\nMlMr6IFZoCmnNwxPp+2Q4V1ME+TZ/BPfcYx7b7zcUfRVyGrdH9ij6MrlvPys\n83xKkABPLIwHdAtIn/uXr3RoiTzJDhdl/WWCjs/gM79b0vkjPn4lQ0S9bPAr\nxSNK1xu8MDPbqtsWpZH9jRfdfi38FsHaKlDiCkbwm/abNeODDXblXx0cW904\nw30J+sc/IC6d0npuUIqjoG2YENlWu25Cp2Q6H/JePaAxEcFv/IMKCr14B4yH\nZtuy\r\n=bm9T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"57a74d35aef6d848d4eafaad4be2fa7515573329","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3-hotfix-57a74d-ksa79jgm_1628850074207_0.9529058690801708","host":"s3://npm-registry-packages"}},"3.0.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"165c9a66cb26378aec795c9dcd773bd9446ed05d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3.tgz","fileCount":153,"integrity":"sha512-TxgIip+ym9S7ole0Uju9kEuMtjsuGykjA2SlWqnX4DvWUnq15C4vH5AOKWeQIEWQY2deYo2wsQtq4yl2Jz4F8A==","signatures":[{"sig":"MEUCICjYxgiBA5ptbSyZauTUh6ttUwhmyhTcJPtZUty+ePOQAiEA7qJQZ1bIMODZp9y/5L28p+wytxtwqcFRpIbonVU7bio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFk0qCRA9TVsSAnZWagAA6lsP/1saOARfd6gjtk9NIr9z\nrIS6gMv9zPZ4CFxo2ZMvoBtPqe2pBEHY6mm2x56J24ahckFUhSGlbeGfrzUy\nVgVwUf7jqQ1E+U0Op6ZOX8lbT7wmn7qljFeK1Lmk3N0tfAxl65GAuctidkvu\nVlM9L7Yh8pt/FPvCFx998takCNSleTj0NPtgz1m+8xhZhPJhamyLXun8CrGu\ncBAY2QEHW3pny+D16JrEODhVX9T4LUgmknGU3Tv4rYdDxyCvFzgWp/gKNvVx\nyFjwH5/bY6DAUHiw+KADaSKZ8xYjV7eFC+S9r5HBrwVP4u/th9ToDznahK7g\n87KLWi5J7uEPMQZwd0pKSri5vmGXvXL4ZheQEn8PJTV89QILE7DmbxgZCBzt\nNZ9OpUnu86ydL3oGK7lOjzYUfEps7rUeL/8RwwxlKAcwhkhHG563fgAb1T4w\na2GXCZpXmK+4jzBn9zUjhI7b5kA3/7UbtascvYKyb7ldbYLsjTd/isMDRAa2\nRpGRPGx262wp6OGYTU1GzWG1cWik0kQovPLkOEo+Nl4Digf4CE9IU8Fu8m7o\nWz10DYnBAiyA19YsSEZoL/7czgerCY76xksoCvfZTPaTYjrvzByFTZz1pI7A\nNygeUuU3qAv+n77LU1G86quYU0UNtAHO6eqreN4qi7ya1jOm1OZeKrGdcMQ8\nUXm4\r\n=RJ4k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"070632de17ffd393e194b20e1576f450d230468f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3_1628851498639_0.4094153439222572","host":"s3://npm-registry-packages"}},"3.0.3-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"47558c9580a971c550c7d069f6d15c90761d77fc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3-alpha.1.tgz","fileCount":153,"integrity":"sha512-O1x9nT3YeXLs2bCiJsrjblXcwHsAgfFqTL5OnfJKzHfGlQT82NVLYQ6J/mTwy/Cu4raUYxXgSBlyPjAfItugwQ==","signatures":[{"sig":"MEYCIQCEBrJZ3989YVQNVplA2WeH5PqjbDdTnTqxmhbp2awR6QIhAKRzsnx+GFBHcWX0d60EP7XqvkBC4jihxZAbA0pTGNt2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFk2nCRA9TVsSAnZWagAA2H4P/1mVAcrKqfjd/XHJDP4i\nPtNwfNvv4JKtf2MNhnORa9u3d6+Q4aLQMLF7Dvr8z3ykf1JIN2ficUwa6WMV\nlHCsgyf7qQlTU1A8d8qM9EmYDZhOfLkYE6GmWnwG8MCl8VVvp1KMPHo/S/F/\n1lCu7KCGEkSBvw852FwJnByYolZP42aSSxofD6faPilwWbUQXVsDACa8wryG\ni/U6yjDblG3DvRrpAs5WnkfGYOfN9Gyd+eQfB9MT0QQreJfxUVIOZKjdRi42\nBkaCbHJyhEplZc4+e26W5ZIogdYlkCDlna7G493CH8ssPR+FpfEMVY9CJiDM\nFTZo+KY2Bf4mSzMk1+jB0KIIcsIW3pfk0X8Z3jyVvYaVXaQyiOMbx1tygY9V\nkcgNXGv6OC+LVFIA9PMUopldc49rgWgSaf7uuIPCf0Sq9fAHykDAmSCpdvsl\n4BMc2HxlA3jWitCvgfBwlAY1HixOZ2bwf+a91jSAH7FesBr2WWa7ryMvTysX\nuP2LIVLi2S9ZKkAYn5et246+SsbFP5uxNOiBcNGXsy73YSwj5ChSIOXYJGG2\nroKmdPS5EE1h3xT+9bNgP2hLsXsOpxmQ0a2K2iBJu8kSbqjmk3da0HL5KyaK\n1yls7LG39zsvfyaBibtRlqhhAG8MCjxE1aO7vBR5wvW27PMjtejFu3+LzCE1\nhsFM\r\n=+AvE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"93b832aa70ffea79bd6aaee5befe5258a212e24c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3-alpha.1_1628851623639_0.8130157216790785","host":"s3://npm-registry-packages"}},"3.0.3-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"375dab984a200f18c2b9c4a941142eb6397e2819","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3-beta.1.tgz","fileCount":153,"integrity":"sha512-M4Iqo0047v1Wvsq3VdNFv/4DQgfME9bHyF9tYWdaMs10iNDfnvmDc0Cx+YI6hK6crB0pzMsrtmmEmVLYk+ttoQ==","signatures":[{"sig":"MEQCIAlrUFiyz3d10yr1PryiUI/VcGd1esJfTlocZQ9ZMVJTAiB8jtk3xwJ/C3r5S1/zVfJdgGo9B+JZo+D2+K3bv19Ryw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFk26CRA9TVsSAnZWagAAH40P/1FWC4/5ADMNx5yIyB7q\n0DMd7wpPjAksUIujraNe/z2L8IdDGBgbyyE7w8W9o2vhxtm4WgiDZZGbwjhV\nXKDk92caUdqLjNjp+JX2AMkBHtH3I9m1KMKu5xcyUo/GQLhmwM4Hg+HRsgPY\nIFBY94hdeiDEexOptS4FchGIrIZTnyD4arG0WXCPmmIfvXA7AeJDhccZe7SH\nMd60aaCY0bwNkrOWBZzJ1IbTwWkoyRgJxL1Q1iIEyFUA9PxgW9SRwu1K7kmd\nmAlOrHTaqvqx/AAIC7g0/Ko5uXy3QFYb4etXzUhh3fOMkbI+qs6RTASRI0vf\nbXTS0MfRjqb0tVs8bG9HYcS33HOWjVPeHPrHudNROLDZzDsbM8FkmTykvBtQ\ngCF+6mewjiLYr5HV9axDhzbd4vIrUEeAlF4JGe85HYzB/qzKXS3p9gBDyz68\na7j2QkIntXKUt6jnJHNGKkbb2HKSBB49eHyBTzuilIeRSPwHpkZOGL/3TQ6m\n6OTR93b9ksFfw6U2kSq8/btWgevzmseIoltgIXL0gjJ/3rHQYs/9O6j3t0A+\nZpCqsIpPTbt7Ax3kDxJKD8UFTUbFJrEB1rxFnXSLhhXe92kIt6I89NKNQ3iA\nun4y4DOVfajmC9VkzffdzT1BE5EU4pyNVBsWhmnuoPApSAzlggODggShnWXu\nmDZ8\r\n=zN9y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3992859a30db896a82ea2f85c112f58bf1e6c03a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3-beta.1_1628851642165_0.03355057380756321","host":"s3://npm-registry-packages"}},"3.0.3-feature-ede14e-ksaencrg":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3-feature-ede14e-ksaencrg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3-feature-ede14e-ksaencrg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4c6c252495354e98e28d04a92b7abfdbe4bacd8d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3-feature-ede14e-ksaencrg.tgz","fileCount":158,"integrity":"sha512-ZaZR9s5/VAzYYbYtZbpAnr6/8dGnxUygnaQBKuWkbHmWchupIBAGnrZ0FP914IVJE4beIJT8bJ00pNON3yxBRQ==","signatures":[{"sig":"MEYCIQD1W7yFKJWBnwraLrMuGx5JGGQABO5BLaaOg+te01BGBAIhAIE3hLs/R2PcawDf5IfglX3l++97JZvNuDGWl+hWhdTX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFngICRA9TVsSAnZWagAAgmMQAJ8apgYsoGZqOFXYrZSe\ncJwgZQvhfxINuK9g1/u7uwwaYUkeU2aBbo7ecuexEeFqn9D8tfN9SuKxMPRz\nHRnSbfuf1on7uzfksQiZBBIKGsr4Hg8harRG9tqGFlDCOoTm+zrKVQLPyGY5\nn37v2CxtISuLhKoTO8bnaXOd6zLLMrbWoQWB0e7D6/VDVi6cXU1dUkmo5y0G\n81UChDjugEsNs1NEG+kDYt+nOYSeRIyFS75QRf+q7il8j08/qNrH4FI7CSRC\nIOsheU9ISmHt/hmt1DJkVWJprLQ2Y0rWxQTp3gMlN9vapbplz7eGti8im0/a\n9BK9DCChQ/MxtwkSL6rHugpnK6iOUYz49TXNDwqBjprMvNbKR8VmTT4yel/0\nUSbCfUuT7M9+xOmrdryOcOfxnOJM9galnKN9o3xY7wWU5Lk5gZg5fCwyy2Wk\nlJb3jfq2iC6otVguR8yg0HSlRA7G98iSNfzbKqkhVaM57htbuBpuUMbyB+kU\nc1fSNnND5FD/sL7PdkEaiMTRsnkUkaSMeS3iGKVfYPcyYgsxHMyV6iKPlUMG\n4iIzoH2SWkJppAimNXInGNJ2uUWx/MtOxxkwPhJZkebV5GOhPMALYtLyelTS\nX5ceVSpF7YMOX/QwIWmrz5bUCv9BhuFjmnoS6RgcOKu0KggCdjnQ4Zmx0Mfk\no2xy\r\n=+l6+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ede14e27c134485dce38c8bdf68cdba6230d24c6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3-feature-ede14e-ksaencrg_1628862472467_0.9799988989335937","host":"s3://npm-registry-packages"}},"3.0.3-feature-a4acb9-ksg4bxqv":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3-feature-a4acb9-ksg4bxqv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3-feature-a4acb9-ksg4bxqv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0cc0de55e35336ec19b5ebd29dd5a27fd2ac33eb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3-feature-a4acb9-ksg4bxqv.tgz","fileCount":153,"integrity":"sha512-yK7D9sThEwGJjGeMvfw9xsnXLHIXyY8DVCf74XN+6jWhbhB+1lK65AqtZxBCFVvAyctP7dDVWjBY8NlBo1Hu+w==","signatures":[{"sig":"MEUCICzS1wktDA+rlm3gLpIXLlli9p75jCyMOF0HnbIr+WeWAiEAwBic0TLK8Q/xvkIGr5NaBVeOnnwp6HxKg19Q3kNYetM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG72ECRA9TVsSAnZWagAAL74QAItRZKpixXXCRCxuwUJU\nHkHVgtfHigmcyrHs4yqgb4CKuPJrAjQuhWvBBbDr/JGxgX0GfhoR+XfNT7v5\njyGI2h1FT8dcfTceI0Y97R8+T/jIdVSOA+23gHjArDRDC61nWK6aM5k/YK8l\nclx71T4H2PdN9Jk+Dsp7vNWYVmGFHdfgDw4vguldgl9lMvcnsNLLXnsdK9b8\nAEx39qbkx+FpxdLDq8g3U39xam6f/OrhZsdwO3h/JRvBE9Fvuz36kJsJsnwn\nHSQeCB/aYgY8kNkVjFGbIOhHBqbHWU0DEUQbTYXtH7NoGIUJli6+WX4GnGY1\nrweTRrjxTR6v640AVL4/tvbaKxc6SN5+L8PlmXH8LbqpwFpLuYRMQ4Dntefe\nGhUI+XakqMWVyWyhaWiri8f+1NZRqpx0OmGbXGX9OpF2OBBugXSGwlYZqfqg\nu6v9IlwuIqyZ2IXhTK2f+51Ho/m0MqBH4OEuJgdeF76CKW+tUAYNhrfDMOeg\n0wd6prrzqlW8JCp6yIXO8tVU0qYE/5wkMGXaLd/bPx9E3ICjAN3HQoxcOOqe\nLFkKq/VCoOXvjC1L/+L0mxZHP0M+9Y3cufL66D1xw28MeXu5pqinvzic6Tzm\ncg00VTkQrQSw/7A3c9nhT9lpEEzkOrHdnGH1b+L992JEsGywmTrl9imAz0v6\no78q\r\n=gAVo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a4acb9c70bf0a09f1c89ceb64279397e0c542c62","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_missing_dependencies"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3-feature-a4acb9-ksg4bxqv_1629207940808_0.4556737264217008","host":"s3://npm-registry-packages"}},"3.0.3-hotfix-fdfe72-ksg513ed":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.3-hotfix-fdfe72-ksg513ed","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.3-hotfix-fdfe72-ksg513ed","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5a45d53b2a8d8c5c719df466014d13e82067b5e8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.3-hotfix-fdfe72-ksg513ed.tgz","fileCount":153,"integrity":"sha512-nCovEeW4Artp1kYdh25ljuPFCMIGxGEgUY1xDLGV9bLdnwJk33532JKiMvXHfw9vfpjzbCH2y7vKhX8uDyXwpA==","signatures":[{"sig":"MEUCICC3WJxLsauT1nV9eONBnonIUqOdYcH6ld3mRKiUCQGbAiEA0rEjFEWtY518YhRvS/c5JcY6wlgRjTg+NIDhjQvvfUk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8IfCRA9TVsSAnZWagAABtoP/jHOn3au8nxcvzDWweiq\nEOOCQ0NCWuT7amb4bwimMSrZEZMHuEpizMX6eWzWa4OgPsDB3uUnxYB1oYaU\nLOSg/cdCU1DDkb8ogLSG97QvEl3K5/cY4oJRPieeojV69GW6/xw54MweleOp\npngiM2L5AwKDrBY+y8M6l9GP+REtXif573TZDls6UDWQkyRnSfcMAn3WT0fe\nm0QXqHbvdST9+uNLAdqqzGdJITOZxn2Gsh7sxV/03PRfWxCyt6TnJ7YAHr3m\nyj7RFC0mL7Ojeq5E2l4fGAtkYR7PNMibF5JQ+uRRmTKvfRUwbj2jOurN76qX\n1Mi829MbJnmo+d9VFQv0MIiw5XQLVej8E9Bw88cc147atFLZn/4RKaauKaJa\nXUilNdLkUxdvo59HDgzFOb4oK3nD9KXifXlzlpfrXz94aHC8jfMMREP4VGg4\nSOYk4FgfuzNZs3nHguN7w2M3HhkS5Y8ROTSdH99WpUR/nwB2D4jbnaXy13G6\nfgIyZAbk1CPxpHjABYcduQ/h8LYPS549Vmv7Uvxk+8PfP0bMG0u+pyCRh4Ru\ntbOqSDUSSkxt5ws/0nCagTR0E795O01uXlAIZTpTB43LPU7189n7BvSTvGnC\nMo+3fP9sr5KmoLuX8kxHVchBdDf1LxkuuaCTeP+TE562KDYZZ53w3M/Ca6Xt\ntTbA\r\n=M7uj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fdfe72ff13946ae1dc216a0bae3a05e7171c5735","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.3-hotfix-fdfe72-ksg513ed_1629209119292_0.5265155676524398","host":"s3://npm-registry-packages"}},"3.0.4-hotfix-68baca-ksg54jbm":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-hotfix-68baca-ksg54jbm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-hotfix-68baca-ksg54jbm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3bbed83c275dd44e4bf5073e549c148031e1d62d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-hotfix-68baca-ksg54jbm.tgz","fileCount":153,"integrity":"sha512-H88m3W1Xp+zGg0hizqMTws9S0p6ikOVrGc3nom57o3suzTWi43jBw9rHjwPV6cIzT/Hj2tI4YV8mXG/2ueZ/Qw==","signatures":[{"sig":"MEUCIQDuW+YS6dJdSlJFgfPmyE7qt1k03Uu6mMBKwNlm8raLOgIgen/j1tGxqYSExOKP7LD3ajWcfBavLGDhvuDyId1mfvo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8K7CRA9TVsSAnZWagAAHwUP/jm87UpdHlxzgl6OgcVH\ncuUfnYEZ7K8LQ2ODplPFlbdVq5VZmqZEYKQVziwpnuRw8dD10T6z8PZ/lZ24\nz58C3K+JhMVSXOVXHymuLC1gnJcTgDWHY5Du9BAw4hwSp/URMEBmMTY9lfZK\nZpc/M+NZjJsTW6hbJ0Bq5Gf67K12UPEU6RIZEQdZIFnOGevuQt77ir3KTDMg\ni7ffzFaDtRtbIvuC2J0E6vZUNT4aib3a5AHriUP/ZJKoF/s14Vn1T8ciwZtK\nAD17nAyVRyK2IEoI+2PvahAlEXJ9W2FuscLmdCxTwJ4U2j8lrdtJre+Yp2S2\nLhysIoZAfrJM/jiRjAhUTBBSXe2JbONjR85V79mQmd7l85WkoP8KNeYRipPB\nCOmY3USG2Sv7q/nD8B98tOffbrVNBfdcIZfzNquwcAQo+xHtqyJJg1l9DJpd\nRyRja9R9kGCbKuwRGgTEQf3yMcJm4i2al1XYqp+sVM6CuuSAglyvhz3q0WGv\n+cPk4qioX9VrLLDvX/iINhC5JeHJC8AQ1t3afFVJP5MEhLhPP85ZTb7+/i/x\nVV9NLLPPhvAhdUPRDc2I6/Zc2S3XKtNAddqmOFLdfpoPG8dC4PhXvNEGdKQp\njrdKGNR1mYAMiSNNVpX4c1WHjFM93YLnJWe9QSn66ziORDc/P6dyjC4SMs6h\ne6uP\r\n=DUha\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"68bacadc74a7e0cb5d8813c5f5780362cd24f895","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-hotfix-68baca-ksg54jbm_1629209274834_0.21638672629096645","host":"s3://npm-registry-packages"}},"3.0.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b80df8420604d7dd2878f6ba3e28f2b67a3863c5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4.tgz","fileCount":153,"integrity":"sha512-9tXV20oKlR7VIno2/bsNc2/fSX+Bwmht8osgtDFtRXPmKuH7C10swjUhyhn2K9aaIh/k/HvRDtUGP8QDOv6pxg==","signatures":[{"sig":"MEUCIQDMAArsH30ItftBy+P7nso6hdqcOzVTXmkWZXMfiKIODAIgTgT4WDn2lOozGALeXxF7pBNYatd0429QmIDWihmbrZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8PmCRA9TVsSAnZWagAAOJ0P/Ahhzn/0gC4CD4/pXlE3\nejdbj/o8TImKhnv72rKW3iX82FP1GlUIJnK6RmHQHXive1s3wUbonWi6e4Rq\nIpIaD8VfSv87ABxneln5f5a/1zRHQqPCpuynz3IDm6XVY2VNChL9eJWWrOOz\n+QtB35HhAeTeaiOd1W6SdSPyWjlyLsCLApSckwo4bpoLxMd0lT6E44MPS4gY\ngeCO7TAHb2qtRsUgk9IObpK5OrPJGwGFCj7s80fGNVDBPFRAIFP38Ivy8/1G\nVtn6KpNQHPGwu6TFqRN+i/NV9mp+0hDS9nTuGU3pIglUk7vS1WcS3llwP5AE\nzSD3/L0X8yQzBO/DV10DGotqg+7fOyFiW93fPtCZYEIHIxdsnFMLLnGX6vPa\nUmKZHH5a5XV2iv07KRLtVCj4Vu5pZGy5ukE7wrHzrqTTNSS0nRre0L/5srh0\nhD1XhEVSVoVbOoY8TU0/U+84nO/n2OkxbYJvJGpHGcvAk1LN6GZ/0hf93HuN\nwiO5kicb9OzP5ufVtP5N25f+aX/Pt25sb50dBdPBtl6nxAkqd/fPdpS+CedX\n/kTq78xpwBxX09buVPpYG+wWEakU/txcJlt+Zh4/9VVNsghCmz5aV/kgH2+K\nzYwC9UKmGdYGPsHf1N08D5vs5oDm5I+VyKb6uWjAIbHj3BayLSTQKkrcQqps\ni3ND\r\n=ETZI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"5e03d3aaa28dda9e7651d5adef224cd420447baf","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4_1629209573900_0.24424767995703167","host":"s3://npm-registry-packages"}},"3.0.4-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"95331b209eec7949dc3d595fe4c8600d062f5bad","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-beta.1.tgz","fileCount":153,"integrity":"sha512-ALIiVsvVfs/Mv6dFMQgySUQmK3lqeQ72mhNpN9dhwXUv0OLkzQ9v60kzgOKyJ47+t/nmGHplBfd7+Yxf4CZ3PQ==","signatures":[{"sig":"MEUCIE6Uop+nQjphYn3MzH6POrTJ+2jUwM+3tsfvi0pI6vhbAiEA/FePc/C/KqZdr0VTfaZMc4eMGriJ+0gEMKDAcU8TBG4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8SjCRA9TVsSAnZWagAA6XAP/RXA2WObHk9okO2z5NHb\nwbSqNm4te9XndwouhLFXGGCRRRQA/MVMYneWy6p1IQkyWQHZGz5rmuYdraJw\nz60rQoNV/gzmFacsWbQaWUfmAzRMzirtcDraMUT2nRda+HiTpnQ8OhOLKor9\nPRBRdINNKlAkN82CiRecp8Tl2kb7H+GwhYc87aaXzqDwPvvgV+0CM7rVJvoh\ngkuCQA14CmXdZn+t0fvt/+93SoTIDhhzXfGtg1+/2wsrSjv8G220eO+SXMnQ\ncxLUJ7ACi6mSJSor+NfAE8+CiYTWBUvw28Fkxodxh27E6PFHnzgVjCN7KKOi\nPbdIeNtF/Hi3U1n2GvWzm0N48OIe15blGhYhR2TzabizTAOqChqaGzVOlpUh\n++GME0B5qcwiNDVjVDSGtd19u1YpTj5Fugh9PllwSRU6AclPdXnEmhxDS5EI\n7JrsuDpT1b2jL+FUk2MX/Qr399sZc4IDkUNz8GMEGb3bhcLDqw17r5IdmuDp\noHGRFm2L/QWIJedfmHpxb5aHtcm2CYN80kN5HO9uCP5Sd0C+djRwDlT4aLOa\niWS88qTC6eU67hISmn/nrTYgGHdypHG0ys34yrfLJ62B8+f/M2nCQq9R38Zr\n4MvPOkDcrcjuVbzEgnBBTmqQPLgzj1eWiINmTPVn3+VqmpKNDnj32j7g5YIC\nxXJ3\r\n=lB7e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"669891ce17ef6196bce56d638ed647310c54a62d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-beta.1_1629209762980_0.7415244148183344","host":"s3://npm-registry-packages"}},"3.0.4-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b0cc7351beb598b7eb572e28b9bbf9d7c5be0e59","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-alpha.1.tgz","fileCount":153,"integrity":"sha512-dkhg5sbhWn+I5rGLVAIik1+NEz+GzixmUBf16ITtBuioKC7nybu62AwYohiXCPG/aO0zGDvt/GbzWxBpYEmp3A==","signatures":[{"sig":"MEYCIQClpZ+5AGZZKLIGRvB1ll+6z/QKUlwJ9rfcjIYtTE5Y6gIhAOvRBc7LgitqT1TBqYcfYzwgnwER4qpNpwxLG+m+T+SG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8SqCRA9TVsSAnZWagAAKO8P/iGkjJUkM5FTrg09KsMX\nmJqht9sRl/xcyVxBVUTklLoaOIjaLZUaJUHdR6KV8E6WtLKpkGto9d+05nWq\nMbH4DWQJTMrG9ELgT2mA2u0rPcenvHq4sSXx6K1MaIBc9XEE65O6y98Ylt42\nnpFzusRGXbcdK0AcvqFNe5l2oe1FNGGaye01sOl0seW899GtXJ3PopntdrrN\n4Na0TzjlZUsskQbtnM33b324EhIEDs5zzSBBjOA4at+s7KLAcC4fXgFFnO24\nQ0YcVSqYcBypNlczw4Q9Vf05RmzOHt+FSaQ7SGY7r/HdzgB6Gbe8BSeKI46P\nvwpjlms3RgkzhDeZJh5j2/2BkVblKU/EW9vR7ZiDkkYK0YILeiwmfcDxVYND\nxaEB8IgGzAoXb3LtGDKqH6MY2ERgAthAqZBodk52VpZB8l4Hj4b3iSBlbwtH\nR+wOSvmeaocP59CWauCo7R+i1oK/DXvRDujvV2NKeag/geTwNHb7FMjzb8cR\nmuggxcWQEtqSDZRWtuy0icPxzI8iR0mzXjEMZArmOjVvbqoadMoBOnMg0LLg\nmtn8RSifkA3FGr7wzQHGberM/wzwCZDz5TpsN91ymZEZAJzdw9tDvwCTJ7ps\nSb87t73R7sjN7sFA+iWuBgPYhDje6/xIPWpYPenhcCS51Ib0QPuFmAtm2Bij\nPDSa\r\n=rzh1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4ddb5c732c25c9fd2cdc1c12f037311901166753","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-alpha.1_1629209770365_0.44284338749247687","host":"s3://npm-registry-packages"}},"3.0.4-feature-9ab6a8-ksg5msfk":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-feature-9ab6a8-ksg5msfk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-feature-9ab6a8-ksg5msfk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"20ac300f59dd3dc8f015fdcff926f03f94435334","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-feature-9ab6a8-ksg5msfk.tgz","fileCount":158,"integrity":"sha512-PNqWK6LFFN2fXxdbefoqPPzYQAU1DABuy0eKGJE85pZlgyy/s/haSBwdx+5Lq84K2vUDLg31/EIUPZ0wUeTmeg==","signatures":[{"sig":"MEUCIQDz+Jf+XrUxXUsFv61nG7c/SjzMvy/pd1QNbhYfmAIzdAIgVJKpyr7fmvFuah9bxA9bcdCTpoKOFN9ZBkKnRA/nCcY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG8YWCRA9TVsSAnZWagAA8LYQAJjxs5cBILnjTCavH2xi\nXVR4lubiVVYKIV5m5uJl78wXbDIBpbCmpgzoEvtv0SJ2gQQdQZ5Sx9ZDwQnB\nih5pt3gp4+YfeVHso5YXjmvBj8i5pNNqXh7JeUmF8ePcclMu6Xe/NK/msqmT\n4GuDp1UmqLxGXLZKhkMJrPQgV/QMjmDF3orLOvbI8g+k7oDkdFEg4xS50GXg\nw7o7tjYWtVja7Up/rDHzljz4AxB3uzCqqfgM4CwO2sVQdqyZYbmeYoLzw87L\niOdHqwR9voulz3ioeAbh31PFwpW3UB0KsNnXjVbncupRyuLiDN2cnYqGE1A5\n673tsm51Zc5Nlt7i8BVQwj96T3C9KT6rHz8I2zIvVDx5xKKQRFAJRQcSWDQY\nA5z8XJ2CeqDgZxHWlgMO8nAJDIBFXlSRAGfR9QyPWoYfiUE8qaAsVQbEYGGe\nPYmqkd1nZzSHTETqd1e8mv/56qLdpqtJD9iFSnx/1c4ri4+XQBcvasL3mrRy\nlc2PnYGoqyscepjVm4Cv6NpCvyrxXAA2CwOPMoDwtziXW3zNZR5dSKCTXuZ8\nG9nr1+xGT9DVek+INRt6okuXwx+UPFfR7u43Zy+zv0duC8RBU0gGIeDlNFuj\nRGRDZDFg3JErsDdaYkbJEW2tBRSetQTBx7jRdfGTBJfZgax8b53e5h9Dza2j\n+gOQ\r\n=nUcr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9ab6a8510e5cd15392c5516432032689d96d781b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.4","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-feature-9ab6a8-ksg5msfk_1629210133923_0.30913141479793804","host":"s3://npm-registry-packages"}},"3.0.4-feature-2e967f-ksizstfg":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-feature-2e967f-ksizstfg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-feature-2e967f-ksizstfg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b778bf1c5d021033619545c9d3828834256d116a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-feature-2e967f-ksizstfg.tgz","fileCount":153,"integrity":"sha512-/1iNmDSKYIAqjz46flBJnTErA44WpSXAL7eEGU4JKYeDHjFCRDf5l9G8wsZbFQ5+drYoXytHpaB3rn1dAnmp8Q==","signatures":[{"sig":"MEQCIAE7p8NKovzGr/y2oKhU88lI6UgB09JtNjbCz5Aygi/cAiA2vyWJ0FxQhoFR3rFri463/BGjHC/evjzGSw8cKEziNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHmRkCRA9TVsSAnZWagAAtVwQAJbbN7VdZp2Kavvz4th5\nWq9iULB9u3gvbZzEwIskp16P+NJLx+zP4eDPpx9w1JxejeXAnPY6AOG16AS2\n4fi8DYQMYx+cKQCqve6bNlMWVbDG27D18hHDBx7yDHiufjvE/xzKl/ZP7QG7\ntoeoKfssBi5jANYVw6BOKx//vNrVq4W3nyXsX+CrLE+mAHDFhAckU4fS8maK\noNu+Fds3xQx844AHpXeMfey2vFqCxaA+suaYOHuuDi4v6IApXi2Zvs5rN0Dr\n7vnfWRj7Msap2kFAY/zLA5mfD0n2u3//N3/GRoW0GHVSnDJZVpgzyCVidXxg\nneRHBlZopZkj4wT8e7nGsMpC8MLiLOu3h32vLuGvj9sxdUKp/WfH/PDhRK8E\nIF++M8bj5F8PKeQy6I0VeaGE7HjuQHih0OehaCojRb1Ulq+PCvpz3UEW7SE9\nRaxKkQ/HPmRhvPoIqTEG1zMd2j6ZIm63AYRJ8RmkFW4zhe506TPeadio2sn8\nmmbSrZLbw/hVOqTZ2MjLB6kRqjjE686mom1FASkhWC5IYm7U0BZGXwGNXWKF\no7J4V5zonGepdoW/VYc31U7cg/sIeKA1YAW3YVSNiMc1P5O2pxw5oVYxcUb1\n+j6dVu7mdQhAGHkdmx2WlXdHvE0ZfMgbpZAESK/10TX5HfFPsLLJ9s5OboeB\ne0pJ\r\n=6Va7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2e967fabfdf89ec712b14bdb52840bd3461efae0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.5","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-feature-2e967f-ksizstfg_1629381731824_0.6363981765560618","host":"s3://npm-registry-packages"}},"3.0.4-feature-d9bcb4-ksk4p88f":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-feature-d9bcb4-ksk4p88f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-feature-d9bcb4-ksk4p88f","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fa61b9ec90f37d0da26be3af3e18f0b41f7247f4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-feature-d9bcb4-ksk4p88f.tgz","fileCount":153,"integrity":"sha512-W2APoBdXm2SLHsXtu+mZ/EkWuz8RZPnwuY12usZhd1dk0MM58c9AysSHVC+hm85R0Xub4w+A3vq9PD+TlLisJg==","signatures":[{"sig":"MEUCIQDOT1RIdRGJ+gvuibyWqnQFt1iDNFXcsEgo4SMJiLjoWgIgU+xzkAfeUz6OAAc1XzdElBCO2CHnxsQZvFCkDiJl2t4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH3DBCRA9TVsSAnZWagAADQgQAIqrtXdwW4IWjK3Knrir\nY9DxX0fYJ4oB+4849jN+xF3pf/+9SglwKnCq7CzW00W+1Q7/Vc+C73rsIYFb\nvP5sT9AlQ0EwseMQhnVI5V1BerQE/7Q4hp+8hNzwORoh8bvwaEEqK4aSVCuu\n4BHgZ+21r+ycs/jWzNFlf67jUX1uBjeMj/h/Lgh80e64Yvx8y1erxzdXUc1Z\nof13/zxIAQ18XRNRF1sq9dO+D7juQR1TmbAawMXaG+MQd+He52Uhd3HEXkuz\nfyejYBs4yPS8Mo8Cz1YwdoNmQjuvOlD27PxrZUb54ZjgE5zEtaLy7E37bmpQ\nK1Xv6SuiA03oU722RzMux94bwW+vdkYNwy9EBxZkUz3exn8TkDkHxwdOdfyh\n69BMEcfbdl83Wpolyiu3Z5bLQhI7N6m34SkK+/Qx49vhsCZBDqyfIkGZSukP\nXy7VjBonPkm9ud79O9mOW/exAF/3LnhKaj8OGK3LW9Vglzc8CW0QxxqX8x6J\ngJToviAyyXVIWWfxHTbAoG8I82n6Ah0B3m93qsqRXWzf/QfcumTM2aITgx4G\nrnyIG03MpDvy1laebok/91QaOpfO87OccZhc70lEdHaspqdGgwzJXBVR34V6\nBbCCB7Yjo4J2gLT5Oebx1EsbDiLa63vdzHLfSZnpPgnqXlOtrjWSofxnB3xB\nwZYW\r\n=zLU7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d9bcb4fac16833cd223dbef3a854cdb4f66a2d4b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.5","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-feature-d9bcb4-ksk4p88f_1629450433483_0.6279684287494245","host":"s3://npm-registry-packages"}},"3.0.4-feature-de9741-ksk99squ":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-feature-de9741-ksk99squ","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-feature-de9741-ksk99squ","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"304d676a461be4f2a54747bde4ff393a3787ef68","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-feature-de9741-ksk99squ.tgz","fileCount":153,"integrity":"sha512-0s2I7bgHdTjL8YQYQ/g7Zy8/k1zNKKNSdP0Il9WSVo5MHiX2a/qMYdncKcopgdgS1kMCbaKwZ2kTOQDaUuLguw==","signatures":[{"sig":"MEUCIQCx8lndkTOOfHxJf2RJymXqdyyoZZdThVG1EDVt1qEOIwIgeLp8cUQ1I1r6qR5/scnyvV5+imJeOetPKfYrh/gc+B4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH464CRA9TVsSAnZWagAALfMP/1ojNSHDFKLo2HfR4dwp\nyoRGl7vhHfE4HWxAK5tMjVUInOUNjHEIMBvi4rbMB8g/4bGrLq+0vAm24ee+\nk6Xw80/wQIC+hyKmfJnh2Z/PxKhkKU/fwaIXcTrArFY37Q6uIaFXTKl0r6I6\ne/QUc/QJe5K1b58agMew3GX8RDFSv8C/eg0tX7OJYSk0YNKbtelEadpNL6HI\nvqnJfpKk+xbEPEEpJIfDrdugqXev/DFFcGoFRV6JDUk12P6qXURJ1Z9H4W/J\ngkCpzQDfG/uBiEUQhM2E0eqni3HTEZgooyjgr/28BANNTdE0HfEDnkG66ktR\n/wjbZh8NhXh9k7NWjtrWMAxxVx5nXkXaILVQUACbjuiDc+4Z7Kk+OvmnLQ4r\ngv94+m71m/FMmlxe8rlni1hBLo6tEzLwLiKl7KIOAEYSnSXWC/9rPK28VQeW\noApF1c4LFWLcYKCVTjLPLqcnf6jWV3bknM7ojw1ewQ+OlfC/3dsPIsQS1C6Q\nCGJdhJk1Vf/kskklu/CtTil7wTQNAep3DchrEUliZtktyUt5ZPOv1Yr5Y/u9\n3/uAmmwwKkq0ygNHCMK7NV04eXWRXo0Z5Q1Gk30G/GKVnKRcsrVs6NvNQGOl\n77uzQo1OdyIT46vVRwleUqcNlRf3q6eKONsZABrweemS0XOgjae5eAQ8oDmh\nasKk\r\n=QuBd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"de9741e49bf2cee559be3343635795810c66949a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.5","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-feature-de9741-ksk99squ_1629458104167_0.7923003334608498","host":"s3://npm-registry-packages"}},"3.0.4-feature-e34104-kszv407j":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-feature-e34104-kszv407j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-feature-e34104-kszv407j","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"760b40be76720e71fdb149d67e8de9cf9f92a5ce","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-feature-e34104-kszv407j.tgz","fileCount":153,"integrity":"sha512-yw6LrLRf6wCXsMPjunLSIOMFo3EGVD8VK7HbtPSCAhVcpZfC5ek44VivOeVYdb1/g1jNjfuSIKFy2uxe37n1bg==","signatures":[{"sig":"MEQCIGAXvoZEdzsJExwBXPnHaVcEgUa4pRTx1KxRBPA+2VqQAiBYpe29dqWRmezNjS6P9ZkeUKmoJ0d3+TdAlg7Xv/Ytjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLfTwCRA9TVsSAnZWagAAUtAP/i+h0ORCkodJ8gUzUNS4\nQcstSwRctxsldW1vtKHY4CIssD1CbQ30ZaFBk5+w336cuNO55LkDUoeTFM9h\np4st6lgpvCTmoea9wPN3b417WpLFtQITBLkYmEnvYSCrcNaur/1wynvzDpjf\nNKuIXVSXL/sT6FBxOKKzPTcIunPAVZDGOdXhhdZwqVVK2CNyN8hs1MC/RLdO\nnnG1xEaK+3YhdYYpAHHMfbQ0ixQlWhlrVIqbG1lOqAUx9tiQjNVGAu7eiHpE\nHYCXCpMvzgX3Nc6Zoe/eQn+J3Oui5V0dvWVsJoRzcbFp6Ra3auaNxv8fX78/\nkqDmati/ZPw13YTT+nIkUZk4nXX560UsK8cScByUAJlq6xigc3IFYTCg4FPN\nZyXxULTTHdqquttpv+YdzgbqR9sLSLf1KwSNeu1bN80zDKrcCGhj/oESxCL3\n4MWLeId77xkuRKtVuNVS7bvYt5CPCuNakF4HtIf2uRRay48EwNEsAFoE6BYF\njzl9CV45GaCUKiAfxPexNagMlrKySWnVO+qlfM0R/g4sJV2Tx6MYwYT4MaY7\n8rctONm70W39Q/ZiMz8Gb4/cDoSH4vue9BX/yPcq2WG+2tgkOoQ4vJBoGDFb\nXlo+Awzm0R9aglwPbfKfLW3A0/pESSwyf0LN8NKnnDBtdRaK4K0ia2iJZWr7\n/W8+\r\n=Edta\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e34104a0c4e8b685ee8403ed4e1e2aaceba536ed","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-feature-e34104-kszv407j_1630401776103_0.495579448641708","host":"s3://npm-registry-packages"}},"3.0.4-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c7827852c991ffe4cc0c83f72f24e468e8ebc0c4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-alpha.2.tgz","fileCount":153,"integrity":"sha512-G+ViVa7WL3hSRBZ3WWH17gl0CQGgaXzi2wXqLtaocJonc4S5pRR2ryIfov7bwegcx/8F8D2AZGcw/fc5t9ygCQ==","signatures":[{"sig":"MEUCIEFxijAaT8pQqYp74KlA5cR2dVJLutadBFrZZHiT+rN5AiEAjYaZokT8kLYORhKp5nQhtifgHJcG/Z//JgXffxQ3GxM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLis7CRA9TVsSAnZWagAAbrYQAI7y5e3s5i42/KRwe5/2\nRkMH9L9T20JzsVOuDqg3VcfHD3NT5Y3Tz8hjNsOlWXOh4pvbjZsHmmyTLuLC\nu8cHwo7byPk4fiK4AdL1IfJvAl99VweKmadKQYDIFg7ycPa+sSg65bu6TkD+\nLMxGVhCBNbnohwUe2JaBrG7ofGeLt+KucCiiqOqusKqotJrhkqyi7SM1nwQr\npQWNDvmMX3/aG/SCRWTCcstjezVJmvv85qL0o3hDtbHxzT8DGi8bpxRTJrS0\nqNTKXnRFvRuOxNqaUvhf6eo9/9UEZpRJMvE72DJL9DVs1wnC6pI/rTZJqPB9\n1MvA+3DA3KksyduZ6590GCEuu7TPtELZYJPel+BWBl1T27Ny1kokrKPSw+lb\nhQgcHpDFIsAFMFGikHsUSB6qJoElvSPlx5lgWc8GUk38+1z4i6KbvDzEhtar\nGG38vA9HXZ5K24WTm0potOUyTSzoPHDmXDEAMGftGblw40nSihS7W+j4sHwX\ntYQMSQZWM8nIKi+pOyGNVmLeWnfJpVu0VapgU22O8j60R2ZR5sGRZxRSylu0\nqwXEIWfmft30suI+cOSY0p4D63IGx0zd8ztZJnL7Yb1xRTg9H1WCc6HjFh5H\nnx2sRcCS2QKhmA5pjDlWiOt7IIAVhym67wHJkJ0iBMGSYIBOYgnI2qRivs2V\ns+A4\r\n=sOVJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"65c1d5bcd869e04de249d420067828305066754f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-alpha.2_1630415675335_0.6795538698684274","host":"s3://npm-registry-packages"}},"3.0.4-hotfix-2c363c-kt07nqgh":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-hotfix-2c363c-kt07nqgh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-hotfix-2c363c-kt07nqgh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"72cd73a4bc659097f530662a8bb4f259c2e490bf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-hotfix-2c363c-kt07nqgh.tgz","fileCount":153,"integrity":"sha512-jTkJ4eO2ni/3hAgLK3QpW6Z1LGITQivU3Hxo/fn4trEueas6o/iK7iZumBVDgq7qOmac2cmauHMbyQQqPxMUNA==","signatures":[{"sig":"MEUCIQDev1AykvCoHagzqpgW3A6dVRN4DuCbwZcrXMLAIiQRGQIgD/G53DZkr5+1nV8Soc768XU8LgWK/3lZ168ZCsKZw+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":444426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLkdKCRA9TVsSAnZWagAAsosP/3PI05q7T6ZoXvK/Hhde\nP9xlGzw3VhHWmvwkt1p4t+Mvpp1hfGg1L+fu3e3l42Xq4zJ05S3W4gDi8cAU\niH+HWJrQG9hdk4CiphKrs5eRb5WsCZOkmBZSH82vDtUzAuWKEVLlurH7X1DZ\n4hDD5U797q8GrtFG21TXDT3lp4cx2XNWWPFOErPLLOOeCVAkqGOHx2kZ/KNl\nnoBcn70Ppi8kl4yWlwTe898bOYp6sM0/g6lp2IdmJp76f2EVrP58C+ijg5fP\nQj6mDKxSrH8HHoPTYSnDwXjHneOFPoKwrzrjVa96KRCDkqaBURIUwTjniWj5\nLCTYgwsFGT/IGgU34oiTBxvd2dNEasU2ei2T4kWgmZ7SX4AQDlRtV93TK+Cb\noUk+3mCnnebLNLk8YnHJuxc2/OdiNN+63/QJNqpKzc79x3DATdHVO7nisd4O\np8gQvpra2CsisebkMqmp9IylGeiabBGkactVpfpMbGODFyLaTpkQwSCUuGh0\nKHQaGxBIgVanhLPEznlcPu/FkqnVjuwD1TMIfWuret0WERk6UwYrakOskKtx\n+h4tkgSPGy5oWAN13BVpmG/LpS7Gvv1bSjKLiBpaJPJNeexIaMfWkTk4GC8p\nZJ8/BFy+blFf7ELhBkebQ/Nvudqv6O2B38J1J3fQ0QLuqmxPrsCW0UWKgys1\nfNcN\r\n=WaQV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2c363cbc0dbc27a4ce9d924ea99a1d11463ac409","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.14","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.5","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-hotfix-2c363c-kt07nqgh_1630422857838_0.11563813615314089","host":"s3://npm-registry-packages"}},"3.0.4-hotfix-766ef6-kt2praaa":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-hotfix-766ef6-kt2praaa","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-hotfix-766ef6-kt2praaa","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0f54df73bc7f9987a4fe429f005a9d6cbcacbc14","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-hotfix-766ef6-kt2praaa.tgz","fileCount":153,"integrity":"sha512-/WqHDi6heOmn8p7WiM16ND8ZltrkKwszA1ICqqrXfj9ooFId41t9PHvx5cvvFhuQip0qDSA4MOMzn7oC0SrssA==","signatures":[{"sig":"MEUCIQCtVn/zouBSOqZ3bOVAf2ilEhkztXlL3tXzJfWAR9j6iQIgXpVdcqn8iB3vUtb/h/4V9F7RxOFQTPwct/asbzUhAfs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":444318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMJZoCRA9TVsSAnZWagAAXccQAJ+hrJckcNdP3U1v9Yes\nnsCGBHBBX3YBZSSTTgGyDSEG0fVMWsIDAiDA9X+dRgK2nNUPUCTK72ljANKy\ngHgtHTK7k+0ToJA/hkg/hvmJ0sA1OZ8iNZh5Vy2o9ogf1qEXMZlsAnd18uN6\nDJzdh7YdNyVTHgeY7MFO2py8z9yXLFHbW5TBOfd2lUgvpT3h0i51KHnYqlny\nqxYYcIQdMAqcXEjD9mL+5haQfFElLt1hHgwrky9vDzvR0YUDyFiabK7JahDC\naC6lVFAmNFgRPfgPb/gNDrkK9W9zKR1f0ydrHZ01gzSi/+AUhImeInqOCO5H\n5nIIYE4m9YE+nLY4YUILwyHmpp1QVF2LlsFlm/0dozNRLEwdDfSMh8IEAwZ6\nmU+9KuKBCjjS4/9Q0J44MHMbeKQ4sH5DxstGgqLNutjzJHsojEdt0OCbfWIK\n929Pwc2dihHDAvGkKyNYW8Mq9+W8I640fXuGoNe/+FLvPODZWEG5RP1A0ugc\n8wayG226L3Yc7Oc6UXB+qSrJ6CI17YEGPzVLHZp6qXb7SFsO4j9407VNkKWV\n6LASOAygbPyivEhGWdUiKnTP39zfYtEdYgrwFqNexed9Eid6JjaC0EAkUeAp\naysUPl6zXOk672K9fXNF6h2xRXFGa+SIr6c1u3QrkrDuIMVUAtbzIefTgSxm\nyArF\r\n=Kyj6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"766ef60893041f9c96e2be0ead152876e8642204","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-hotfix-766ef6-kt2praaa_1630574184632_0.25854946198886264","host":"s3://npm-registry-packages"}},"3.0.4-hotfix-2cf296-kt2puq3i":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.4-hotfix-2cf296-kt2puq3i","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.4-hotfix-2cf296-kt2puq3i","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a09e61551677287edd7993b4a43c86e806bd2137","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.4-hotfix-2cf296-kt2puq3i.tgz","fileCount":153,"integrity":"sha512-IJ+IS5KDuWIQzAR0gftSkpCY/B27OJMuxqVTu/3Yu5wf/k0eMzjH8qFllqh8ijfgxj52wzujbdlInx3NPkG0aA==","signatures":[{"sig":"MEYCIQDFLpDazONvl4AlI57vC4rFV1Q3GWtiuTjKg3ISYpPOhgIhAMPRUs19vK++jMPHYanef8y/p79Wf/OqjTGI5UJAtYFO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMJcKCRA9TVsSAnZWagAAXsUP/2wmYXC/SN/yb7o5nAAy\nTXlG1J4BVNag8+2jfMZX1PxzR376oBBSv1St2jTZHvaWhEWCoUxJPlT1SDEr\nsTx5xg29lZ7PLS3f/yVBciPizCNbHU+2/mpJB7GoL57YdPtLWMjU77QJ1aOp\nif/2FfdsA9zmQsh25lP5rHI9xGdZeatMvIsNt3NSlkrM4KLgGbdnyAWCrnTz\nMaETtnlnDey7IirKIhAcR4mnXOAad74tpSYHD+lzQ7MGuNEXwLVABuf0TOOF\nk3vuwc1XJUqRXtJ4C1dWYIfsUlb588fCXJyKCj6qd729XV3xKtLSVpmF0MRb\nyxBpT6Rp/gOlN8FuH0IdbDYlorAbgteeKgiTipo15PZAukx/LNBmw1ZLfDML\nFpG0DE8HqwiOrowbOChAvBGlBPgudix9gBMvF2qfhpZLrv2KLV2kycbrDHKK\nx0tDN66AohJCyT3CkQqDbRnZepoe54Ho3QWuV4PF4zaQTJHyM2MEzkKzWO+n\nXAP0JA2aK11+2lftqpE2p/hlpuQp9R4ipRO4Jt6SIg0Dwdr9l+ka42y9Id3+\nj4iEscKIcyvu1qlCWa60LoA2oyXahyOLtP585axPXxng8fQx1zcmWrCPeAdG\nv0SXfhEW/JUimMfbzJ+kYkXFFjXPkbWtSPQpSZYGsjPXeHEbIxaQ40XBBGnv\nSryE\r\n=Izzq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2cf2963d34bcce66e9ce487d9a897b43ae04c470","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.4-hotfix-2cf296-kt2puq3i_1630574346255_0.3762522674694013","host":"s3://npm-registry-packages"}},"3.0.5-hotfix-8a56d3-kt48qm62":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-hotfix-8a56d3-kt48qm62","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-hotfix-8a56d3-kt48qm62","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c838c8d1cd413ed9997a47ff34a254cd27cda808","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-hotfix-8a56d3-kt48qm62.tgz","fileCount":153,"integrity":"sha512-ympvyP9ZwCaaUmoEGR6Fv3FSJLjAT5L++gSPfMH0f4NxEqST4HNzg/mbQExiVoHcjiivLPDxTssuNYSlu2AzXQ==","signatures":[{"sig":"MEYCIQCs6p70xqvfgC9VyrvYDXPhm0RLpBlbIFNYDv5j0uyT9wIhAKikuQ1KoylbvZeE0Mz6fGtuLNcsYYdSqKLlNBVg8WNn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMf8oCRA9TVsSAnZWagAAZTIP/2ssSa2F2BuFissYsqXH\neIVMtc0ld23bxsiopZmqhro8PJlkHnJOHom7/IrrmD1n960CSPvtatFhdX1q\nbEVxLFHa15t3gDCqe72sPABHz/57SbGoyRiBJUJ74BCMMFh/vYQ58xY/FDAt\nuhNfDuCGcl8+7EOiyUK8nnYL+67d3EqRjywsqn/YOU2Dfy9ld81ZKyYsOWh5\nN9Xq9wOEwMAtiKxmHPBTyGfkdsUg/lLTfa+A6EsoKBjm1uCWn7b9FDg6+m9E\nAXgYoCpasD3UbKhxBpzrAKgTRbU/U92TsdRJ7kuov5DnTku39/G+hLHTC7RZ\ng3SBlVPH4on9jj92rX1CSfXNjHAUeWu5bshhhFDK6wzEEy0kYsOFTrdxngHr\n4gy3aNOzNgdowktslrteHQ4Lr2xWDl2J/s+l6wL6DN1hjmo/b5ThKIzsapmz\ny+B55Db5J9FZ1pBUOkALsOYTJ7yOIa5rmu50WlQqMeS3qVsKe0+YrWZ/1bWh\npLGUQkpF855kqMf2otLiAAPmpINnsYy7rAGHI0N+VobQGbVqn3oxqxmCXf0E\nRCn1n6wZde3nFeGhwC9Zt7HIN0UYsCiS09d3M3gi8TjCBblKF/bU912N00o9\njsrDRIUyXQUzB78t7WRu6rsdNvpDS6xZdBgxnxYZmIkURkd9BTZcLjNejINn\nbFUj\r\n=uQfB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8a56d3e2676b3715f3f4da5cd89e3c31061f8e62","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-hotfix-8a56d3-kt48qm62_1630666536522_0.2920074718840431","host":"s3://npm-registry-packages"}},"3.0.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c059f866530e5c7a35d092b04851cd8b0fde6cd0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5.tgz","fileCount":153,"integrity":"sha512-90Fs6mbfdBkQL+tI2w89FURj0mUM0wx+cFJy7Fioqq1WsrzRrhrpv68cjKTlVqZkFTTHlV7HpCWv5q7CDbbI5Q==","signatures":[{"sig":"MEQCIBVrbmNNPhQAsl46Ddd6Bq2lI15bXcpYp1zVlvuRVog2AiBTJAEjPHtYxGrDAazT/S5pizey2eQWD0SYzXnOMjl+Tg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMf+hCRA9TVsSAnZWagAAF08QAJj+RmukLr7LCZwsBcWt\na0XtM9aYEj9wYTF9cypoiIO2RRngt3dY0fNSn698Qry2qT+zMr1m2UkWxcan\nq8yCI5hHQWlsEYSAvJVUCiKBUUaO1daG3TaHE5V8BaZrY84nAjbfgN7Io5UK\njzxtheIouG3SP4ROuQAAy9ARNYGW567E8J6Ea8P+kpABAIf3OXj0bTEY9e2U\nY31FRtT59ttUIJAmd8RmGjniKIQdUExs6YZwufPnrKCXeVBgEkDjhSTqXLf+\neZmjvW6yU8Xgq896Isv3qAkmbacE4pk/wFpbGV2ntrS/xGrWzzPTdkV4Psgq\nbwvZy0wPuCgsXKEJmSbG6I3O672ffOJrWeEx7w8fkIilJmSmKaxBtNJsX5xu\nGX6DnyyAX3rk7c/hDpCM7+pi4qYKLjsKn68s40a8ZqVa5bPohB1HQCRUclmg\nEqrvXZIezC/bBzvI+wHOycs+2kdM+pp1r5hqIRjSo2HfCAbbCp2P1U5kYObw\nBKFZ/8t0j0nK5fQS+g4BqDlMRgHQCL6CNJk2wD5gRp4WZzKW8c7KNzBddE5W\nyFTeth6lS+MbiZWAgenWiTKze1BJwk9zC/uludLYi6DXl6W/3rTJ0QSlAYNp\nPtf0eBANpbhZiV/6uhctN2JW3szjZINevgPEQCxq6rRFyOg2Drl1IY7HifMJ\nXguC\r\n=b/lo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"cb3a500e04e89188fc4533b11ac8af48aad1b4b1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5_1630666657613_0.3066322297534967","host":"s3://npm-registry-packages"}},"3.0.5-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27ad4dbd638685342de8ace7ec7d2cac1b5a6629","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-beta.1.tgz","fileCount":153,"integrity":"sha512-qXa4LJPyxOSplJ5jPJHedv2TjAg3Zolcf5QW/fQDRMVaMRrR84D1yvRhhdUBJTyXGiaUVffJrEjK7QuaMsys7w==","signatures":[{"sig":"MEUCIHhHxcQIJaZsx/+QL0L+aDLTFq2ntj9aa3MXZK1F9UiBAiEAlARa2PeFW+yadMq04UGw5tEg4vWt23EongNZjW3ouNw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMhQQCRA9TVsSAnZWagAAr0EP/i+b6sDxkY/svqLSJ5UI\nFKWh6HdcwBiDMqK2eyTNAoZNO6zcU4YiDs/rM9OSTldO1dHIAYWbk8v9CH2G\nTO21cn2V6xST+MRWwAPwNBzI085ChkCX+7n2CGfYO5LFBAYr3N1ZByNB7RWD\nnW9lThpb9uthQyE9GinS+YNPiLLmShPjR2s6A0kn3FI22uPW2U1BWW+ggVKb\n2ejJMqnzBCd+QHIVAJXAg8EEl7zOhYX0+hJxTWE8WRw6WlhoooK/7vUkfc0z\nDRRPcY03lQ0hAuO/KtfTedSbZqHS68hxlm1sKmrF6dvVihmuatJyy6U6QZAG\nt7pwRqHVrLi31p4RdX2VHNLoYiiFlpQ8g5OetwQIG47C52B4Izepqgp3sDrs\n5PH33f0kKgA7DSNCMu3oWNaeM16Ni43NJ12AQgo+E+6JKljsSGliVhSvd8ug\nGgojD4jfbffjezLZckEjivbRr9Uml2K1FtP/3hFwqBqy/ZEMhzV2oYtFm2FQ\n6UVfJZCgAPCCBmLUCooG/tfdLq2GsekviIgsvpPfPDFom98gR8H1ruqkmxFy\n2gJQ/dfn2mmAh3rbJLqJ7nJ/DQ39EPEMPxqGvPEIwF+qDdJdJ0OFM3cnqXSu\nsHl+jNB9e7T3c3QGVheMWnOvajKbj7dal/N7SONtC6Z5v8TD41Qacbf89Pzs\nnavi\r\n=G3C2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a46312f000ed58c26de7b062e5f92452ae7449b5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-beta.1_1630671888140_0.8193109558563192","host":"s3://npm-registry-packages"}},"3.0.5-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bb61338f6a618061c29d0cb58e9de3a62f27affa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-alpha.1.tgz","fileCount":153,"integrity":"sha512-Pbp6CXhpGgOelFJsuWfzUOgC7PcCUywbERMCuo5DWDph5GRKS8i3V2sslNHCHBhDPQDYUXXYDUU+dTXuCoDBGA==","signatures":[{"sig":"MEUCIBK5MGKseBjUPg58WKl4fWHoImiBPfIpLkB9eNg8V9EoAiEAlZd/2jKIcTBWF+57RH9klwrRMil+jgp3gA2UA0lapWg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMhRgCRA9TVsSAnZWagAAAmQP/3NGCSfnkIWT2wvXd/mb\ne36mr+8l+j/9pbohw3ieF27tJ48k4r2yTiq8W4BLqryKRpUTYpRVKGNxOhfd\nVn9Gm9cU32MbTuhKhx9DBkVdrUAalqwaylXeVRe/jlqhe6K+LY1P/ZWcdCJn\nD8vL9yYmkpRCrQBIqxXZIJBVGwHaPxFKi6N6VIwUnMltYEzeHwU62kU7Y0F+\niKQrRwxDa58cGq5+B0580hA2lO2L9VMw7vOo4XcA/USj06Xj/cJcuAXEf93/\ngdLE+8QgnzyBrKTFTr7WGF4x7rs6rQva9ypzgmEi8rH/bM+ZJX0HyvEAq06y\nMCKLgjZrk11Ahhgo6RiTj6NoRhgx0DZhBNLsnDePcx0eu8jDtXINA49M7RA3\n0zVBY0QodvieRbZYUx95VhrZHlyR38VcgErb/nvr3THigmJlatEr8h/Vf4Qo\nuo1sQr5c5huvjGz2MJB7CIWdjPy+mUpz39ALzT+AZPrK3858Tut3Jrt6oFGi\nOrmj/maTRcuxpkZno9wHkAE25hhb14ptzt+SlkqsnKyFQ/yAhp4UBDiokEf6\n+lsRFL/o6nXQlQudntti56vxw+eL3fkKB/DUkJpzy+yk8xYk11sJfo44LEDv\nZ7TCMF4Ujz6RR39WO2flLHGr3gwAMUhPmhNwa2SdPhNOSEbchNedvj6jA5C4\neLIh\r\n=n6Dq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ab40d3695451ab096427ebd6bdd005dc06e3da03","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-alpha.1_1630671968335_0.18880432736127473","host":"s3://npm-registry-packages"}},"3.0.5-feature-a4238f-kt8hgfwy":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-feature-a4238f-kt8hgfwy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-feature-a4238f-kt8hgfwy","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8dc1548fb08872565531e418816227784fb76f42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-feature-a4238f-kt8hgfwy.tgz","fileCount":158,"integrity":"sha512-oU3JJTUdWJji9LI3DEC0R0TcfBX11j6P6Ki0cks50Nd6jcnk8kBODUjK+AzIdWsoQ8+jqx3viwkJJ7WPWb8MNw==","signatures":[{"sig":"MEQCIBzgqqX6h+IrsBodbLfdsntGR5GUtrMSvTsyyV2qisCoAiAIWdxg2LACLzmijCdyD7yrQ7WPiNiFF05ATP+kfcfZDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNekmCRA9TVsSAnZWagAAQ9EQAKJLJaTcr/7+byVPQXog\nKzekxM8cBkLYPd9gJvo3eABXGdkp674M/O0JvMFSzbWaca1mU9a7rVAhG1L2\nSlhno4EqrdL1ybVn2GzzEGYMS1y7iU4aj21qBVQg8AbPTaGkO+SactWgZAxn\ndOM/hiOQ9+cOVqwefTx8nBJdw+/NxCger0IT5WsTlzxIeaQ7xXVeV4MOuH1s\nhSwY8jqqCUVlfmIFU//yPK+7LYSOm5DFuGmZpD4Ea19xttciv2MWDlnPfQp+\nv1FMDTlK5xH9JLetWD8BEzZmxPdwrOfQ4dAlV7//fy7GU/6eajjfHvf+8S+u\nsO+mBAe8GXOJrkhoaM5YGuior4/Sc91z6BF4R0h682Ru0e3DA0V3p4UzoBbb\nGxoAS3F/nM3GVSyOYzyBwd3agnxZqh9CZ2Ktwr6hdkggev8+B0mf7WZ6+Rn/\ncEitiFwKwWCuXKvwcYcXmFOvMRuIbd0T/Q+ecwuzK1XatQDXedzzyC/16MKK\nxumdGO8nr5/sjJWzzaQpQN7JpEE6b7MxOcmU5UXZ9V9/H+01O5RcIFq2xSIi\n3xb++0efbiZaydp+6L2SvH5RR38yNVVJCCUkFPnWc5a4ntJ93KWqFv7Uhk5A\nOXs9IcuiPv/ZT1Zn29Saea+vfKm+cQE/+19n25MyRgegZvh/mSG0brzn5kxh\nKao4\r\n=R08w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a4238f1fc44cbab01efbafc3399468f0405aeb3d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-feature-a4238f-kt8hgfwy_1630923046562_0.04621328480372555","host":"s3://npm-registry-packages"}},"3.0.5-feature-87a74a-kt8hh2lq":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-feature-87a74a-kt8hh2lq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-feature-87a74a-kt8hh2lq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4df01a883fb5f6e787e57b681cbc7847215ba83b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-feature-87a74a-kt8hh2lq.tgz","fileCount":153,"integrity":"sha512-uLYMkcJj+ZJZDzNkC4sK2uVg72TNdFvzAlL8pLeeqYxnmnZ3uXr4iP8zNygRxfOajZIB4NQPed8fSgMVPJUqDg==","signatures":[{"sig":"MEYCIQCtQhP9/3qqKQeoANZsQVQWU9rCb399bxis41+KjT0l7AIhAKS6/MGjm70UhWAOCnPHC886tTQndnrgD7rdd27ipXaA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNek9CRA9TVsSAnZWagAABWwP/34U76Qp3PdsCWuVzzTH\nYi3DcrF4M1l8MHGVlgFOyk9uYnlbxuZjCkYI2mdTBgx5qvNG15wNJU3mHzaN\nl2ZfF2XtZmy0rKpponFTh6n6eKmVVSpewfqXhZfd25HuOhajctxkeODDBxza\neq+Ugqx0CHcwwnwpEnG1WUEoFR1Bc9aAf+hn95qTWEA9HVJeG7fr6/tYa5Lg\n0FiKRJzMbs2J6EPnrv9u2wgmvHK9yqti80Ar/oZ3yi75ALrmin1DwI1s0G4b\n0+9O0XeB+Hy63pwouJlQG9+UqaHFpyqkA7B2yCoC6tHHuOyQjYU5YIOjTMt0\n4XvG4hN5XxMp52o7qlOVXIQcLe9TJYJWdSWvhX1GDlF2SAazttA1VsuB8jm8\noCYZRw+rtMzaR7P2G14Brke8R8tQ4bnx2/RfIsbZ5pB1yr/ORs9YPU6tzGbr\neYnVMa8kIhrR9fXx3Ls62XoBpVPKNYZEauAbKer77/wfCT5uQzzgVuPHwICx\nI4gWxdIeoOTYDJ1r7u6O+MuBYF65tYJ27QfVLQwPGZaVAd2hsvTqVm6/F3yp\nIntA0VLrR1FFHMFo3D5tO2OXhfh8evSqLlhS4Gj6uvqyuZO3LSq1m8BKXpRU\nfuflgzRtbn6a54HYdeRNbUhsQEmz9mBD6XuD9En8qiVLgwohOoEwDRWKhoo1\nWt3A\r\n=TbN2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"87a74aea0a146eeef24e6d221ae4fde5e8d580a1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-feature-87a74a-kt8hh2lq_1630923069292_0.09837826419193885","host":"s3://npm-registry-packages"}},"3.0.5-feature-2cd4ca-kt8ir3f7":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-feature-2cd4ca-kt8ir3f7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-feature-2cd4ca-kt8ir3f7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9af2ca67e0be4c1cbcc24ab67b78c8e8615fca23","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-feature-2cd4ca-kt8ir3f7.tgz","fileCount":153,"integrity":"sha512-Pdl8QnoNY/VwyvxWH4571D2ozGJOtWvW7u7BnvEpv0nLyt1jgF9rkrYjJj6x4IMXqc3IL/q2Nql4DPXXMFTepQ==","signatures":[{"sig":"MEUCIQC6VGqou+wHY7SoGYHsneDnK3Yy96jgbDJDUA8JrGgMAQIgRvEjK32HDu3vrhLIMMcdUjuxRbSxC/vPgu6xWxODkSU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNfGfCRA9TVsSAnZWagAAHvIP/iQ/7KS3Ozr/oLN7HClW\n0h6BLL3Cc50ED5q2xQGjGeumK0kE9BaGexdRzzrKHbXPB3A5A8K9yDYFyf5G\nzrKtNTop6u8Q+JdEOkThFM4UVWnmIQJcQaBeQU1lbQSGy5AlIXy1GhAsNal4\nLmQy9S3vWUjBOYmPFQfyBYz9j3Jc/l4AMIdGvsIhuvCCNqoz5Oci1wBmblet\nzN9W11p1m5skPxWG8MdHcp19aNpptulFmfc+A4PbXv2fD8LWVlw8Kzhc11fy\nftsawLUlLiz5NwXUbTlua6c81uTaKoji/HefaJU4LF9HeOFX814uire/ATOD\nPLqX9sK6yh1MhwsLft+ked2F/yuJ3h44AljT3d11lA7avZQn+CP8Vpi748lO\nMcQAd1p5DdcD0ggh+irmPzuZ80Xq88xMhkiJBfyFa8QKYKL3nzV3aT4+glIF\nu5YcPXkD/u8Qhx63hwEqogjiT3Rf9Kmp6x/OVxPJMKgPAWK/zI9dkeNOmot5\nq5YfhJxdtw+PEkwRua8nJkCC+FLDoBdCQQVf7uorDo+c+fnfkTxPnfsok1ct\nYqJmqysZgokwRvSGrh+GIFWOrWCAFCQHmtxNbNRdDwTA7ei/2dFBie3ojV+D\nY33tKUCjQvIiwWHG6hMOdAplKe31a751Q9prOWKTG55Ws0fITVFip7JR0r0U\ns4E9\r\n=yoVw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2cd4caae756a0991f45092318e79eca26ba4d1a8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-feature-2cd4ca-kt8ir3f7_1630925215333_0.843982926422056","host":"s3://npm-registry-packages"}},"3.0.5-feature-bd74c3-kt8kwlru":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-feature-bd74c3-kt8kwlru","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-feature-bd74c3-kt8kwlru","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1f1036e8f6698314444ef5034003251ad75b04ef","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-feature-bd74c3-kt8kwlru.tgz","fileCount":153,"integrity":"sha512-XiHZvFmnbNRH06Uv5+sRkBq9Wk2cVqAzRQrftESD5ijVd+vwFU5gpJ87sk+6/XA9ZXgf9RUJqrhKWRMPJaPIHQ==","signatures":[{"sig":"MEUCIQC4b6G7Xz/Rd3MBLviPRZGOOawRtcrbL6b0jwpzcPPA3wIgctm+V3zADJR/uLMtEFZGpPYffvqO8pSq67KxWMAFMZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNf/HCRA9TVsSAnZWagAAnJIQAI52FLSSMq7eQzPzDtIx\nNUgai+IqIHtqiBzuns1zw5pWJ3lhbz+L7AddQ0VT8a3v4Xj62qO4g+KYttYO\nxf7S+POodNfGQSJvcXFwWxPMh8vjQdbNIs1bcPWp5Nwk7cugDfNmj5kFi9wU\njpjq2onXjaHspe7f1QR+RHYlKNHzC0ZMSvpyW22bnC0E2VJ5T2TwYfSm1akx\npMkSnm+4Z6nqENesF1kkOm6vnd+IGAfa7J699AKOfS1KzRAVFShUqYsWthm1\njR+MyDSL55sWQRunSq2isz9odX54AYdnVy+aLNM2FntRz5SKqjoxdJ/r5kLE\n6rzc6Yc8ctPsGz8HfByrVFZ4H+GysSWzYKAF865OPBoWoJwJN7cAFSpy581S\n39sua24d+yfZYGdvP4uFUsaJzcH/sV2w7wdHhgdQlAlhtuWDbhRpsI6yp0LE\nf1gbTK+W+zGN4wy9Ta731XzaXlOjRyBJn6ko2PE0OhRfotBKZSdaiJU3ZCHM\nLNDlHuVvJv+Of5bMjCadnoqmPyghmjn9qSzEt0qbBlmVY+hspmf9roRyIlZQ\nRUT3tjySaTBnyWUd6hTc3io2uy1tZ8xexDpRLWBmRl6PDqEuiYBKquPYwkpV\nYTUbL4kq5yV/RCPBZYCbPLTYGyGmMYCi7/UT+p+9701XZTsD3e8Osxe2m9mZ\n7+zw\r\n=8Xl8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bd74c3ba8ea876bde5245b86e6b5252f1a18bc74","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-feature-bd74c3-kt8kwlru_1630928839617_0.15333722716049292","host":"s3://npm-registry-packages"}},"3.0.5-feature-0adc1b-kt8njett":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.5-feature-0adc1b-kt8njett","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.5-feature-0adc1b-kt8njett","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b34b12dc61b9ab73034ca610ead69f239ae8e829","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.5-feature-0adc1b-kt8njett.tgz","fileCount":153,"integrity":"sha512-lFnWhyrI06SqpV1wSB9VmQX0lJEJ5hUrfN3p1kGEhK0JwtWIidd6qyr26S2SW0SeEyNlHII/hUsZrzsEpDy42g==","signatures":[{"sig":"MEYCIQCo15NRQFqLX9K51S7RSVxtROjAp7ecqbQ/GbUR0tpCZgIhANAPCkbPcCMv+hQTXpkuIePm6UQxlPN0sExoQ/qzpB/r","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNhEJCRA9TVsSAnZWagAAU/8P/Rp+Q5CfXPRZf1zeX0+f\n1i7Da4lQlEftlc5Dh+yh6FNSexASfwTgPfHL64A8lro9RDolCXba90GnbDEr\nY/0L9il1bDMdCuI6jXpq29oPsSzRxiDU+Obgifhn/kkjogHTmGfddqSnDNQE\ntGM1R14sU5SJD3dZjMpoFtFXQ/Rxev/x5usfQZE4Q0177SOtVcvX2oxpNCun\nx7j0kRyJxMIR3TzEmYsd9pyFcL1Y/g8QZE8d3QI5ZMhy8hvHgoX0cacSuerW\nMOEYhCL4+1MyQzNJbpMVFQe/2P+oPRh82zZ12HDS3weUdaSNckxBK6gd4c1B\nI5kvOYzmE/kBfUdWGUIDEb4YooG1v+O1dbdVue3jaw25LcJu+j5QOIj1fQiS\n4AhO1hn2z5piMEDRKEwBzifGmlXzNNaJDgpOXINkCt2fQg5eZwJz6eAW4fDO\ne1VAOtAsE7zna63ghUW4ahy13jP2xUsVUi7aUfU7dF8AK8Pircy8DPJarFQo\nP/0ckHtW+PNzGOHX9ZHj5cG+U0FJytG5Do4vjyf6ubkzzK1GEFoduIdl1QD6\n+Ce+Mla78xtmgksA67W7LphhkU1ikouxTo0mhPjGpn+d4bqynTtKTuaQH1B7\nQNu0m9+LoNXe0Vnevqfck38MPR3p+1wTQeKmNayi1jw0nEQWjqsyWYJLCwaw\nJa0S\r\n=9kPh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0adc1b9495cc5bec5f3f186d53921fa76f855792","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.5-feature-0adc1b-kt8njett_1630933257862_0.3223447134699984","host":"s3://npm-registry-packages"}},"3.0.6-hotfix-9ad571-ktcmsrjn":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6-hotfix-9ad571-ktcmsrjn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6-hotfix-9ad571-ktcmsrjn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"be361d7d47e1bc6f36880811b1000b5c0cf26210","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6-hotfix-9ad571-ktcmsrjn.tgz","fileCount":153,"integrity":"sha512-nsyyZ+PNewGg77jTPR2W52OxLAUlZKXVKq13eu1tEDymUojnYXuUMUQP+eGHzqM0PlfIInaVnkyocjsYyWVncw==","signatures":[{"sig":"MEUCIQDUDYindz9rC6jc7dHlDAKgh5GM15MWkrVmyt0OIt9GoQIgQHNEzFzXhq3kxax6Po0S3X6hYrhkciaZgEEdqqZDJ9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhObz1CRA9TVsSAnZWagAATBQP+QCN78YQGZIZWVQbNGcr\nQrR0LxZM+6N51ymSbbg3AalTnm36RkAUZhQ7t/tLz6IgY9BE8PgFrONpz8J6\nbrg0NiLgFlnWETSoon5ekKQ8jmc8sCDu1KLpgGWnjhBcvgJn0N4vLXO2MAV+\npjXVHvyOn+WtZDCOSJrZsLjhnQWDS5ErskbIj6hLskihW0P6A2+XadesvfAR\nnRLDEerAqnUJabh3WeoZ28kHEVzL3yV9BWDAEKlIovPJ9p/OgmJfywGwL7kZ\nfPdOPmtv23gDCNDcJFbnY1Ln71Su2w79WtLQoMkVEtZUOMMZUOPdxVIwMaiD\npNXd4lOjR4IcyL2irQk2zJ3Z41DloOgE2WR4BDNXWLSIIXG1ESxzEdHgoXdu\n5jFlFYFYOIBcguMq7hZ5Xo07Z7z7PCc359CtzZUcpb+rLsQ811v1wBSoijaF\nDtwIPcCtMK/2+WKEgsjWKXVi2MYtgIRwKDDyhDmtQbZFNXfd1KnU2QdMElc3\nXR+NJBOoU29A0TKBuZLyZaQVdU6w6mRrQrXJkGwum4gzi4FHeHx4m86Gjrbi\n6lMah7L6Rj8crq2Zozka/vdqhmN2hD890J+h76xyvRrHfYup4Xu+iL8LdKsB\nhJVKAzBz+snOJeksSFEhyMBjYgMzEANGt9gM2Of1LG6B+Vlff4q3tB+DrqEe\nPm1R\r\n=nE6Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9ad571a5697d2690a623e395c5de987890a4966c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6-hotfix-9ad571-ktcmsrjn_1631173877078_0.4881435480527121","host":"s3://npm-registry-packages"}},"3.0.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ab2af20b665c1288151e0cf6b43a52d3e6904a00","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6.tgz","fileCount":153,"integrity":"sha512-++hlBRsBKcYqEmaBszcRmgAf9SMow/ZEELJZmKneXIG5tapXacuoDKyW0GQnUrgqrzmrDkB5/t6igdo8q5eg/g==","signatures":[{"sig":"MEUCIQCGcHhrOfIN2b37SSUt9yAzCGYH9V9syLMSfitUBQxXNAIga9kXqr8lpIRXSAS4lv8ARTzWgZkP4iFGWT70rs65LQc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOb7pCRA9TVsSAnZWagAA2G4P/0gDs1BPXm15TtdYTcSg\nOpmZ51+/wR5A8ZFD9f6E77W9/Kxp2rR1OEn4yzHcTKTveo70rZTQS95MgLNq\nnVcQqsgpFyCpSitpsU8GvhUF9v9s4jl2kucG+YxfOilc5RpV9SaCz+apqkYr\nIAdFosKgv/Q7t4H+kEv+KadPmvItJEPTrd6Z/A9fSpmgnlREVSvBzgHZ1muY\n5Nmka3LTgMkcHi59KGI7oHzjjSWo1yN3zlK4cnWsX47dBpDka+Lr57FuThpO\n0lK+Q42u3VQhk+q7LPgeCSv9cwc7u8ZQFV8sdJaZkJOCsQ/zx64j+1pJFrj4\nCtfnorlxSHJLvwlJxLkbyH56C4iN6Z+AABlDcWEtYpSmaXl6vWcK0w5ZX9Le\nAvB18bwENTX5LYEGdyWDgYC1DUOUgTSDTX8g6bKscMneU5jfbz6FFbiuxXOB\nqs+EVOZ9sFKlXRJyrPTQ0ncCbr6JP//I+5/fPgadm8nP9TRaIE2TFZpBpRHR\nAJVe+zYtu68ybsv7RF17mxUuCyusXixW9b+s4T/3WDqUNaTdvGGaaWNNdWAP\nSxk7U/GBBRYSUd7TA+3auNp9gO80zOxX9n8Al5B0s+s/X8nOlj4WRWIdn63b\n/KuofxSLdtVmHv/hDkVJPnw/90PMRim++Eo65ZL3mszQyxQSStWsfb3GOb0F\nYCX3\r\n=z6Fs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"8b78411f92b62fe050569ccbef84b169accffdba","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6_1631174377752_0.6252279468962709","host":"s3://npm-registry-packages"}},"3.0.6-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1aecb994c5c909c2ff82846f940067433948c9bc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6-beta.1.tgz","fileCount":153,"integrity":"sha512-mE/JIT3687QPzV9x71WaiXcN/FaxkU0jrEniiwQzNx3RUEHhQF17GhkHg9spMJ8bNyQoF+MeWkS09NdjStDgDQ==","signatures":[{"sig":"MEQCICf9bhlMxXoV6cz2xHbsBBv/lLCBGCS5mznEpitNjoOHAiBOUG7Fh00PJDOO4SeuwwOtBMBo95E0JrrRGRhyBC1UYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOb8bCRA9TVsSAnZWagAAkQ8P/ijq1NTDNXNVdlN1K8vX\n5VJy2rBoynenoLU0YAWvSiA3rj+QrxoAlFtZkkHkqUK4HR43f74A3McsVQ2F\ndnNZOn0Hv5cDoTYjhjL7VrGemLkfgfmahzzkF+cFWiLNO9lKy7O9ZUXI9iJL\n6hJ7fwfqo/rHkwVnw2BbSpDQZDccnON6HUCNyssNpSBxaWCw1RIUmyE0NB7h\n2Vz/7kERaThodEmI6nVfMy6tZu//nKIrpysj4w1jDhX+6RFYbPcWIolm5eJC\ntb+QycEHWjMJoeD0zinDU8P6ixrQpXYbrgnLHGuq41NEstwyPLka1Auvo/BT\nkiV02vG1GnXYH3Qp8QOE9Tm9iIC2L7ZZgkAhZ6ticcrekiCsEizzbJfJ9D32\nJtXqahd+rATH7+UdEmHwBiNODCGemGXyjhkT/ODsuWCog+piZa7/YNmWecyy\nEsIQ11tSNLgY9px+BirWEywBgA8v8iFXxOeXe9PyjBNf1aAh7rNY0/L4VKkS\nuPjjvUaru1A94WQpPfX9HSzcjL4EYDSzBsADX6aB3s/y1fLjAKH+H7dnIQyq\nldHky2tFPAoMMBQxctEj/qIfnSnUTvPOqWUwY79kmjdQP6+i1/eZv+evZ0Me\njqczeDXo1UoTRSvSMtge/XQJKsx6VdNhp02iZPFIiTpyOKgrPElf72YHHT/s\nAcRW\r\n=JBho\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d2fd864814c7e38b2f84dda6f78a95bd45a03229","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6-beta.1_1631174427441_0.26511810434439975","host":"s3://npm-registry-packages"}},"3.0.6-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ebd89d3b6524dfebd04a70ba7f1718955c58be58","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6-alpha.1.tgz","fileCount":153,"integrity":"sha512-ovgAKPFtA5b+yJb18pIkM97o2TZIvqhQyPX/V03SQ7h6H2tIuWq+6NtNSrJVaOBfZJ0B7uF5Wix2WbRvtrx8dg==","signatures":[{"sig":"MEQCIFhf/4eLKMdboZxsr6kEko2lQR+v39FlzjX5sNHOfzQeAiAAiACDZohmFqfJRCk2CyXfsbHUPFXi72Q2Aa3E1r1YJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOb9dCRA9TVsSAnZWagAAygYP/AyC4FZU9tuNiW+/Yfw8\nVcwY96I5TkKpNHtSzGSBOafPQCIiaQGvA/Jf12jBtflrWjFq/ibFVWIzB3Rm\nXnUgmU8otRIWTEedKpk5VLrur79hfvC3loTwJkzIY5i6ZpjVy1rsM2nTXkWo\nGd5wJ/gaIts3N2lPA35+ctu0J7D3N0elCax5CFHM41D1aj1sCSZpCais3KBs\nWLzyfliE10hbhN97ar/ck2NOO4dMZnUlPtx5k92iq0K8KVNtktIEN4pUofUM\nbGMJg1TgCq74SGLBOtSoe23DvNNDME5ssMgHCSGTJMep+MQG648AINOXn3Bz\n98JIba5MULQTmekty0E4TVfixzNjokX9ieVGqhputwLy6jQW13JMs/j56aCm\nWQVLRx6U4Bjrg6JAmi/QIuLQVobG/2APBj+wUqCyyfUGXVNro28kWgP5DHuD\nhbiMWAaywVrVxzZJPzedtTQwRnvO26LovrF9TW8xl/VxChHGEdGCcSliB6T5\nLuM+D2dN75zXldKxoyg4CHYQylju1g8vVO1QySMFCZWE8kWvCs08FxWoeszS\n7yiA94GfmqCjGTYjj7od9QQ9/oTavRP9BUin6d+Zjs7QsR1P/oPXc/JID2Hw\n00IyDrSQYYimsLhr471BD9Mt/ICQy3PZ4psmW8U+Jvs38GYNFLjzxyLmDOZM\ntahn\r\n=G4N9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d29c5c7803fa5203cd080d42ccd2a55377e8ff1e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6-alpha.1_1631174493477_0.623732883275735","host":"s3://npm-registry-packages"}},"3.0.6-feature-cdd707-ktcnymqx":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6-feature-cdd707-ktcnymqx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6-feature-cdd707-ktcnymqx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"91239055cf3fb8067480c8b0ae62c2107ce01001","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6-feature-cdd707-ktcnymqx.tgz","fileCount":153,"integrity":"sha512-L8zuUE7kxXpVXfvmYK1pF8Y5UnpiH4ic1MnplFB66clvyIKelQdqKFCZT4d/rDDfvYxy1GEfAcdtfAoWH2vmhQ==","signatures":[{"sig":"MEQCIHO+wHh5xTlu74NFmnLBM/S3mqs3dFTgUe1KcnJeQn38AiBlD4r1VuVv/hoKcJTvXuXXjtT+OOpDmViuTrFiTzejQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOcSbCRA9TVsSAnZWagAAJWgP/36uAEB2ENFRFPqj93ZL\nYTUc770ilWZVWhVyTG2Wh3RDeuQXdPRjND8od8l/wSTZzA5FOAqd5b1dnlo0\n8nYGQoXepQfv9n/5bNotMv8KtBtv+by/oa8jhorJjN46Fex5x4vau3/432Rl\nC2QJ5PXqekHgGgWzWJkHy34NNyFxIIQbpptV5a9YJTQpcGen/9Vr38TMtFs+\nWv2MldlntzrPdsCrg5S4CF1M4s7VeGKoEAB90C4MQF1M01NOMy7Y+Gu/TlqD\nyW9XUK/NK4eJWWq3dFL40KNPIgVr3HSZfw+wq1UuwStx1iJnxWIZpdJrvKn3\nhTUGzfXl0RNsthYCAIBGouBygm/UDvB4r7kOXsxpQE2fg0AckxxXa2/lP/GF\nUxFHv/inbEwnK70XAGHVleOTEmYj0a/AviQSzO9ztBOptzqmCPsZwsCvfdmU\nQDpohJQ1OttvfzXh8ud8h4SbgduIgwBkJrLoHGcYz8YThvXq6RrPhyu1KxxI\nBtgVD9PgoAqYilY0AJiacmkuFg3rv9omVdQNKr7Nhr4ZpP/1ZWtfmxoJWbFx\nH0+MLFHc9+tOZuTw/UlXxgrBhyb+eCtwl3uFjz6gnA4SvdIe73JOujXetiii\nZmDcK2xcmTjCaevLWDNLVdQs4za8x10AsDF0HYpB20ZHWQawfqKaj4/rIhmR\nFvFX\r\n=6iQJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cdd70711221cba06273d848cd8cfaa88f2a10a29","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6-feature-cdd707-ktcnymqx_1631175835756_0.48925913447416436","host":"s3://npm-registry-packages"}},"3.0.6-feature-12e9f3-ktjtcmip":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6-feature-12e9f3-ktjtcmip","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6-feature-12e9f3-ktjtcmip","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d65271487baba469037ad0e12c175d6d2d254fba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6-feature-12e9f3-ktjtcmip.tgz","fileCount":158,"integrity":"sha512-kpDsWHw1VX3r/s47VvDLaXPAl2zCVd1yv8KrexLPCmtpl1uh+ncPbDDRwTqsLh+3YnM6KZqo3DGOx+hQqOg2yQ==","signatures":[{"sig":"MEYCIQDH8sdm0qMMnYumTO4f9XGp4eKJvHj4gOyu5IlhSFN9DAIhAL8jITqtszoC47Vxgf33hyhaonJe91eYTNBeahZEVdwN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQF1PCRA9TVsSAnZWagAAKJYP/0IzXzp2uRFlq9FF+pFt\nOdeUHQbvgb+JYQ/hPg2oKs0QIofgr6q7r+AgmM5LqG/J38O3gUdnAJvt/Cue\nNREiCuuTq65W/3A2hCOUVUqL6kKI1qUe0rKVjHM/KnCqaGZr/O3bib2QqsJl\nxlailNBabF2URx9E0/dKp507tQ35/mPNJqFvCj2juZNg/YyzaPMk3xyGDZIT\nZMXDZbkxxo9PHUYzILvtjM8l6FEh+RqU2/+FjLVvDjBMwHyDo+Hg6K0BMlyP\n47PRNg+pAmpHPKDZQodaehfbgM9h7LbrYSQ91r5XDQnG/KMG72f/5RmBIx1E\nEYslfekeikHf0ArdHQbfeEpMALPWoY+3VEut0z27FLkx+aK3yMsGq7dfMjMa\nfp7xCsYNstRcj/e6oY9rMn1TWsXQB3biXyBLgQScpTBCNR4xVh95jko4R+qP\nlHZRTuZbedBhQUqxsZiz2+B/xqU/WwcS/U8Xiu9BKl1lKicrvDpDrtBNR6ju\n697bPjr3ScOxJTjhwjmW7F0Zm37xN769uj2U5U2qRiGLknGfmusVMyE4QlXe\njPYi73cp+HW7nhYgIHv+qwrPcZLYk/oo+Pt7SYkbQ1ki1/BI6ROTldfcqeJC\nqeu2r5g3nTKo2WGcYHtpLs5N6dWroe9Zke8yta30GY++xQiRn2IpWFxTMEmO\nmAcJ\r\n=b8kX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"12e9f3b7241b90633ee0678c0c7435a37d9bb8dc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6-feature-12e9f3-ktjtcmip_1631608143802_0.8150262646160202","host":"s3://npm-registry-packages"}},"3.1.0-feature-d44aca-ktjwigdt":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-d44aca-ktjwigdt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-d44aca-ktjwigdt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b4f10ecb848b1ff3166f23783eda9768ff4c2193","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-d44aca-ktjwigdt.tgz","fileCount":153,"integrity":"sha512-l/UlAnhW3O52qZufcdcFjhY2sgv3GwLWeDTh4KMjNCCwLewArPpeuETXycCs/tGQUTH/aFxLORn2MNVZ96mv6w==","signatures":[{"sig":"MEYCIQDrBQnxWWl1fdDLOa19GuA/G8M281G5Pf37wunyLmWJbwIhAKnmL1qblQCdW1e9DYyFEFhzFMQJyi6vj9+RrKgQPiDe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHIVCRA9TVsSAnZWagAAnLEP/2P0V5hG3c1akNGXdZ0W\n1vtHt/YYE4SnZYjr2DqaanpYXvUqXFCiD5ajUS5lwWHlbbaJ0BToCnOGv9RG\nJAm5Mv8gZFAjpvndMgnBVrvyMBE84RJyyOqMIK+L/f7+jAIIj9q/I5sh8KpG\nnzd/pbC+sWXSc2FeZx/j00ECeijOuL+6oxoNr28QyXBM0PofKcccLVZBxn5k\nOhZsqY3iPS7Em2mozcu6SAyQjCs4xvmgIuLNClra8P9SCkho2rk4THH8t7q5\nhnmn7cGhj6E0gdxDrljUY7AfNl9pXxcDDMqqSI+JmUJRgUzp0ExdH0thQmjg\nwOhNvTcUAD14uZua/tHSNFf1ADVQ+h1RQggD2e0IEQa2nJY2pkFfxI5wCxjl\nDbLghgwyi5eR7Lv+WTFJ3klLEWtXKaKkJe2sMQ2ikdXrb4fIqPR+id2M3TxB\nbUNMJ+K/3rVxUvY6HKSTGZOuf4nWVZtF2J6R9hgSK2H+M4vO3AcAJ+NFxy6f\niiEJAIAIAd5L6/UOEyxJidkiHglVROR6OrqqrYK8OJlT5bF7yGoAsInu0msJ\navtpBwGqCTDIxwD6LWL04RrmFcXXA3FFW6DLkw97mPzZaZMlRUzkren6ARDh\nkI/4HXhnwAM81AjgOzjk/a0/yS8sVVzT2SsJrChWn7eKrRRyNMAFjYr8vpis\nPQXn\r\n=LSLy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d44acae92ea9459b24b86d94a67da86fc5c65dc4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~improve_sort_params_in_urls"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-d44aca-ktjwigdt_1631613461720_0.9333921197201234","host":"s3://npm-registry-packages"}},"3.1.0-feature-109523-ktjwipel":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-109523-ktjwipel","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-109523-ktjwipel","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"958b98f91ee0e2f21e769e951439d9a6018dc348","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-109523-ktjwipel.tgz","fileCount":158,"integrity":"sha512-NBT62a0Ti9RmGxPbaPyLNGyaCzkx4m0i7BhKveUzprfZ1z1iyFYZZtuHEbXqvGp186lCyc2Os6gE9C2NnYb3nA==","signatures":[{"sig":"MEYCIQDX1dWdl/HVlBQ4kQBVo6CbD03Lx01F3Sy2Ck7sGajhsgIhAJ2l9HGVPlsl0694Fgw+2HEC5PqynqZppq9hYEF27YAr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHIgCRA9TVsSAnZWagAAWkIQAIkc1gH8q2z8QPzYcaie\nQ3uAVQdeandzYdt+/LTnd5ia9/KV6VODRfaMMaLqkh9H3TrxvS50PdbYp0Yd\nJfzEfkTJDFwVyK4VC2chRl2/1jOlC9OeRQMj6Akz2m88g4AkX+pw+3nW75XF\nOw3vlLYpClKKdyzws7XZtosuBon2x+rCo4huz09z96NsdgrTK7fRDH4NX+T8\n6fDaYsJkQETJafwuO6J3p8jsxNjSHXfSneVatN7zTVrQqi+LGtmZJ/lZLoVC\nmFENYnXKCNCWdCmAP3iWsefFX6VygpLX74YGfigD4oOuxQJqhJ3/rsZkw32K\nYM63XSS5oCGSFhGT6SkIJiBP3GIMHXdn+qDbUFzzlSwF+iOLIJErJ/IbFXRl\nvd52NdTnqoe+RAvxMZ61QQ4+SSyfEGk4OAQrKA9fHDsV+CCWs1zENxv4cH+J\nCncIPViOdlrs4A3MMahxcF56xPpgwpEIQ9mczzHq/15Kof3t1Px401DwTBzT\ne6Z87WmoJxYxnvSwAD3aVQMOqI0wPcoJ2CRsB2vA8fALKRTOfFx4sgaV7Ib+\nyZxkJRPdQsw4yVA47zrF3Nm1tK/CjLqB/cOUql7ZpRv7eR0vpYzceM/pTHlD\n6cMkMRYX2sW4gQpCe5+aK6RAvepbSXuNES+hlGxUpXFzXmV7xDwT9f5KrRGR\nK2b6\r\n=VlYz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"109523f737e1b2b183b43f21905b9aef4ac63e59","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-109523-ktjwipel_1631613471901_0.3796895827568769","host":"s3://npm-registry-packages"}},"3.1.0-feature-738f38-ktjwj5u2":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-738f38-ktjwj5u2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-738f38-ktjwj5u2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"db887585ea7c67effd42b44aba24aa9e73f23d8c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-738f38-ktjwj5u2.tgz","fileCount":153,"integrity":"sha512-iYi34XgoqV34vStZTzuoiZTpP8O7FOAdKkleegdVh8egvH7vhXAEqxSKYpBGZG/PwAQ6cU5CP+XMbW825TiMLg==","signatures":[{"sig":"MEQCIEleBNEnOfnyIYoSxZ5iAIf2RsrCwwFrVc1LUcrIYaPWAiANdDrKiquliNUrGDNimb9/elFpHw29ON9RsMpTN5Ynzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHIwCRA9TVsSAnZWagAAyd8P/iiLW6vjPh/3z39T8wgl\naFQKJYD9FksMk2R0vX4Bx94NUjEMBv85Qrkv73Imdp62yB3afTn51OyNEy07\nlD/1kWgbaElQEfFZCI5BwcijPETAtxGjo8LkL5//hLPBDpWPiG19235uDz5T\n8gRKsEQrmzWfhMS1etBfq07PTJqOXft2jTP/68MzXtHnD4eKmJceFzz/IR9L\nDhcsbp+e9siVXcMkWLgD4Uu3D0CiOCZoTPDdRkHoj8H2UAMg5T9AfIKhnaHz\n7UzTqOD+pjVamK4AtNihwNwLpleV1C554yloy0S71ZP97vDxDOLCXcgFmAEg\naIcO3NsHBs3MYludEcP+erk25bT6598avvz7QlIH8uiImLu2In4JjB+lybOP\n4rstQyUH3voAHKhr4ZHxJ7ndJ3VuAPHdGcJcDT6FR1k+N4FaAMQQUpW+PjBM\n6QOEFZMpXYfXd90hQ6ajf4IDorFpoBt+DEGJrak+8uyIHJreTKLRHFGSb1u4\niJHDL0EDlOVgJyBChCCN0I/CYi/IxRn+f4TxJ64BtWy6lxOKS5OhG3A1enAk\nCsOry+FDn8QZEC63clYv14+sAS8Wf1NJgses/e8JkG2tusk9Dj8WbjiBzRNI\nNxD1j5/ApQAdXPZ3zzVp7RMtfllAaQVAYQXhvZf2+i9xuzuHA7QabReja7PA\nUsMr\r\n=cQ1/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"738f38f6a5f2b15b421ab2bb735a04a774b47d47","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-738f38-ktjwj5u2_1631613488489_0.6722028698895433","host":"s3://npm-registry-packages"}},"3.1.0-feature-4b8f5d-ktjwjgba":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-4b8f5d-ktjwjgba","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-4b8f5d-ktjwjgba","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d13d9f753d5c968dd483eb9475e5fb43be34b4d9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-4b8f5d-ktjwjgba.tgz","fileCount":153,"integrity":"sha512-ttCNw7wqcZiTxoasVy97ACsmt0xGNEX4IpD5JVodMMVRGBnn5+hts9t1WL7mu2pHGmlSceaZMqMV+U9yMYbhCQ==","signatures":[{"sig":"MEUCIQCFHsJh3l1W3ohX/2ltzYuLlxahVC8NqVRnZnm7FUEA8QIgLjFb6rQxeoQC6jsQwPWW4LlBtjVh+cXlshTCRZ3N8+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHJACRA9TVsSAnZWagAAt+0P/3A1fuCt8pBwcL3AifCi\nva9fLXeklFR6TGZxVckBOzkhr1Wu+rw34uIoSdn9fGjGzaSRouCtryA0Nu2k\nyM0FrgQ6HmwnmQcQYEbdleZyLIZuAPVtXlFbgilujDB10GRTzdjyf1c2wig4\nDZFNDoNtgZPZ3YFLHJ5J4wX/QTXWU4oDjQ3yhSp5a5JLbe0kntLhocYjCb6u\nAfG7oJwIss5Nmw8AzlT97yamJwD46jfwud4suTWBuyUafjeRFMncrpiwdms2\n1QaGItmA4hveN2OX2Yj/iuC90054q5uPA5bxPiMzsI7RLQ8P/bf7d52miNGT\nQMxTNXYSi+KVTvT1z1BAQwJRxIqf2V+bfNtQ8c6fy8DtcCkdnT9OTgpMwUGb\n2g1HnjLSgzRV57QI+C8I2Edxu8ME2X9HS844BC0INWKJTbADGXCl/rqwVzqJ\ndah9cMZHS1Nn60AaqUq0J3L5JdsQN2qDAgUyoZv/PFEEesA5NhFJ6j9pcFTU\n+2sy1/CS9/a2cOexr4lWYFsn4SFW9iEA7aQqM7U/VqCshjLbvc7O5nXIy/kV\n83LwbIxlRsU7tZw78hoqpFViebMqeOLBwCtBkfxgg+AoXMcIpQmbInf1zzPD\ng0QJ948oeDFUiaxlpw2dVN9xw90w3661LUfIdJbJpLXwJPzOGzKpcb78OHDP\nywew\r\n=a+OB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4b8f5dc28d9c493ee5cfa53f147a92e3ae4b5dca","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-4b8f5d-ktjwjgba_1631613504807_0.7062811569517915","host":"s3://npm-registry-packages"}},"3.1.0-feature-7200cb-ktjwye0m":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-7200cb-ktjwye0m","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-7200cb-ktjwye0m","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"67be9d55a96d80afe11b83ebbacfefe4616c6204","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-7200cb-ktjwye0m.tgz","fileCount":153,"integrity":"sha512-nxFwFDgKqQsF2o+tkzD5lEJwaRW5qh+fPFA42LI5l/aF8g1QRZEivASw3ajREYF3IRy7RWMbBGXe9DRUoi1iDQ==","signatures":[{"sig":"MEYCIQCZSQ68/j9a/uUX8UbEpgyByVfQ4jbJkxdB0bK22S1XEAIhAIhgS7E4REvV6tanNKwU+33fiPVKiWJfNLfH+3m1X7ZY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHT2CRA9TVsSAnZWagAARSkP/3wcBe7RTxK+cUBVxFxc\nDvvgHG6gV7TUex5fSmL49ktS6AUS28yWB+7fo96Y4AfrLm7wF0G7LWlJj6U+\nDWFcs8cQVXRowHdNcHe8Az/mPDvw4odv6Mc8k1Xn00w3F7AiEt8JWISZ/sz3\nxDIHYbpuIja5GKncQXTqagDbKQxOezEwKQwA2C8lN701BCpdrd2mmNQDqD1B\n4Fjx8kIiKfWc660//ZYFdHFud2aSc+Jp4y0GitFhoNrjSLApRHDxElCaLIBd\nhkw9wFHH0sgl+RJmxKLzpJPe4FLQzxmkKxaF97Q6/2Bot0dz+yvMXfu2k+r/\n16d+DPKFsGLknnx5NJf5qUGzjftEXXxrQ+y2PERm7trWsg7VhICfa4DAj/yW\nIdtImVbxcXiEMv4jzzRodiWBrA4HVY/qLLYZL+lW967umsrBW1xcMjLiyOA8\nxcPOEow/kDoUCmz9E4CLq6Eo7Jt9t0jy6HyYAR8atSDyNXDpAhQnTf1mPo7Q\nI+KeLq/ms7OjAXRr9UzwDGlF+8MYf0QqwdgH3wVF2cUL6vPCmEXZVfHeIF7r\nHhHnc05F6MUloga+ztZbmZeeqZ+P0nKzN4369EU0v0Lc1S9mWkh0odXGjxk3\nvoQHX2kMPLXjdwAa+D550WnL8rmGQ3182eZoM8N+/ZUNGsNBeHSfTB3MFS0a\nCIfh\r\n=bk7S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7200cbd1dff0fe6ba097bb703a5a15f06b970d9c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~improve_sort_params_in_urls"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-7200cb-ktjwye0m_1631614198741_0.08010092314710726","host":"s3://npm-registry-packages"}},"3.1.0-feature-e8f4ef-ktjxz9wu":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-e8f4ef-ktjxz9wu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-e8f4ef-ktjxz9wu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"89b8779843936110f73f4f8af7f21a4eccca0828","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-e8f4ef-ktjxz9wu.tgz","fileCount":153,"integrity":"sha512-Eqe83lsDoVepcKm234rtSf/UFr7VHpnt3jhKeDiFleER0LgEWssvqovdWehpSZR8uqRZ2w4j4MN0reGBnXOqSg==","signatures":[{"sig":"MEQCID+HzkTeO5lJ8uB6h//3aztSyFnq0W5zJlo2wVgSUSNTAiAY4EUh98FGR3yLowKHW4cG+7kl2YFo4TahyNJqbxAtzg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHuuCRA9TVsSAnZWagAAcywP/RNRzVPrJoO0eKAo2OJB\nuMbYweTureCbPP4BTqA8s/h4ay02cVC/ydpfShBTnWo5yEv2Ht+mBX+ogs7F\n9nVxkFDCK4dpMAz43BN9fPFKRG3e5nScYJuV7LcujFeJBdfK48pNJ1GlzJa+\nC44Cdap3lN+QzEmfNv4hU7KLS8oQ93t1dyllZ9/q4wuCg/6wxZqso/+1P8EQ\nfPPXkMvSCYzvhdv6Y8F0ZIcSHDsvim7x0pBgAdzeOTUAJo5qjIbBZZNNbzWK\nG3P5c92ryJLHdLU2AExp1ARxGEDy/AY2UqcO9C82SDiqS/i6UTJ46i1+b/e9\nqzpARjhgyEqyj8NC1poXZs/BCGmvC10SsjCaszP+0+P+iQNOlP6+I68KF4nI\n03S2hbiwUd8I2jXYAHmOUGHd4SSbqlb6SKDTPHxrkVVYjiyfLCjnupU1iPqP\newucHorAclMEczmwx07AKRSbwqD5VS5L78p2A4hZIHzaSAtDC2UAZa+GHFLO\nybzSeqTBrUKtBS6rJt5hzBqV5rlpDR4OShUojNVEcfeTgu4p6CyLa/aDpiqw\nuFyA5zT5r+n3ylZ59oAbLgKIGSgrepPg+jROXdD96FgehWA6P1l74C50Gnm8\nY7IR5XWLMZHN0lcZMC90CmQFj7qJp48SzAguqh582hKM8xW1QYPukvhUSlwm\nVNP9\r\n=AYjP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e8f4ef801573f4b864f1230352bb274fc20d9cb4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-e8f4ef-ktjxz9wu_1631615918826_0.07174372165125398","host":"s3://npm-registry-packages"}},"3.0.6-feature-0cb867-ktjy8q96":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.6-feature-0cb867-ktjy8q96","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.6-feature-0cb867-ktjy8q96","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6a1a3748a1f218bcb5024994ad949c0bd43ac42d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.6-feature-0cb867-ktjy8q96.tgz","fileCount":153,"integrity":"sha512-dIW3lWSyH9pf58zF17lOxw9Uz0Pbv159qGhYmNmfRluWYzR26xljYSkC96qK+06HQjqdESLRb4VE1BeUshuOwg==","signatures":[{"sig":"MEQCIDe8in8YocJva+s4t+QLTwJnEoDKQUACY+B0SaDuPyvbAiAyGagHCM5b7S7drGz3Bfrpx5pRVFB6r/R2xr+n4suwOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQH1tCRA9TVsSAnZWagAAcu8P/3mjjWRrhHQZ8vge/p9v\nVsuwHgFHyjHb/+W1xNyBh5vVBGTvmXsGmFJE0OJYq76Fmwkhn9SlOX8pVw7l\nK0slAdy6COv/glLOIHcrgrpCKcPM+An+rGykRsGIP7wUfc8pQCNPaxRJoWIT\neNWWXrW7q76ygx51QwcmokwPwK+oceZsm1vLa9fRFdCmz0zFpsTBKlQeE7T0\nZSOvIaS83CtBCDv9KySRIAkVkTnIfk9b3+9ayy8Q3k/psvkdY1fRfoCzGLpt\n2ly2hPI9UW9cBTXtB7Fy0fGTPlweOnVtNt86FgW2CAQaAyTdr2NU1HHPDu1c\nFQksB4LFUEGFMHwDVFzN7QowtutzeMQbgvw85IkpTVo9BsWaYnZyiAj5RUMu\n5KMmAtLIBGSQhbwXKSvr7ARJNT1ZSFxxG59fYdb25zUyV/yRaRItQlHs6DUe\nThs43qm/B7LCpKM8ASuBWUBTJYu3Z8L7TUrI1K51k5v18sShxPmXfy5eXQCb\nKqHTPtx7HaHVrIHHtEtVq0mKUIDOq8F7CV7700WzdNbav9N4m49gz/mTbBEd\nAg8qJg9Hd/04aIbl1GM46oNlAzfmDNxB94vlyXtxrZV6QMJJzkocrPUFYRSx\n2+X3DeD4PesckJEFxPsqbWFI3i5WvGa0P1i8LgL6DeP3/PG41GwmxEvZ/61i\nAdLI\r\n=Vaua\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0cb8678f7f771b6e7e942ce090e916b3d4271e03","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.6-feature-0cb867-ktjy8q96_1631616365058_0.674125533136845","host":"s3://npm-registry-packages"}},"3.1.0-feature-88c080-ktjy9b6o":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-88c080-ktjy9b6o","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-88c080-ktjy9b6o","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"84d2907fa0b8c7e804ee25239f22c06f4041ff4b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-88c080-ktjy9b6o.tgz","fileCount":153,"integrity":"sha512-AJkEctPp7PUescWW06hkBqyML04qcu156xcGEMCqRy5XDwQAwV0aGvlTmRMl55uCq3r0GyOd0MOlptH70PSfdw==","signatures":[{"sig":"MEYCIQCO9JXIWX7bHRH9KP3eWtOGAgUS0RQepwXk5jWAlEDsZgIhAP20S9ow7LQvZAP6gRvRMHgRib0QYqU3je+gkqlX6oOl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQH2LCRA9TVsSAnZWagAAZz4P/j/a8bhwbtXEU44IyRku\nvVVY4d2L2BflQVDUwsr7qgnGIx+fPW/QKb8r99bB1ewS+8RzV4pzHdo7HxVc\nWiCKM44gS20c6vVOCBAtbcSBzF/LGxrsAp+F1ME9IxpuaZkh+A94+EGlW9cW\nhZ7modtJItpGOUGj1gFR7UtavZQ63+STW1TCDQssKWHqUw856s/87/mXhVaZ\ngGzvBj99PQUPc4Sqb17LKADImlVXiZs9J2nC63WS7405Ea6rw6Z7x6RbpRYD\nkrRXA0Ovb9Ffjh//wpqCetSpN71wfxqUVZnbB+nqzFi9gLNAc33NCtA8BiRa\n/h5MNBVyIC4KlUfEIPcDBxBwkHms61uaIFgyaJmIPv/nawlnuQuW6ujgNevp\noAGhaYKW1dcUreDSgSAKQ8z2BWy6FXHi8jBp1YExqfYY+euMTmMOCkfVPddC\nE//6rJCSRufXULQo56JUL8baZrsW4rJ3eS10pE2MkxGNpiYMihYon/J1rzwW\ngzN8yB8i+bfx+XDhVzy8guF7pjP3mA31Px5Gw77hZc0U1cgi0/RJFPyb1OUP\n52bZYsHCFS09HoA1qQgOlzU9DCejVdKTN7Bqe1BGeYIkkfNFhMw7buj8G6D5\nP/ArDELfWrsxVZuEE1TmPWNXR8VJTXqWJolrEvujE5duCbeKBzW+F2OxfZ3/\nKJqQ\r\n=VfBK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"88c08041665844aabd53b857b248f755ba91f1da","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-88c080-ktjy9b6o_1631616394825_0.15373106819102933","host":"s3://npm-registry-packages"}},"3.1.0-feature-136fd6-ktjzscsz":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-136fd6-ktjzscsz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-136fd6-ktjzscsz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e1c15176a3fe3b1d3cb1453c69de821f453c8502","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-136fd6-ktjzscsz.tgz","fileCount":153,"integrity":"sha512-sK9K31LLRoBMfNZGLvs/hcatKMyNwJZzfE+LOD7vDTTQcHf+mApR8q/3bWrWfTEJRpJPUC9dEl1skKiS4ZjlVw==","signatures":[{"sig":"MEUCICLNGDbuUh716oQkWZey5dbtWkEA8O7LNaEKjHbhfluAAiEA8XqHwtbPNFiDBXNF4wta0kLSu+YHA5OWoEQxZD8LAVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQIeLCRA9TVsSAnZWagAA2SsP/RlYzvXZxkDS7gpfLPIR\nXJ9U47nEJdJ5Nh5zMfYw+1GC7lMAXSIa6hSdgTeWfgAUADFOFiWRBxLL6D7r\n0b4o728iMhshBDPmTi/yunQYWg6w3x64W8o3knO/+E35k9Am8FS6j5KPv5Pt\n8EoQluzO5enOtqb7KBZvejILoceqsSZWRS/P/0EvqA3Tzp6QIAXYBTqOFdDm\nokGVnjUtlK+G30Zg+dLlo0NM/l9b1P9Adno6jutMdqjNlaCN/gNCaMoz6KVX\n6Rk7xbaxZdbYksIEvWm4PVCvaWTbP829f8MbPjSyk7mBVuit++FM9A/FoADK\nXWk87pJFsDxb6o6+vXVN9A6Bb1oopsqANFnhRHRWsCjwIqgkd58QxZvCxu6b\nF4loMTDVQ/vqhV2zpmQ9NftnR+7y7xO3Hat9uQuqnDvMNZAFiUFdyIkGfSik\nXyxgIZy5m0nqKts7c+ZfBVAw4MDEvri5s+TMkxEJeaCgjeJx48ACztTy4VQf\nsiZZ9mh7qgeM0aW42zKncgrmzoyucru/G0qFFCch07QVAkGmyQxmBS+KIMUX\nTXSkkwv29f8OZxu4uZiq4AqOX9uIScp/VsEIXDVmj5Zm2l9/zefEsNKoqWkM\npL0yi6G5h4HojPmMgnG16HH3eX0FMVFtK1OmN98LjscVEmxrozoNd0kIImod\nMTs5\r\n=m757\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"136fd6ebc55f63d920733ed2082105f41cc0ad16","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-136fd6-ktjzscsz_1631618955561_0.9534028826384604","host":"s3://npm-registry-packages"}},"3.1.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2ea6b25a6d556fcfa4a58e6c53ca2c4e8f8975a4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-vXQ2IR8pBvPzMiLwk+ADoLQNP/bhlvhzViWDjJR6bESYctLhaItnOMn5TOSwGpNlEmev/AZuRX/FLY/N8nc1IQ==","signatures":[{"sig":"MEUCIQDTTH6JBr/KwCiEGRh4ESRiK78AUU3XzjNtLlFx3HZUBwIgMFQIzmgATpLDMdgamBPCuH9ypYZC7yQCg7gZNzgWpoA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQIfACRA9TVsSAnZWagAADRQP+wRPhlEK0OLw0M3YNtk6\n+VdMplUvLLj9vfnpAJq9JX2dVM+mKYPZt//A2SnkkMBfygO3IljwDuNuIe7u\n8f9B5P7IVMmSP79ZVork7QKIbCa9V/ggxnr6fyqsMca64cVQ7vxEBiA5oRZj\nrh1Y5TJ4ov7EOxhYm0CiZ/TLLwySiC/hZw3XN8Fyqakx667YsObIFlpt0AKN\nPEvpTT1UlNyLhaAuGMzLbYZLVb/sEFO5fN5mGSz29dns7IVJzfq20TUOAO7R\nskpQdovysDtObglMMvLXmRZoQJfTfwfENH9G1J9/HzUlPNAwFO/0B7r4SpFY\neSUOMa5rvjl48a6Nobhpg2cKFy7WB1mR0q8tz9Pr0jLVLId07oX0pljxWZqp\nTJGcsE4eAues4XZYp6peO8yUvzZDiQ6P1dLgtodCm1DTEg/8s42FFs0V2Ca6\nz/lSy/CRrOzpNQ9XuSpDc0fzd1xAbMsiiuR28uCALBGqDtU9/GvvkACpKm8n\nOjkTzYkc3gHFt6IOH8+kyRKYDdG7yPN2kF6+ZMDYidi6s7x3PNVuU1WONvqM\ntFM+DdO3YMmkz8PFx0wt+M39TRJ6LZN3CXc++ozJ1hWFLoYvjU2Z7kiEjlPy\nuq95b0TPeoZT9XdX5WBu7Mcwq4AMzRqIq1PNvytSAF4mFiRqIq5JMWm6WlE2\nmwcl\r\n=NtaO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"008a63529cac9bc6efd3bdc0fe8ab23ce040eab9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.1_1631619007957_0.26991771862182157","host":"s3://npm-registry-packages"}},"3.1.0-feature-74b3b8-ktjzvja8":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-74b3b8-ktjzvja8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-74b3b8-ktjzvja8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fcd16a4cac4c1758cb4db6aaa1f66af95212597c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-74b3b8-ktjzvja8.tgz","fileCount":153,"integrity":"sha512-e8Ehnr3uWkeUOmY+TjlZ+a/bbRcta9APitHRaQyZ9Z7GF2vBhAM19k8cROuvxNrCn3TPjmaP12fr13zATF6CVA==","signatures":[{"sig":"MEQCIAdihouXlMEiynihUm+bJBjNZ6YN/sUSpEnDWHyfN/RvAiBvVJ9IBd0xoAyc0iSIfPGmnmTcHgjqsXb1ZzRkQUcZ6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQIgmCRA9TVsSAnZWagAA1zwP+wS8XcLypAOJjXKvRi+J\nWbRj3UFDNz+XVUBsW09EnfJHH+y98DDkvO8Bf9EkooRHBFwUacjaGhhX0dfW\nvwAhfUOLWMVw3nOUXMRwqf3csiOgWs2ksoQdMeMn6lECN3QfZJY8pygZgrxs\n0XRCZAlK+7l+TC2dZT3p03rFxnsaDhrsoJUqUKEQJ3/vgImZRD2+gykcYXOO\na9uwn8JL6Rvo7Ety9P9ClzEyuE+kNHK1opnpPvmZI1uzRLso5ARXf8ygDus2\n0AC99mYjfkwGg6LJ0WmxF9j8k4XINMTn7PQ3dGPM2bjaFpJQ4HEBH69e0JGi\nHdIPqqvGbyc6pPGEElzgEta8ap6sefb1CsrIB0Yy/SpLZndYh0HbTTtmKhO6\njIgSpu6tuQT8N18fgeA0I758PknjW8YNZylSBLm6CglFy7IGl9akLYnXemA0\n+jnxsyYXGo7Jl2DNS2Xzvxk3776aYBdyLZkQpWhnkPM3P5Wmmbkm++qgR6S2\nS/TD6NXXe1hqhyHIIFbnJaPbxIcKeqRsKZ3S7RwPZPhhZiWYd0A8+53MdFOX\ngR9KIcOJ6GM4E7Ij3YgRDdY3IGWhahqcaVyhh1z/eiywYHTaAEUm6/cglYks\nEkxJwMr4mDHLtBKXlKp2OS0nZhua7s6gxxgipEJDwDJ+Hf7EGb8s6vcDcY8M\nM3c0\r\n=fn24\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"74b3b89a61a7cc2bcfcdfbe46796aa52669bc076","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-74b3b8-ktjzvja8_1631619109976_0.5347695895354674","host":"s3://npm-registry-packages"}},"3.1.0-feature-093c1a-ktk046y9":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-093c1a-ktk046y9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-093c1a-ktk046y9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"79387583b6295cf1f4f92292e5687cc8193c978b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-093c1a-ktk046y9.tgz","fileCount":153,"integrity":"sha512-wX1FCYVWf0BwdK83w27drqjaRfpd1kr5S7XQ+9kTn+XI5NfYLVYmCK2wCNEmGo4cY+0K8j0nWxBi3WrsQGLJqA==","signatures":[{"sig":"MEYCIQCiYECLfrNYkF4URaf8WY1sX90mJeLq+FsTiEb2VqfBgQIhAKf7Tuw1M1rjvEWpQUaW3jXE+m/+z1N77Vzeh2iwbHED","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQIm6CRA9TVsSAnZWagAAJ/AQAIDjIOGfeCudJl521B7Y\n9dVdLxs34FJoIva2+BVE+aXW0glvuwX4Blh31dp3gS2dWe/4/Y4KETCwRXoT\nrO5y/eksnWK9rJ2Ncewk36xsafg3u+5tWV+S2W/pKMlMHbNVQexIkUvH20VC\n6Ljbzx2Q6DKtGOeLLrui1TXcmFy1oz6c2XNLuFR+SLA5ZSzhftpceq1gFaOP\nvCQDCGytg9wXTzKhuR2nT2E1UaTfy4qzwFcQeOyvUX0X5gnE0TPbkhrh9F4M\nanTWvv22/2w1hyguZlaVjLjCfj5Z9dwaDxXUe1JTFHu+XYWYaKUmebmzHF+S\nziVmCgUbXA0MeErXN+h7wD36TPLeET3BamVQYgRVb6emJBEc004pCd3kscML\nX5zCr2mQ7vPV0OzWps66be69BZYcqTuE9AJ24w/ztPW+9XRxUb+7mklXW9Yg\nYVsNsRZbhLDKHVPeT4tcSoIMnCXa0xS0ASgdYuyITf1WnVv3RtSanqQphaER\npv9Ou4r86ZWe9F7T5j/ua6e63T0Hsgt78IVmQuLb3mWUAoyyJf0e3DW/KUSl\nC7ASgZLgW/OEaqb/y9YUxXaWgI9OzJ1vB1ZNk8F0z70rujfIDuGapTMFfyW2\nGyDX9pkuX9PqoTR5d7W6kJp3Utxo5xOM5JK6wQkbpj0XmIoyoO8g/Ax7Q8j1\nDEtp\r\n=gq88\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"093c1a8dfc4dd7be04c909a365e908687ed92cf3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-093c1a-ktk046y9_1631619514055_0.32779449213187606","host":"s3://npm-registry-packages"}},"3.1.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5f2cded64d554d2c60cb4300853d3dc6bb409582","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.2.tgz","fileCount":153,"integrity":"sha512-D1kPDNGJpEPYppWxqmZm2GetwvBYByB+15L8tfmQOqRk0/nHfpJl90OBEHdf+liZuBj4YHYQ54QU8BKCyTGeMQ==","signatures":[{"sig":"MEQCIFdafajXrchX5JHIaVEfzmXUFdyVxIZNrJzwHuLDsAu+AiBEn52/vCDx0VgVKlr/QwBE2husZlFm8Cx1EOq79+ULeA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQI6oCRA9TVsSAnZWagAALh0P/1ydF/jK1laiAnrxCtUl\nVXuY/vJIL4hMXMtwrv07cEBCl7+JunwLcP/td5o3fjQs6N/UbPBdl5Osrwe5\nrcffG+Oe9HqQ/WjheaR2BAXD2MxP6xme/nPFEb0HdhmNt2/CD6baSNAZkGA1\nWUKA7+ROx9zGn/jY3KsFkFBRhLf1vb0dOjTZlx0gNIfWGN2cDmtqCS0rP5rY\nV1FhCld6Lak0vhjeFG8gsomiF/s94yYF0PdoztJL3iqfEV3/cSzvfh0TgJTP\n4qGarU7gX/ZjwBC3JxUWYnuV4uOO1UiBqW456o0FiCD6j5UXrXkUiyEUPMLs\nrljK1FXTeN1J5/6HO3Sq2MNwxcbf7kU59kzBG6KAHdKm+ceLL23xNg785aa1\nquFrDTTlxMTJgxKHa04mtONb9RkXBWQG2l4ri1Vj5X+0XscZY5kJK+RCsRpL\nyKaxxZewwTKbwWPHjXBVPFiqLEVn9+QV4Kj/Cy0c2LT3TdwZhm0jwU2FD4XS\ncSK44kM09eHXY4urvUQkmi2mmaxTs4jCYDFnGCB0S0tAZBqGNxmmD0jHRXI9\ndNaocHzZ32g41M4WBGPYhmvznvHbuJQoBqtMuOqaC48zVQEN8xDQGshvnFRW\nteKTSzXtDmag3n2qYDzcvGAaF1Gz9/5qHk+EBLKwSw9/2RlsslekWDw6NPNC\nTKCK\r\n=5jWx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3f3719b182067127f6c865f903428c038d2a9393","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.2_1631620776661_0.789307131389946","host":"s3://npm-registry-packages"}},"3.1.0-feature-d380ab-ktk1087f":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-d380ab-ktk1087f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-d380ab-ktk1087f","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"25e17620449e2e96ace8a6bfcc88df7a373105bf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-d380ab-ktk1087f.tgz","fileCount":158,"integrity":"sha512-wzGuJXKlsuwMp3kXuPnOqWrAoUtaM3enyqvJ5hKS18IAzBtIvoFqQJkJP9730y5YUe8hrV8DjY4nZj1J6YHSrg==","signatures":[{"sig":"MEUCIQDZBAi1QkcQMV1+xK59MLQCJ0xcCxfUz/npP3xMRscDBQIgR+/L80UihR0tF40ipiSzoP5nqPP3MnnbSpWFBDQ+ryg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQI+PCRA9TVsSAnZWagAA8bcQAIy6LCsl6Zpp1xrmHWye\nVaB7Ix6R/eR4uyytTXNgEDkfDh1hWcg6f4MFrWdigSbMf9svLrp3vyJKOZr9\nCNFjo2UradJKU8IwL3s34OJn5DGw4okY9eN4gVzxWq8fup4515ac/Syp5qXK\nqRQzuRT0Vj4htrjeCOq25ACnFjJcud9ALP/PpY0TxFwf8g61Gek54D3tHYZQ\nSb0NWTlMAzXnmpv0UsmOwvwriCkQlhyMDb/5F/JDK/Km3UYHZKhmLj+PJmRX\n7wsPlHLxAiN8hFDGQe1QaVFyrgkgg5SIeZ864dpr6Qp6nzqcLuuzUHLBDmer\nOYcyv28ZIdSz6SNgkNFl51rrRC10d6lc2ZbtlJ0CX+gSa8DV8mrv3CWjDIG2\npEtl7bUab4I1mvSnY1MsTepY1Zjm0ilp5nR5Ze7HI0Y6iP3dx9yXXtDqgldz\nZPHvlWUEmrR/xkdu5yazQWVFOYwKATNmwUI52/TwWYl4qEse2z7NxD+WUzbr\nzYIR6moOjpXpuiPwB8dPp97Ck2L8Qtr5kO/27yt2FsLyHWDb4AQvWzp+I/6X\nB5U/asn3UfaW4NteDJyBDV7sbKTA4nWmzOpwNmjuBUhfcN0Nd625FuxSvo9e\nz/0Sx6l4kV5xu4kJhzfbF7eHvTQmbe9mXSOxZkIcOuDTNWHYWADu+FRaMM4Y\njMoQ\r\n=O4eo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d380ab73022d1155a41e4b97d3a124ccdd63b661","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-d380ab-ktk1087f_1631621007188_0.6474026741953569","host":"s3://npm-registry-packages"}},"3.1.0-feature-d6072c-ktk112zm":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-d6072c-ktk112zm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-d6072c-ktk112zm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c944611dfebfbf3fe72e6e147f476f21e081601c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-d6072c-ktk112zm.tgz","fileCount":153,"integrity":"sha512-xR2i3ziM+3lmi/24EzWwWKwbbyMtoXXc/xmArLQAMkgD9MrO9pHUzgPPx0uodrmz1wVwBzE1Du1911Kh0R1MDQ==","signatures":[{"sig":"MEUCIQD8DqrAHqrHzQ5s4emZGZgW2n9J64aDQmPmswu2876zLAIgS55V1JAOONXRkm+0++luEcHAphY8i8rlFyLD9CrQ/So=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQI+zCRA9TVsSAnZWagAAsmkP/jI0eaYO526n2phR5PP0\nCzjTxQvNa0uOwIT4OVlbLHr9coQBhFFULv+aldKDPsZgxH3s50Sq4yf/+n+O\nhSxUZOYewpze2XPxqTDIt/wp9KcrYK76ND9gTF/y4sIdz/yjiNGyk7ezZQar\nVNtcflVVDdboXKN85S1AmnO8/qSFdoqYE+yPzxsN7w4Yewe/SP71G/JDsAsr\nRtHTzsxIyLL89W1HRx8fsna/y4B3BuX3kFSr84yBMa4FYlEHXeDYVoqdFncC\nDexU/y9vfVinEpYpWEDrno0BNZjXdQ9NWZ54DKoRPfPnNNGloJOWxM7cYUZd\nY1l3FnRynjudM3+kWSR57NYtuPfjEK1Qo/qp41oK6K5+cpr5C9EddsYefK9B\nSJSXgIYFdipZ14h3QzxX61aDbf/E42fFk+FEEiHBI2nYLGvgEXmKSX8SaKg6\n5wrzaOyeAhmsfuHZ/ZJLEW2NLjGa+cHgaDZMIRm73jgCRtyDWbaAWlyJy2V6\nOz0I0rpeSQ6mjl8M2AxHpWSCRfNsQgQ6DT+LGmja5amz7dTYLdkXFjH7vByu\not51INvZoW8oAElqiplBapzaKha4X/0aIs2FU6szGaXz8/3VSKvzL1DQWggj\nIzoj6pF/pYLID1VK5aAfs0+ew+nLToYFrKc5lJvSLme/RoGKl3NXQ/J6AORk\nD0c/\r\n=xVUY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d6072c9e46bc62e1be3b3cd09d51f01cbbc85181","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-d6072c-ktk112zm_1631621043476_0.28666334701649276","host":"s3://npm-registry-packages"}},"3.1.0-feature-46cbc2-ktk11pgn":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-46cbc2-ktk11pgn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-46cbc2-ktk11pgn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f57f169494109ae8bf5f4e614f332ee3b027220a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-46cbc2-ktk11pgn.tgz","fileCount":153,"integrity":"sha512-p4HBNRPk+6JIFbI8utmB8DS/0PgeaDOjEYm17e9SfSvHzVG3Zl2FI1jzpVmGC7mz0xqFB2+VsYgmCf/yrYR7wQ==","signatures":[{"sig":"MEUCIQDIMDw+SMvFAXlahfnK5vhd5Wgg3y7f3p/7Ku+fqoo5jAIgZCvzmKq4NjRoa4c0LW78xSJFGuCColUzQtxnSpFSYSg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQI/UCRA9TVsSAnZWagAA74MP/2K6cHFOD8l/lp88vwMq\nKDTgX6fgk7dXV1BViAqq63nqL7eNrdub4m+ymAinWEjyRcHuIUWSIn5gsFSA\npHoeaMkqBBFk/wrOg0vQxqYBIF/w0/+Jp1CgVBqXUPD0whvd9lB6VlvItIPR\nyJuxYMy8qmxSZAGEnZOsDMt7obUvJbVwre7OrqYlCG4ikZbkXPUe0Wxc5WFk\nahWDiIRAaiAzH39L8cJIjgBRsFJe3c4D6UCnVcEH02VzA6gt+042OEiH7eYU\nT3rq5JgreZxfJKPUYMQ2OZv8CZvqqq2BMmyfNlnpvRV6sT9/GQPi7v3A3jGZ\numPFaSWOqHwfjOEoK03mnECIf11K7c3w435lAK/g/fN3zSXZ8bH7xWosjnFi\nfFwkvuNAwf0ZGwtIimotso94hIC1Yz5CwMlHFh97CPzrwuU3hdqJap33Lvdc\ntwqrxbjlcw2xR2Wf/5aJlxRmz2RhB7cLsmgECROl07jtYNxhKBnv9lodGPRB\nXEX+92AxPMJbKa2p9ZzxmBlpgaUGKfZsRDkwrEeF9nBKrmkcWuQKUEe0EKr4\nCFzbIl+4XjB/Nbvb0BcZtXI/lXcHCvUwNq8kLHxBMVuTYz0tp9Eeef+bc+zr\nHL6JuJZZd0fDJeAWCs1tU4ZbI5rvpkqJIXOjNGK7wfzLEDQ4zVIH0KtpUt1N\nNO/e\r\n=Da/x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"46cbc27de0b2d96f6aa3451502730fc3180f9ca9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-46cbc2-ktk11pgn_1631621076301_0.7082137639251791","host":"s3://npm-registry-packages"}},"3.1.0-feature-404418-ktk46pru":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-404418-ktk46pru","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-404418-ktk46pru","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"436fccf485b6f1a1c53ac8fe3e3baddb8e313eb2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-404418-ktk46pru.tgz","fileCount":153,"integrity":"sha512-vnos8BC25iKM89V8ChQ/bIfcsbuiTYsn65zoBk0KH+8wQY3SFTaxS9//ITPPOdjmnI6IjP7FPnWUlae0Ts4u2g==","signatures":[{"sig":"MEUCIQD0BIlYBQPGrBYNXRECT5BXIEq55TZPe10rsqp/rKNr2gIgR+o6VvK4cV2JsWLWVECUVkyzg6wTjlaNK6DjudJRGRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKRoCRA9TVsSAnZWagAA0+YP/ixYH1cGbWrY3sIm4Ty5\nro9W6r3NvTXoKfdK5bqf3sRByANju3/5hmMFzOeDHcicFvV7YKAKmD82ltok\n6F9FgmE/jsaDzLpmB3aAjQ68iZ1y5UCrW3c8CWcfOu4qAnt7GVCqBGEZ3Qa5\nfGO323WalCMV0APJIiC5zzdT1t3MvO/ze2AcGVQOxzTBFWv+pLhvgeZw5/Dp\nFUWjjzz+eyJWDFLNQUi1Ln7uix1jEIp6JtPdzC7I/Qo0TFf7QWo/bL/tjbn1\nqfcGj0xmnftLrNGvgKoSbiy3R3/kJ0UlIxyM1guOKdGzbJd7pWe5WQutRHbm\nBaXnf0rNrlxaMHeasbgrOeqcuj5RfUu7K8DKDwLrCSdLtt3HzoQO0vNNJzbf\noOxKvOjJnMncZNfJTQNWsQliGAFCDqRsMGqZNH62rD65HFkBtePd1J7dYS37\nsge74hSSlmc3GX59b+OtO6CQnbpkNO3HY2Gb+9xBXOFL+sl47EeVY3LvdVrJ\n2CacG+bfmJ6f2D1ib9OE+rXYgSU03budbWuzFGpNJqIe6KcHuYyIISeZbw7y\ni8l/+kBEgHlQO/AvFpUV+Vpl+JLjVU/PQsGD5Y/M/1w2N2fl6TEZlZL4aPUl\nyaakLaZmK1y6lAA51h0+7gipZUTSooKwvhEaVJsDPHrwncjNQiK9M9qK7RlC\nUj0O\r\n=1idZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"404418a60811b10796d583e9627143cb261a562c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-404418-ktk46pru_1631626344040_0.7703836517971623","host":"s3://npm-registry-packages"}},"3.1.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4b37e30fab534da5fa5ee1a89463770402df49b5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.3.tgz","fileCount":153,"integrity":"sha512-Ts085VFWrnEztMbGHs4JCq0d370WFIKubk7ZUDFW0XDe6YBGUF9pMkTvryRUHzLszJ2jAWsGHrwWqGesT6mAPQ==","signatures":[{"sig":"MEUCIQDFWu5hglV8bh9d+XFrpsWapYjXLO89cfAumDSEX6odtQIgHJTy47bUePa0pd600TK9RTWSrmHo4IRAFdfy+amugzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKURCRA9TVsSAnZWagAAZG0P/AkD0eZmY+iGHbHtmNUh\nmnvbFEM0E8/oQPW8rsiOrc8aId7kMwDK5Wvd3L5Kx4LPVU0TWfX05Tdx6vqN\nZ61ouB6SZI/pMLBQ7yOnkWZytNpInh3nOR1O94VvCriPndzFPmuQdG9ptjBq\ngoAipsqdvssWub5PlNjYViqDbaVSqsbQrL7e9J8v9O76V/2jiabGPnQydmb3\nkublpJhXGBujxz3d+6r31RvyAdB5mFCOLQDUn3J0Xy/7oXHHIsP/LYpnfPHo\niZfUIXTkTB5mMNTYcgJmze1EuIE8JbulC+d3Y+PWZt9/iw3tuwWJSSnTeM94\nu/P0/pjQcAVPhpXwAhIA62RLond1aT/LYtrhZaOHjftPA8WGVSrL3ZdMkJfQ\np14r2Qf7WVj1L440OPYqZJBSv+hNwRcuR4h4Af/u8OtUBT2dSeebfnCOQq67\nUCjElAFCPibEeMtIHYsNn+7/5IFXQEvfO+VobKlpLVRvqrR9vHyoZWzMbuSs\nzr+qLSmg2Q10yuriHYHwDecMWIQ9IhWFeghEQe7GRKi38mDCo16qA3Iuwcrx\nkye+etKmR38WfScGb/8JpXewa8U4y/LVMekLmK4jbuAoS2uS8+9IWKv7YDO9\nYSRz7z7e+sBvDWncUolg/00bNqdg8Z/VYJcvKiqbtNhyQ5kcTDhn9oupui6N\nNPNN\r\n=htKc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2f14fc8ff39d5c1c6827f102daa5c8b69ef9ce3e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.3_1631626513690_0.5074134116962519","host":"s3://npm-registry-packages"}},"3.1.0-feature-5375e1-ktk4f10z":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-5375e1-ktk4f10z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-5375e1-ktk4f10z","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9baf3be098da7f6b19a7e65d73d9dbf90f90749e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-5375e1-ktk4f10z.tgz","fileCount":153,"integrity":"sha512-U+GKbSrR0oM9B/48zgqxVoV/e7fxND9mmonkeMp2qaBt1n5jsQ8vxSDV0DeX8RHRnFctCsbgp1KnE6ScNTjPrA==","signatures":[{"sig":"MEQCIB70zIGe4CV48z3rJ02eyFO3G0hagi7FBkj9gDPKvUNwAiAvv2PKUd5MmcC1jGEtDQdHieGl/HFj+FXaQimbJt8zaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKXxCRA9TVsSAnZWagAAQ0sQAKGAY2qcmkrIHQvNWou4\npEev7CoHLvzFP8cRbfNyiIBOLL3snm5fHVNjpvzGe21EhITJ2SnI7l9rfdpD\nyPTVhGk1FEDxK17QQYy8AJ6oKcq1M+M8GcemFjJ1lG9N171VqPONlvrRdYcf\nSr9zIvEdqDFQ0ikl+aCS41GlZCCoOpkdiQJ8oG+tKAiQms4EnEbWLVE39f2p\nre7QJt9/d7qv3WMxspuzYbLn5mgf5adTSCedSRvCsh4csHqq3OxS41Ap4mcj\nhq7hFZrkXPAAYCbU6NvzMj9xY9W63jUIPWpjrcTa+eANpnDe1dWZ9wTvOGvb\ng/qefbsLUlJVRkI0dT4G6MhDapT1W+76Aw4vnP8mNFd6q10eqhla5+fe751w\nI55W2jB65FlOVB8CVnQm1itGtdVHjPpR2V5MJh/t07yqPFX9koSewRu0YMoW\nNVLNB69N2dkUD0zwV55yjURpNbvQyUHCEX3suyrkbTxXcJKXNXxsWmfK6ncV\nHuD/91Gq7vUVKFAXZ1ejBcXYOCc+1IAIwUv+5TOahJtrG9gRGPveIY2uWCU0\nzel7BGznr5v4jkqKYU1PeAYBwC77/bv7dXTfd0/O87c2iCGVTVtIxVHkDTiZ\nw2/NVBx8Dlicq0s7D/LAKqx1ydubZ4q+X6aKbruTRFNuu0ouQDkq5UirOI1Y\n7A0c\r\n=RDUl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5375e1780db7c9bc3ef1365b06adb944b3fd7f47","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-5375e1-ktk4f10z_1631626737103_0.790633306440798","host":"s3://npm-registry-packages"}},"3.1.0-feature-7f6b66-ktk4gbww":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-7f6b66-ktk4gbww","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-7f6b66-ktk4gbww","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a2c26405acf0813f7439e755c6a3155648b6471e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-7f6b66-ktk4gbww.tgz","fileCount":158,"integrity":"sha512-QSdAIYpVocl4M5YwD0jw0bc0UUK1EBbmWU/eURTLM5qQ7z9DxjKI4NV69uqd1Je8sS68gPYEl57Z/gGaUhmNmw==","signatures":[{"sig":"MEUCIQDB/mjcBECXlM5ZK1HFtK3uxUgyp6UbwSUXWyVSlV1iBgIgX2Eu5iHJrDZpDHUwi4YKEN3aormbXm/IIz/Q6zZRoQc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKYpCRA9TVsSAnZWagAAi44P/1Oc4MwTNBh0KJV4CUPX\nwM6whn+9Rt+B9x73/SpqdBzaVepgnMFBVMv0Uw4ZeKMECPA6s9iZXpjjreG/\nw2Wggijfhal1XaA4BlO5L2RFnLCQ5TFKMIlAaqoNIRAJCXKpDm2uAzwJBDNm\nu7RcbxjXqROAuRdIwUZB2Let55zxecC6b3lP8meW3rnZhGRAWRW3El6zHHrP\nPWgFhjqR37rbWlTkLXEXilstFO4s/Q8vc/zQLNy6DAk/6Cs7OZTVy9mLuyY8\nf9V1XKX7Hixp10YsrGayJ6qdn//d5jeP2TMfMLRyHon9e2eosq6b1Wq+GbHY\njmedR045O1pLLjYIzA/f87kcznEJlVM588441SAExOSmmHdk18je4jtrOcrb\nmdZOfucM7rjbHFh27eOqwyzdxN7mbgTV/Z1Vfqu1K79vaQevscEliCYIlVhX\nyhTmELQeaDykQhRe9p6BaoMODp44PGeJQlYJbdyYwn98XcSfVYQH5bjssOeT\naOLZ0TURSdP2HjnjsvzTnRnaYz+ai0vDOXsf6yG26cXbPCfMv/EFbvLvXLhK\nib/cGPVpYD7j6um5FuwFMRElAsjCeLTB6CgOiPZHi6MR6Q786yp8U1kuiaei\nO57+H1q5x2iQM77jIQY0vQ3vlkqcIT4yORnMtFlg5aHnB1u5Z1aSGARdJkNp\nzpna\r\n=XsJh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7f6b663c44d89cd417f8617ddbab68958d375b53","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-7f6b66-ktk4gbww_1631626793290_0.8383097113351634","host":"s3://npm-registry-packages"}},"3.1.0-feature-ef7fbd-ktk4hhxa":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-ef7fbd-ktk4hhxa","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-ef7fbd-ktk4hhxa","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"970463b24b00fd13132ca8c4db303ba78324d80b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-ef7fbd-ktk4hhxa.tgz","fileCount":153,"integrity":"sha512-gZwzmsDEnRPhz+xcvBPjXKzWMkf/ERFie3JpmBNRQkfk3eLHc2HU92a8yFunQtF3uunUgaTceI298mJ2fi95sA==","signatures":[{"sig":"MEUCIQCY7Sj9BkMv/+9JscfbZAfMkVLOFzoooQ+bgAELiEMEHwIgEYAXgG7ZqIMEnGIa/eVkfEbqvRPI27rQHax/WD/YbUg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKZfCRA9TVsSAnZWagAAkb0P/0ydEwOBvlxzHsRzjarF\nkgSBwIsEQhqh36yPZRc2vQdu38KKyBCmeZcdItmwys+hf61gdB/S/EtoQdK7\ndjPhamLcLIwE85pk5eXPdXOh1Wq7gb3h5ZbpW342OSZ6iEitlIRoFz1NwiUq\n2KDDje2NZ03sBqIsVYGXppjw/sIewZd+ExUSWnhUZrwRHl1Wqj92BgFpfowL\nwe2dNZp+G67kmPcIk218Qm3dZ8Kqw4zjN7gBTyYd6hFTSLlk2gDD2k/lgv1L\nN4WsB+F/gBJurB0sNc2WF6x0yeHwhnGr3I8yveTL+ymE8HsmCRcQ3drGw/aH\nyzrqFa9rxo5wmbyu9KAPIbvK9z32goYco+jatjEKzIAOAfvNH3Z98u7ae7/m\nvhVasURyHZ0twWb50AZbxX1d8IJmoBMBDDlM3LS1mPQ7WtdfGw2T4AhQH35w\n5EvZu0HimO75BD2iTwOKZWdoCYVf6TcYhZ/1DMhERPbA2GAOpNlc8t4WfeIt\nlFm5EQ4XiJh1SQtKk0y4yfkqDo2dzGV1uP91DHVls+Yb3ddviORGsuiRWytb\nPeDQXQ61yDh7ybNZezRWR21R4RaA2mvIdtTnbplya6eyxK7VFoIj80diFdNY\nH+dUjSNf3Uzbj1W0KAFujPpXgcMWjsiWDbujgWPQCdRdPkrgTHZK/5HSqdJM\ng33d\r\n=eYNS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ef7fbd099d49614d45c269c89102a227a81736b4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-ef7fbd-ktk4hhxa_1631626847825_0.8717607087845054","host":"s3://npm-registry-packages"}},"3.0.7":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8afa2b0c2e54f84c13f91fc142a922f0ca65caee","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.7.tgz","fileCount":153,"integrity":"sha512-UAZg131kup+f8xIeQlczXlS4emSZ3Q1ddZj8ftQq6MlGJjI2kKYXiOgFEEi6n/wMtfBIIBe0ATmCJrjb3WnQRQ==","signatures":[{"sig":"MEYCIQCJ/gHlaAE8H16KcEam+5apxDqXkE5vcTZffTvqV43HGgIhALNrvVbFIi05Tq0Vv9ZkVUN80K9LLatflCk1jJ9g3hUi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKy0CRA9TVsSAnZWagAALl0P/AkbcULrrImt3YjcOl5k\nWtD8QEsQkNsvdcMZTVFsaSUohPyPLSp4tWyQ8eu97r0PMCTT4ZhgfiXJRtbw\nbOkTQCxvkgLOp2lJfEh7/7doE7l1MaXlRs2KcotvULNblTp577R8GuPNQPiF\n+R792Qy55z8Ls2OG0f1p873hdwsNkMEwSe4nVwuS/HHd4yr3LMfaVAcAWr5t\n0j5rfCiUAwPTZxqvlW/7TxN3A8RzQWQJ4yZZQO6z+mz3t4NjdhDN+3Zu2c0A\n6BCBusRPafFyct0vGvzVNyO23bE06Mw44CwnrZ8BFQO8eGxIejmxOr27Hyi0\nOvEmxVrYJ+4qWa+fOgJIzg0ch+LyYPO1CRIFOYeEn4S7vSzgxof9Z8i9VgVO\nVet8BnJMx//O7oK4fqwbGS2OSV6g8/rLd7U7gH8ajjgZ/IPTLWQ5TJ3TSbFk\nlZYi3Sst8RDe4U1ldLpQQvgAqOWTScdGQt0w6Q0e6hsefZ3X1umQMvnMtne8\nylXY1cn1g7uJNhqKrso0GlqBStr8hnQ7tco/IoKpspahqjnxIDz04C4EIY0F\nO4PLx/Qyw1sda7kRmyl9ESkv9xhUGGTUwIOeM2OIKRcwmrCGtM8ucqQ2fMxV\nl4Mq50V3BFf1J0CSVkOIhnbr2wRmfzEezXDMnCnZqXAHBeBwTYt4fzSIbDXA\n31B5\r\n=V0e5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"f37d856e6f5edd3b1a48c4ed456901a0f2b02f02","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.5"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.7_1631628467916_0.44672161985581416","host":"s3://npm-registry-packages"}},"3.0.7-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.7-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.7-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df2c13b8a79e579299048b6f452db83804ec5395","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.7-beta.1.tgz","fileCount":153,"integrity":"sha512-N1Mqhy+QZUOgI62G0NDK5A6WOw3m+WGXwHn7UrTJ4Z4Urz6KvaFJkHsZ1Nk003nRyerCT+kAoRbNyIhmOr4tnQ==","signatures":[{"sig":"MEYCIQDLsMTv8UWikQDHYR6bVQQlajrwCVRW5+5r4zfAb9/iWwIhAKeHTHpkZfJ4H2Y48pZVVtb0cZJpksScZFUnFHMfgU5p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQKzyCRA9TVsSAnZWagAATcoP/2678HOkT2QfCWZHnFkL\nyGFUlT8iWubBqtOeZvih6D4TsvtRHWluGYYRQ/PaJDdhB2xjU613K5LAY1HV\nifi8ZbUcN20e9jmcrVQt7yXC1iXA1ms7ioB50KGMITbYZ/0DIXCC+83FZni3\nRjFxX0nMOLNdMYA5pbvkaohYYZa8GHT/pSCuYY9P9VomG9ZOf6TA2+C44+/H\njaMHM+RdF0QT0uIPfkuejREc+wXjMAfb8OnmKiRMwJgIsZKGdNUHNitiLz8g\nvopyT00ttAUG/qv64b7AMspm3rpWzBoDd+w0Wjm3x/Nl5nRDd1SWQTJOdQAr\nliUa1tPStWwyYkXCfrzuR41L1ZdXvy1kiCIJEno/psS8MJg4mchif3J8iK/l\nsSTOgKHTNS+0ydj6NdJq1ULVZIZGEC4G6CwfQSr4L0e4OySJc80t9rbhY6qe\n3zMVFXgi6iWVlRjblM/jIUu4LXJYBunC/JZaPYEUNmay5MUTWq6+0FfATBhH\nNHzMZPrTNq0rXl8RGt4/jzdmj4L8aV6Vwnq2Du5IgRjlODepsGi2KsG4Hy+d\nFdAVZRcCz0sjqwMqCrPF4W5/eq9mJQ5uvFAHrApkFGLWWphyN/EUoCOVjRkd\n1lY4P24RUXlNpki1wE2OphpOhztiWiHvblrHuP9Zf2Hd1ZMJ1ec7B1O5baVn\n+gtR\r\n=IXcU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fe2fc6bfb5a2bc7828011ba8c7c68e304dd9e1b6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.0.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.7-beta.1_1631628529982_0.9392654623979886","host":"s3://npm-registry-packages"}},"3.1.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e2c4812a1a5cf06e13176f1ca8d50ced55bdd43e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.4.tgz","fileCount":153,"integrity":"sha512-xL5KKAFMuwDAnykukY+vzrG7cc/zqbPB0dQmqrRq3Nso3rP7rOKf7bmSyAXwOrJUKVAuZ4SYHdu9JVCohc38Fg==","signatures":[{"sig":"MEUCIH3kxgJT7oaLuNXr5QVf1b2nQf4EXcPKWLfwc2+gTg0kAiEAiFF34LlkaNehhZAFCLMSWvgY9yKSTn3Jwmt3YvvXSvE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQK03CRA9TVsSAnZWagAAiQ0P/0c4/gunff6cHAGLJkjx\nvkA8ukyExX9ul0QvnfcdtAnSuNdJcGFVM6lw/jZh6O2CPvv5OFg1jyOxEEe3\nh28z7PyJonGFzu8aw+AJpzGlHmLi4kMcyWJGDj7Jsq8P7EaP8LNy7a4FGIJI\n3ZiBPd9TP02Mtm6+xXpPpSW7r7gocGCHBhZA2TwVdEHzHirwFz7yOwYhRd7c\neMteTk16pXVUgI/tIYVVQLYUIzV3MPqP8XaxaHYXHdAEoYBV+TWdD5nMkU9h\nCbpzEf49Ef7Io0N0DHSUQXoKaixUYt6NoL9XUgZntDPE96Myq72x3+uX4n5K\n2ju8pQf8ZwkcN5Nzbhi893PGwA7aWJDe+h97kBLBOKaP/HTJ5HjAqT2lYXje\nUr4sVCe+Nm7VRPcjxV4oh2ygo8s3DpDpnr8c5hiIo5NnRtY0jYDmdGe2YVJk\nYwZJkRZOZyMNfjmuFv/kgRDIrnQUfqXvjxJyC1EH/0uS3nQesPv05zJwUymH\nwwcmJ7Ojg4h2008giEdGmt9gdGrhBmm3faXqhwNZpjahgFuQgvYNdMRuL+/+\nc6KiEDWKNa1XQi+cWDtqvLyvG/E+pqrW2/3vZLA6k7FFjDhlVaX/dQVCbcp6\nW1P4Qg97gZUPfFnYnlOc/fd1I0zYxbtEmFXhBEd99aqwSa4xWOt/+93g/h0T\noJk2\r\n=Dkc0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bc2ad63a6686ca001a591d3119cb07c8b7e88cd7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.4_1631628599745_0.9286881684722808","host":"s3://npm-registry-packages"}},"3.1.0-feature-335261-ktk867yx":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-335261-ktk867yx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-335261-ktk867yx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b0bdeb4474dd03760f3bab7316db82b2d563c71e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-335261-ktk867yx.tgz","fileCount":153,"integrity":"sha512-mISc+O8t77vCvGayyuFkpPSpg7EzRlEolx1FFwvzdNpXIjwP9rhwpijtcTYVukEzN23/FDoWXLWdJ90bkszQmw==","signatures":[{"sig":"MEUCIGeh6wNfsWssL/gmVxY/zlWeJjc7+t7H04U5W5OKmcqrAiEAjxPNx+Cfhwxz2bm4sYhCGerM28Gds+Y8BHXNXlcp9vA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQL6PCRA9TVsSAnZWagAAMQYP/ArKwHoYqYJWkL+LEfrH\niANNVgaXCIQ1UoJ/p+Sey2PwlOFqWO/ErOD3u1F9kVMDlRpjI3FxXniIs25T\nKqSmTSZ5TwlyVCYen+oFjCdGTxy58M3x/6jgEOqS5QRcM/pcFk8H5Y4u1jyI\n2r9qzQx4TBoKrAip5IV0DlbgHLc+m3j7xXJtvGCpDgRNGDYDxoNibTUyaoVy\n6pHhU3srpo1EkfJqCgqVyDQ0fjxKPok314gJbUYK6joLXJ0n7LaXCzADCoO9\nj6uzJa8AegoaFcVi4kmkE2sDDuoAqR+H/Tcx3eEVoRb5LNKeJdb56wg9MTj3\nhFI6BuwmEgVfDE6EJkP2vp9CB1HFLDCWFLLDfKyzWz4XPH5LTiTr8DuqRxHj\nB8d8vlxeKP4rNc7gyFPQvmG0nxBdXOXRNtOKKWOzvjguT0wBOvv4ZPjFhnlw\nRGr7T+r+wQk31aSVkcpa/KypriaFqbqA7YpvZDo8iNMueHMmRoMl3BI+4iZp\nAfouNIgu4JZsyzuTeuwEB3rM4wa6Djfai1ntvMDVfVia1bm8plWrnM7v9uCH\nZzbqf5VY9YrWSSwsefsyIiKcA/q0nAyTbonzytLTdhfOn2w0UB/Uj/n3FPwr\n83YlB22P3zh5M5fSKyx/SwLePYPoF2cdN9+na1D6ROzgsSp3Hf20fPAI7NQF\nDM5K\r\n=mf9G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"335261480ec6d7cf94a0db92c3a21c6010e00ab8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-335261-ktk867yx_1631633038955_0.30773239557238896","host":"s3://npm-registry-packages"}},"3.1.0-feature-a304c1-ktk88kap":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-a304c1-ktk88kap","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-a304c1-ktk88kap","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6033d2e81683377c6f32e1f8aa9cbca3caa4c89a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-a304c1-ktk88kap.tgz","fileCount":158,"integrity":"sha512-5AQeM1p8+/1Rnqw+hCXKbu+sAQG9jOFCCltxYgtW4420UFIVDjOYivydS5yvZbOzJa4BNGfjKv+CxvM6dWy+2w==","signatures":[{"sig":"MEQCIFPHcK9wrGxph+xV/8yGBI/KKVYBGUMfYjFtl1OM2+lIAiBlcYVYfB5UOgGC6Gm451Uj5e/Z0OxkV7Kb/oO8WDFPvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQL8DCRA9TVsSAnZWagAAF3kP/0GkKv5ta/xgnKV2AsQj\nhQMsGeQMRxm2kD+EP+mNERPzRenSd9Nx+EB435g3LYvmkYNvKQ3To1l+7RvB\nq6bEfJi9+D0/qHxpkzCG3sjMIAFpLcJotc40KFKJF5YkRr9kQ1uFjCrlCQPO\nbcV/Rwqn/HTv6NJy7cnV/ItlH5OwLTH7DHDbV1YznhE+oI+U5/7OgqOgsFT+\nYnpoGRtmV3vlPSpPb10oAj5nFuyUlrUm0l+Cqo3huZCmeMaWZDoJSPgnEMud\nDmOIOAUY4L8MNTlaH+amPNx46EX1AFrqNjc8nuWTj9HzrJ5yGTvbvJkc8Uf6\nFE012wN2IEsqAsrdF+3KECS/KpV06ryAxnde/9MAdt8kVy2Q2N0L4ytZPZGp\n/uYjRNFhmRAm9Tz6fQZzHTLNsqUosXUA/lCdMLcoqUymr83JXeW5DPwFVnUu\nGB0TNdSv/NmJTYCizHWZHwpfro9i/L8eI4+qDB2AHP1/OlxnHX7dNVKSITxB\n/6Zp+Uh2NrX4xHxSilOwIyknFNmWRmMdKlHZFcMs1KCQlZqgQXrQv/XxQU13\naA2iuDsSqAQABvLfrKqJyX90Bzki6CsNA0RsMHs0dqisIAceqvH7y4w03uTC\nhoIYlvZ3DoCAEpC14fntuDIjzsNqkTuVd4kutMhkdsUX/4viM5Aj+UR7hUL3\nnVq0\r\n=vmL1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a304c1006e1da52735af835d84cfc0658b416eb9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-a304c1-ktk88kap_1631633155101_0.25566814958511785","host":"s3://npm-registry-packages"}},"3.1.0-feature-cc0a2f-ktk8aiew":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-cc0a2f-ktk8aiew","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-cc0a2f-ktk8aiew","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"21514584998363d69d66729052fcb101bd0f88f3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-cc0a2f-ktk8aiew.tgz","fileCount":153,"integrity":"sha512-k0NKRnmCIlbALqiMMddcmJw/LltS5G7/LN/CfDlB4crCryOal0iPshkzNAUlKqenXdc8DyNdw+Ga4N8sXOTIXg==","signatures":[{"sig":"MEUCIBLBVTUl2YZnAT7+gVNWgkCOatafvIzdIAi3nHK33PFNAiEAo/rPoajogD6h+xqMj3mK5AUCP1qClOJRlIg/wBFvxfA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQL9eCRA9TVsSAnZWagAAl6AQAIq8+F7Sa8rRbjeDuwzD\nde+KSTpKuNtR2OzVCaZi3PvwcVGKosp4APuufJxozx/QaRxw1UitFUPLWOEb\niCWfDdR1iR9sx/35/Pbdn2OsdbwTmUK2AxXkLE+g0GPxejvKPpciiclNtU7f\ns2oyyOLvyy8pdyFGKmmpHCc5vcLAi77Rh08tUvkXUBdC8Mbpr9YNIfrMvBtK\nDu83/IWv9ed6SAQEN7vosZ98bfds229fXFMbnALvMqTpsnSbQct3XkrUftj1\n4BcBARGCsvTVfGrXQPN5KPsv/bPVVVnXA8jeZSE3MaSLLDIBJYV0xYxgK+UQ\nkMUOL0CJGX/vcXU/+trWRLj5RcM5VYMnXWGZNO7zXjvzDvm280J0EkXhbOQr\nI862BPc5kkMfyJOjHSdIA3XXaRfrq+fmA6xGX8WYSlsOErCDtqvQWos3FQrS\noGdHB1QIsnb02V7EVL5MIt+Yop8LcZz/C+w07p4Ib780DCF1CROOALlbvOoE\nnk+Vs/+c+dl2rLYDVPgmuq5Wl1v4/KccJp2Lrq7qZMYGTpPDxYVUhEgCkdl0\n5mgs9cZAu7pMRnlL5Vi6rsXxdG2eYQrqfZXe1vgiK3JBa2DjA0sStbize+qR\nfedgK2hHaQa8MrADyEgv68PLBDusu9Fxw4mPTkbP2RLZWIXvxtaDI6z5Rjnd\nGj2O\r\n=ozmA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cc0a2f61c5dc984940d57027df6648ae2ffdf64e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~external_task_single-try"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-cc0a2f-ktk8aiew_1631633246237_0.9551719489393526","host":"s3://npm-registry-packages"}},"3.1.0-feature-0dd132-ktlcw0lo":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-0dd132-ktlcw0lo","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-0dd132-ktlcw0lo","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5213726a913f5631c470683a6845064d0ef740d6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-0dd132-ktlcw0lo.tgz","fileCount":153,"integrity":"sha512-Uf6Fe0By4lWHCMqiTRVoMuGjdzRuoMmdpXnNoLTM64zz4vvM1BnxYaJZoiePp5QBUb2effq8pC45O461TrVHog==","signatures":[{"sig":"MEUCIQCfx2otwz5jvlYqYMK4hvGrjg9iKjBdRrMDnShT8hGrggIgQMPVcl1Y/9liboaDIjx0xp70AV9LGY8ZvgdwPOzRVrs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQcm0CRA9TVsSAnZWagAA+vMP/14LlYd1R0C3jf9cml6K\nh+eL72YC8dKJtwjY60vaPcO+tfYhT/83qJ09B+L21K6S31yVsODtEvE2Q4Iq\nnbftz2/f+SJt4EqDKXgBJ/mrusalBpBuzl/NPNGZAQbmTa5dVWpBNSvtspCU\nzLymUpO0j9RV8yuyoT682yWaiDREyTRpUxuQPGWFlXHhmAJuszrjH8Xkhd+2\nBMX1ca0y5FpP8Tah+ckO2PlO+B9CadZZ2riOvRq5o6Nz52UYGmiSL5bD8FRl\nLpLDaBMxVRmpFL+QbLhosZw64hAo6MGbesOMrG20//wCF9E5t4UwF5deUsoD\nLNaxv02lDzumfQkWGPSZCB9KAIH543Z8fqEWQC5mJh48qvJXsL78ecDndMGb\nVUSdq+ngfmDKULhUVTYOqbpCD4jeIx+/LUtp2uNJLHfYWiKHy/Ig3Vh/Dk1x\nY3MyNvLIWMpUNfY7hR8GFXrMxU+O48K4f8F+sOpQpZ4tUefi0fPzeFaF/V4M\n5MSi736nx5XJCiZty2I76XLDMVf9BQYYd4TlaqzdKpxVTB52qo0oS41Y9UDg\nJ44P2OewfHP0HEZynn3J9oQwCGBcjbOJOx9DZjcBYdXazmZlMFO2N6mlr+By\n6QY04SL3WQ/9mW1+nSSg75qL5iPsIaSv3cZ/HaGzfe+gV25JTf4YS1eJ5A7W\nB3su\r\n=m8X9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0dd1328c38a51c8784ba252208a89be84f298554","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-0dd132-ktlcw0lo_1631701428555_0.6823172273441336","host":"s3://npm-registry-packages"}},"3.1.0-feature-1247be-ktlcxu3q":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-1247be-ktlcxu3q","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-1247be-ktlcxu3q","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7cec3c0d09e1f75c2cb1dc1140aa17767c263e57","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-1247be-ktlcxu3q.tgz","fileCount":153,"integrity":"sha512-RPpKUN/4DRcq8xOsm5vK1nUAqljQj6D+qwdJD9LIJrkKtMOdyTrhBTKA1Ho+d6NXgpgD/MNL8niu0d9zlBaFrQ==","signatures":[{"sig":"MEYCIQCHEAXSFrx0pXWsS+QUA1l6zSKKOnvQnH8H4uD6BzIAnQIhAN4ZQxU1MdF/bN3qXNuvedv8yJZyudUcatmNPyTRBg2x","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQcoLCRA9TVsSAnZWagAAgAIP/A4wtsoPZuhktmlaxZzx\n77x6jHrhc/GWRIBgyTem/ZTzjraBP9lP2Rdfc+F9I7Sx/EQmuk2cIFL26Ax1\nRlwJpMD7m/5ZouThYCMDhEVVBeammeIVwbQsMLOgGorW7W9opkWgFGL6BiaR\nLM6BRm3F7zSgfh945alADyuAiMC2jpSWiwKglB2GKsF4RwSeUMSkMGxPc9CF\nCq2SXriKzoRE1s6jwFKqYGW1k0GhbRs9rx6hAA5GMWEssqRlUi24UJVn2wAc\n2nT5FW+E7c5HBuHNrD1NqwS48e4CYs5cgI9g9NhuyX+GHBP9QKP4iBLExyUH\nfRsFb/ANOGbVLsxeeH+VvND5KZD50yLVIv/PEESELJai6FMjhlOZSs6ZvC9k\n6tVkqeKAE2ro2JZzGZIsgXX8RxukslQbmdp2meMG4ebwe5oZK4KZ3iarfism\n7BJVq94u4VQim085nm2EyTBe3ZpD8pUQpRzzFpIserEXKNi5RNS4jAWEbK0z\nQBVCsQ00gsCbs5/UZsBFg/Q3EapHmuV+eWGdAqXoB8OS26AuhAfIAG+BGTJV\nSB6Ne8SgdvxK8/P530ySVjkXGz6jt+K6M1GJR9T2Cj9zxUY1NMcHb1UD9h2s\nE8ARUvcvkNnADNdLfG7maFW3pzqsdq9KUu/OKHdugH7DJjcWW8XzxJ1ITjlH\nA85q\r\n=iUIJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1247be6314336eca8938756a3a9c941464c6eb02","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-1247be-ktlcxu3q_1631701515009_0.5370265281982864","host":"s3://npm-registry-packages"}},"3.1.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6993e9e4922e3eb2a833b9a871491c3c943a8024","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.5.tgz","fileCount":153,"integrity":"sha512-4o8Mrj2Wz0XUeimU7tZ9uQ24B6beLqE6V00Tc5XomPdffX3h+AIjPsTZ9GtV34gOBXq4/1JSguS+V4L916rQ6A==","signatures":[{"sig":"MEUCIQDH6w2vpZ8Hd1/7JkVK/m1o1n2f649C5Nz6K/OEi1wD6AIgX9VBSduxXsia7vGsAqWAi9YHjJ2dVat7YpMpvOrGp3g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQcp4CRA9TVsSAnZWagAA9W4P/3jV4uDeLYFE4+6XBQJ9\nE53OMBFLlao9QWvlEgU/iFRsc1Rqu1C13djNUmQmo8r8xIEbXKuG4LbVFELN\ncEJ2V0sxjjjSTRuPdGxCrPP/i0/3ncF78ISeAx7+o3UG68LhhjgXr8keM/lW\npS8RmO6wXOxtKgeNpmxb/Lf3hD+uA+IImIe00nVSEZ1oxVC8I41+9WrlHDwS\nzYkxc4t+MXUx5JPRgdiKWhBeAXJSZTjWtSH9AoDh28qu3TagJ9nxmMQjHmcn\nd804E0nSSIj9OG3GXGLBsmfHTEaI/ThFBBr0f5LSmWi2BJjFipotNXcul2X4\nAdg3m+zmn76GR5gkaG7Mv1S8cygP0o8LwZAcdQSs7X+xYgYzMRFEVRQj+jgJ\njf3qIbUBcw1jV/9WBMfNaa6ieUlTZNuPTFTLIgTd3BgpqhoLiEL/nKF+pv1+\nUOrdgeZH+TNCXxM4lS0/YJzR0q/FHREOoUP3QBNRzCWUMS+Rg5cJHMn29InQ\npy1MIYPuEmzpo9l0Z3DsfHz7VUrK+XD68jUV9DrjHNxyzQ/mb97BIVM3yeZf\nY+2OiZvYSPjqVd9s/bXGIfcok1FpkshqINdCktLxt/yHgeOQzCOmA1B8lkSH\nEIwMSEOz1w3jOlwK2zjjjDEFzNwlPnrueIkcgPQFhYFBpqitWVx08kOnn6Jr\n6Tym\r\n=T78A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"26eca9645ae5ad605c69c571051ba8a5cdc3dab6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.5_1631701624689_0.8555559523263332","host":"s3://npm-registry-packages"}},"3.1.0-feature-cdcfd7-ktld9w75":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-cdcfd7-ktld9w75","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-cdcfd7-ktld9w75","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5327bb6332e1af9d452ca266003dea70756c4000","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-cdcfd7-ktld9w75.tgz","fileCount":158,"integrity":"sha512-tdJNztSRNfaDGQIwy47vUc0YQ3h3tTYkrBbuMps53mpfZ4HwZOE+/gabqmbcf4YoSlJzdVyK3a3WoOUKRMqeKw==","signatures":[{"sig":"MEUCIBMzbQF8O+5lTGehBRbpYn114dcnJi1utBXA+kAYnjYYAiEApDzl1YHb/DNpTi8ByaYYS+emptNxglxYCWY0F2Ntt+M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQcw7CRA9TVsSAnZWagAAcOUP/A1uFgY/sGTJrQYG0XlW\n5mxNUAQJMf1Yw+IM92itHYi42er+acE2PhRSQFB7WqdP5TdMlf4fkC8afGAI\nLIaIqFvG40gvSZ6iy28aUjnCXAlz/wh6QSAuNLO3rksaEs3tq3wLaabQlU6Y\np8Gp4tR0DOdN1rwiw+c+rlEPSMeXA5VXB/aDxg5eOu3yLTSO3rEauHdI/iMH\nI7kascbXuYMpbp8UoLiDn15XiDo/7Wgl1Gd/adzWfseHNn8ibdBM5XTndg6B\nc+ZXVvRZzbap28Kb4P/UBBlCcqhseVZmEU4RpBuIF/XrPgB1eOhZNe7B3cjY\npKwPwQkuQZQhqoXZaXLrkKVmD2SnQ6g7F4rL0MwEBec3S7agytlqS4A6dY4o\n5X6PdEtX30tlCfQZL5AWXVYILhtJ5sby8efY2qtN25Eg9QwGAbIUfCXzYPrZ\nbT44NplHpOVN8P+WB9pIfUAUgEu8tOcBaOopSev3HQ2Hw3qd/x3SAKyxrDYU\nXnhAyUVCeVLDWeZ1tNo9vHJg/klxSigHa85X9bNfe3jzUk04RHHsfYHgDkoy\ntHtVHg0JKzqfEuw3Sdxx18BIg0NJbbxl/F75AxjJwbhe1lNoY3TDoQy5gHnU\nfuLiq6hKZ9BlPbEa0XsxG7CASISzKoEAswaTZYqMcgz2nZTgUlYBoKT4X0Sm\nZUO4\r\n=ZqZm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cdcfd72192e7568f40d86b91ee21af40b14b25a1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-cdcfd7-ktld9w75_1631702075264_0.21350084511595013","host":"s3://npm-registry-packages"}},"3.1.0-feature-d6e585-ktldauzr":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-d6e585-ktldauzr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-d6e585-ktldauzr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2b4f9ead056d741d75eab7b8cd3a3a084cd43ab6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-d6e585-ktldauzr.tgz","fileCount":153,"integrity":"sha512-dTUAuJ0BrOvF04IGCRuXH8EO8accZrVAAZcWk/aSzV0TJXFKI6GYFHE6pbrsLPmvR0OBW+JkkTZom+v4lyzH3g==","signatures":[{"sig":"MEQCIB/UGjnGct0d2KoSCCXgRmZXKt+HrjepW41KVeOPaswqAiBLr/HWwYjrYDH1F/FXCA9Hp7gwRGc/qlxGuUBg/R4pqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQcxoCRA9TVsSAnZWagAAukYP/0TVpIeG/Ob2zzTqyfzl\nbWAvx8UnhwRuWzfKtRq8fxhBxU+vI8vdav8KlwwlWZ3uc9tVdtQm7Bk+lNTB\nf/b77L4rCf8mNPfHnz54GqSScJ1muKg8UXkdA56f24uIWSxlxLI3yzpxI0QL\n7qx/xo0tBivgNe/+/E+0+Glno3bw1Sfm0wvFhIPqgbjXanpSCAt7hrQZxAlK\njyVbiWSl5qAOePR5WxXm2wTBEdUdaKnG5gbirlpKma7u2lNYuzX8Mz25zV9l\n4a8cei3wv8KcMVGDzapkofc/MS9lXgwAVn0rWpnaCsTYIGn6xpu8sqvWuuHT\nGILMcMrmnYiuvvNNtU5xDSjI559ZYCLgeQau/+6ZnD1znvZgX7bBM6u33WPT\ne7GV/GHeeqc/mp4kSqew1w1uIFiFPL9OuMIk+yQgGDiuxfJvRKQCnIscGQKY\nPgK+EAq/x8L5/7sMcUd0nEnRPTUii55U/BMiowE7IThpTc2w5w+HCVyMnyRK\nFs0mYgv6BnJg+reFvVuLMHCzTfZm70/S/oNOVhe9qwBI/n9L99fam+vJEgQ8\nsRQ//H80wBbMNE7mM0t7nUUu+O/7xhmVkGhxDOWbdPYArygCXtVIs5d2q6b6\n8VtD9wWeiO/y/B1h3jRh9SG48gf19WlemEeuM/FJgnjn7RX+ucD2DcJ6nSHe\nsDMC\r\n=jmO5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d6e585c524d3a7d81257d341503a1f2a46ba6b0f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-d6e585-ktldauzr_1631702120751_0.6071887468316055","host":"s3://npm-registry-packages"}},"3.1.0-feature-735faa-kttz4fef":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-735faa-kttz4fef","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-735faa-kttz4fef","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"414a8a2ed1eae9ef68b0a664f45f56de0e37def5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-735faa-kttz4fef.tgz","fileCount":153,"integrity":"sha512-9tQ7MDxhbLNPakREDxOm2U4cvpMAGEVpAiVkhf7qYz9T9cc1JdOxcA71tKtFSuGJ0bHHCOUT7RHCcSVzfceyyw==","signatures":[{"sig":"MEUCIQDryfDgX+kieeI00HQfXhREbnUgpFr+hG83Pm81v8Zu9wIgSv51fvGWrso5locNvowx0dH46+3JkTmeD5MS+M2ofak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448278},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"735faa452d4efa22dce5e1145e6af08a402cea01","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-735faa-kttz4fef_1632222506497_0.6637955111134433","host":"s3://npm-registry-packages"}},"3.1.0-feature-4eba40-ktu026nc":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-4eba40-ktu026nc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-4eba40-ktu026nc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"470a01817b83ac5918d96062611cca2ee2afee9c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-4eba40-ktu026nc.tgz","fileCount":153,"integrity":"sha512-/acKHHFAsopkoPM6GHVCXBakA1h+fPWQ1wmBaG3MxBBfxoqcW4xL338TTi3HToCzLOrb9LYM+o2q3ucgZTlCYQ==","signatures":[{"sig":"MEYCIQCwyfeXFj2kI2euUVXXAJroJ72Cw5868LMT7csfEZj8kAIhAPC65RiweN+Zx7Nr6T5/QFEo7unhuEVLU5aMe3/WD0A6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":455237},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4eba40b0cf028ddd6aeb358358fff41b94f6cfb3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-4eba40-ktu026nc_1632224079950_0.3558654115436153","host":"s3://npm-registry-packages"}},"3.1.0-feature-491f7a-ktu44qc6":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-491f7a-ktu44qc6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-491f7a-ktu44qc6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8e753e7b56fc8bf0068a325c8fe66c4d2674390b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-491f7a-ktu44qc6.tgz","fileCount":153,"integrity":"sha512-pzwomrHHi/SX/r5VENVyRgwge6d7kKmnG/7K3vqe8A7insQOoTh9owtBGVwwFkCiQxYALqg1fn6hjr2i7ZlkHA==","signatures":[{"sig":"MEQCIBZsDRS1dCLZPhyz4D6ULPQ7vMN2u0kRVYufSZ9IsZRBAiAHKw3XMmLFkF8NTq/Yp6py8yQyGooz9EHQTvuu72OByg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":455237},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"491f7a4222dcc6b47b35dc1216ced5b7cd31ed43","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-491f7a-ktu44qc6_1632230918972_0.6597129938680577","host":"s3://npm-registry-packages"}},"3.1.0-feature-9ef297-ktu8d7rk":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-9ef297-ktu8d7rk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-9ef297-ktu8d7rk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"16da9ad76de7401eecd8b7a2786fdcb5af3946b8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-9ef297-ktu8d7rk.tgz","fileCount":153,"integrity":"sha512-HoLwPUl57/zgcy7jmVErrXPnz+oySUlxu93S4ifsikOe+sWo/6NK/6mjuk6WnBGMyE5iYnBztKVwPjT4JKFmMg==","signatures":[{"sig":"MEYCIQC3WceB97oq3tnV9KI256SwnT96uVn9uGk8G353bT3xkQIhALKKRR+JT9vLMznvUDRBNf9SQjtOu116Afqt3vr8Nzte","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":455753},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9ef29794c437c2c787781f37032533f5f56b88b1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-9ef297-ktu8d7rk_1632238030416_0.18211672318838668","host":"s3://npm-registry-packages"}},"3.1.0-feature-e0b348-ktv8dxeq":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-e0b348-ktv8dxeq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-e0b348-ktv8dxeq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"33aa67fdaa8a59483ccbbb3f8b3b3be3fc076b34","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-e0b348-ktv8dxeq.tgz","fileCount":153,"integrity":"sha512-JO3rzSR13qBRd6EMXjtKJSAbiyA3uTmklFHVGJtvQBkxP2+5jmZaaOR61PGv68Vvf8AKHpeAPpzDjWder2vFPw==","signatures":[{"sig":"MEUCIQCMLv5Auo57gnQgydIwjc3NbnXTnq4ncUiY6v6PYQ6myQIgaL0iogi9kqNYNy8PhqZPw/AEP63XAczSiJgG0IuUaBo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":455753},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e0b34851414a042e842f090f72e26c969afc6d05","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-e0b348-ktv8dxeq_1632298528351_0.4171680502460142","host":"s3://npm-registry-packages"}},"3.1.0-feature-0d8333-ktvf3ayd":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-0d8333-ktvf3ayd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-0d8333-ktvf3ayd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c7d99a7369a397c1a6f75145cd6f4456c10582bc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-0d8333-ktvf3ayd.tgz","fileCount":153,"integrity":"sha512-ruHVum9F/Zg9TjcVdzZQSRknyN5e1Gc13OvCY3VMOUJHrNFoicjuvZLL0Jl6QfDAvXNUjJq8VILYgWOjm0QjOw==","signatures":[{"sig":"MEUCIQCZetUw3Scv/Ta2r3Frl/9CE5nsClcdYWfXLuwarRwOWwIgOiuNPL8woX1C2+aIRRTyIdFlUFmBUsbK3k/4fJnk8H0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458285},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0d8333df9f9eac55e5cdd9a4149c977b464d2db1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-0d8333-ktvf3ayd_1632309794205_0.6966551954069351","host":"s3://npm-registry-packages"}},"3.1.0-feature-45b58a-ktvf7jky":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-45b58a-ktvf7jky","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-45b58a-ktvf7jky","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ed2dd10d40a841a9c0879e59e3b5045432e01454","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-45b58a-ktvf7jky.tgz","fileCount":153,"integrity":"sha512-LPrwhqSi9yI2GIJaW2aLO+sG0oudWTLQIf7kF/EuNPMKi6Jezcz8/t9oX6z12v1HaujbDzctalFbzNUI5AII5g==","signatures":[{"sig":"MEYCIQCCnbZJCsQ3I6FhR0GCRQ3zN8VvbQuZozTWihkNiZQtrgIhAOAzvBOpDAAqOHzxQKqKeJpyTjaGHdAjLgw+fg5CViIv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458195},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"45b58a703c73893d63df127dc274561280e95bd2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-45b58a-ktvf7jky_1632309991468_0.6459470088395398","host":"s3://npm-registry-packages"}},"3.1.0-feature-3f7c29-ktvg7zd1":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-3f7c29-ktvg7zd1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-3f7c29-ktvg7zd1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4c3b42949186a7bc50c9ae6c9947f7cca0a86899","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-3f7c29-ktvg7zd1.tgz","fileCount":153,"integrity":"sha512-PxdGHCalFloD/jK34LIb/9+7sC3R4qLXP7702XgMNNOVcoQ9t4TtVdUIK01SdXI4I3gYUazxenQ4EGfUGfmTPg==","signatures":[{"sig":"MEUCIQDChC9c9f8ecqR+MZZXSNWI/HlEDP4qNTF7GcjYuvuCCAIgJeoh96LZVayzYXS/8Gv8cHFpkZc5mGIo7qMhSGexo54=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461749},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3f7c29ecaab0351528c4a6f684e471588e4e6fec","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-3f7c29-ktvg7zd1_1632311688014_0.794379569760123","host":"s3://npm-registry-packages"}},"3.1.0-feature-70a59a-ktvhab3h":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-70a59a-ktvhab3h","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-70a59a-ktvhab3h","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d7bad52a83a1b7b34f0959f0ca8c3ed1538e6f71","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-70a59a-ktvhab3h.tgz","fileCount":153,"integrity":"sha512-bR34Qq8KtDGnW5Gr7eVvbhIsUZyP0lWU2+Wl1/jMHbjId6SQx38pm/1CBGtCuZQTuYYrfTW2f8va3SRSKvuL4g==","signatures":[{"sig":"MEUCIQCb2HKPjRtAzYJqP1LCgnOKgUcD3KvzJUXoSHTrv2rRDwIgW6XaNZMREp2FPsi8KesUKxiChys5cG2bmGGAaO3hpGU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461749},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"70a59a47603b373ad3967d1d0183486b5cd284df","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-70a59a-ktvhab3h_1632313480316_0.935298770602242","host":"s3://npm-registry-packages"}},"3.1.0-feature-3eb785-ktvhq5gq":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-3eb785-ktvhq5gq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-3eb785-ktvhq5gq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64d1df713c9a1f3d98ccb83335d4e4bbbd540614","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-3eb785-ktvhq5gq.tgz","fileCount":153,"integrity":"sha512-lAab1mUvN/ZoNYW6d4y+b17Y6sFrZl+a0Rg9SPJgH2QBJsy8Nw+P1i+vP1GsbI/I0pcpwyN6apsqOQS3sMQ7BA==","signatures":[{"sig":"MEYCIQC9+1+GZyCIaiVrEvnSg4wfx4ar6pRq1U142wx82MYDHwIhALn44Id/+sIe3nOrZTJ+Rx3+uWexaWQOK9SXpW/tB6NW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461749},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3eb785f3d588da56b4c9cfa21936445859ba97ff","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-3eb785-ktvhq5gq_1632314218911_0.4816559464214738","host":"s3://npm-registry-packages"}},"3.1.0-feature-9e8787-ktvijda5":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-9e8787-ktvijda5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-9e8787-ktvijda5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9cf800903f63a64310ce1761ac7ca67013d97a44","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-9e8787-ktvijda5.tgz","fileCount":153,"integrity":"sha512-NyDofYvTIu7zPMnoBO5DBbp0bniI3mywa9D5AJ/+MVM+5MV0hoCOX+wunez5wKk0EKaai3Ndgg0JecT6C7z7ww==","signatures":[{"sig":"MEUCIQC8ksKfxNYPOJnana5Zsy5nLAUGuhv7S5wckSVXar7MHAIgcThC6+Gt2p/QcH2dcJWiAxIiamc+xJRCDgAKU92XRtQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461749},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9e87875e4a73b34d3633cb6dcf527eb438d728fe","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-9e8787-ktvijda5_1632315581857_0.38585296335450603","host":"s3://npm-registry-packages"}},"3.1.0-feature-dd2668-ktvju824":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-dd2668-ktvju824","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-dd2668-ktvju824","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"939fc46ab86b5950a75d77e60960148dc76b3cb0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-dd2668-ktvju824.tgz","fileCount":153,"integrity":"sha512-3bqRwZkG9KxBhZ+SbdILTBadpJwKNh1YbHrqI2re87gCnrwDyDIx/HvVTVHjC8PPijacifUhG9V03NjlbSo6Cw==","signatures":[{"sig":"MEUCIQCAAzGvAvVvTEXVAcbQEPv9MOnemsNA2MtWdNc1+qG0QgIgVbz7JGKRGK/KgCMSVymz6uwtprE01w8sc2TGNyXNGOg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461751},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dd2668e3b1fadb270f25698100985e9e6aad1510","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_external_task_infos_to_service_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.2","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-dd2668-ktvju824_1632317768321_0.9694340384687834","host":"s3://npm-registry-packages"}},"3.1.0-feature-a1e45d-ktws0nkm":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-a1e45d-ktws0nkm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-a1e45d-ktws0nkm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9e18cafd8027947fd629413400b85526fd3d24a7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-a1e45d-ktws0nkm.tgz","fileCount":153,"integrity":"sha512-4A364+PbN3NLmJcmxLBdAceGUeZ4A4fmAplc81A2iCLdMBKsiiQrFonKgx9YGk77OkHKHJM0f5+rF4xf6aHzbA==","signatures":[{"sig":"MEUCIEtCKQ7sK7QEHGRcZsByO/lsHDI3Y9ZG9BbwC2eViVXFAiEAr6jBqTelm+NkVNbwz9QGOmutznVE8kFjLSghMVQI58k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461713},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a1e45d4282095d4237af203b74f2c0aeeb408c12","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-a1e45d-ktws0nkm_1632391973412_0.15745842823729794","host":"s3://npm-registry-packages"}},"3.1.0-feature-9dc146-ktws5lmi":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-9dc146-ktws5lmi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-9dc146-ktws5lmi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2b071d97aadcee0eb073b2b892c2ff9dced076c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-9dc146-ktws5lmi.tgz","fileCount":153,"integrity":"sha512-qUmwK5M1zjoCH7pCuph7kP9AAbSC9A6RYczKL8ZbouONYZlp0gCkMeDW6UfEj9nmHOcAry92MpklbDLAg30/NA==","signatures":[{"sig":"MEUCIDEB9A1my5McGvpt1NwhCPzBwn7ypi5SpnUZtikZMp1NAiEAmI3x5xvZ4QsQavOsGJlowtWQ9n1hQn0A8ZCnJfR/fx8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461712},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9dc14682b9b5b42f969c33e719ee1c93d7abfa7c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-9dc146-ktws5lmi_1632392201993_0.4616370125145872","host":"s3://npm-registry-packages"}},"3.1.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a5aa7109847c243d739d7ad86e8785e33e387a00","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.6.tgz","fileCount":153,"integrity":"sha512-qPRC3zSrB+w/UWSyIOJWohGww091rv4lfkgXLy55acGV1HazGXJ7DWFV4SMKhK1zndlY8nShGHklu22UoQ1tJA==","signatures":[{"sig":"MEQCIAWYAvumKatFj+IaEzIcxJD1zb2L/Erbn0LiD1IojoYGAiBbdHZw0zjUDMkcv6qCju91Rjr7w1h+GUfkklWz7GFbBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461696},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"83528c13567d52f4d6cff2dd5ce17374d6a1f8f1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.6_1632392377255_0.37277727064771415","host":"s3://npm-registry-packages"}},"3.1.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"45e76988529550372a6eb93f7ed61fae2fd88c02","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-beta.1.tgz","fileCount":153,"integrity":"sha512-lyQVuOUN+yzyZk4XWh9BHotWwb8BSGmpfsSuIjoMBGCQdmGaWfpqmG3oI0dvZbNxeBi4ebk7aCEMaNC6veUedg==","signatures":[{"sig":"MEUCIDFxxDtDzJXHAIEZRnrBD9o2nzOjQpuMUoUM+LJu8btyAiEA/at4Fcr0YL5slNRTjpYb4c5pCuR1kv27KUwWBmb0lVc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461695},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"559f325cb73fcdfd9955abb264709230899d2d2a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-beta.1_1632392837630_0.07770174400221941","host":"s3://npm-registry-packages"}},"3.1.0-feature-42777f-ku73q8rw":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-42777f-ku73q8rw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-42777f-ku73q8rw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"21a73b0eb6562bee0cf73ddb52158d555e2bbe66","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-42777f-ku73q8rw.tgz","fileCount":158,"integrity":"sha512-Jq8ZgnEBavvZAgYgI8IYJf3knZYlNeJ6CRDcR5uQ82wTWXynHICcZ4B5fxMqNSP0xb3GFxhnXaECN+OSECEx8w==","signatures":[{"sig":"MEQCIFclsLdZWSps3PLsyG5Rz1iyDEB/1nhdPAc7IaReyxJKAiBUAI5fqpFU5gf3ktM2CvZtikrLI61V4R3UEWwWPmrnAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478955},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"42777fabfe8d1cea405d44a8b9ad6383619350b9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-42777f-ku73q8rw_1633016298822_0.48527850565886355","host":"s3://npm-registry-packages"}},"3.1.0-feature-c3b656-ku73shbq":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-c3b656-ku73shbq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-c3b656-ku73shbq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a4fcb45b8394a13567a89f85ecd0ce759f395536","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-c3b656-ku73shbq.tgz","fileCount":153,"integrity":"sha512-6SYCSEcrBuhNN/L9pTxAkk49KVIggois+DIa5YKTHUY4wFL5NNGhXI2ooMzMzRgS0Vxi63L0XrLkYoyUXALGzQ==","signatures":[{"sig":"MEQCIBa2vwAKzjm57gjDhMBsuNmOiooq0Nkaq6yUY08REuMLAiBwSK6R1e3iflrO/qgbyErxakKZbkBMjCK+a4Ns38HcKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461764},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c3b6566dfae5f590599ee7c7514356513341edb9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-c3b656-ku73shbq_1633016403679_0.19206934853003022","host":"s3://npm-registry-packages"}},"3.1.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"253f7fcfb7c4759d56556c51da301cc74fe72ece","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-alpha.7.tgz","fileCount":153,"integrity":"sha512-pbr5AKLXk9P3jCMbR3hHzCUbBwcYTDaffbePTRrvL0+QnvlN4JtRG2VzRPHaP9LiS0vogGRG7iUwBv0SrVrGWA==","signatures":[{"sig":"MEUCIQDCnsPcUfdDIe/0k8LGT9Q7IHXm7E4N4S7xVR1dQLDPsQIgGiAvDDgutwmlrsxHX7psusEYGaI9iAeqwQIF7bTW2gk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461696},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"71c24d1a2947249a8979d476873be546e3c27972","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-alpha.7_1634893859726_0.06908040125590964","host":"s3://npm-registry-packages"}},"3.1.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bc061a6cb7a7fb73bc409e513f43172ed40bc6d7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-beta.2.tgz","fileCount":153,"integrity":"sha512-Qg0mNXbwEo0AmZzrxRyTlf/0DUfcFOMdjXqspzgt5ActDNrv8eqWHJUbZ8WQiCHBnSOq98DB4MmNLSMohNltOQ==","signatures":[{"sig":"MEUCIQDlz5GhHZBbWcIrpNMmKmQZXK1jvO3kOdrxDCn2CwfOxgIgLgmXYdXzQimQN5kUWnB4SnmOc/K69Ri7b72BvJ1wytk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461695},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fd91824b2b0c0a2a4cf66a4cbe1bf3c7cf81238c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-beta.2_1634893875071_0.7906151717543117","host":"s3://npm-registry-packages"}},"3.1.0-feature-52d2b1-kv80l4kb":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-52d2b1-kv80l4kb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-52d2b1-kv80l4kb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f28697a500673695b80c2df954b32539e9797604","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-52d2b1-kv80l4kb.tgz","fileCount":158,"integrity":"sha512-zQaGn7eOw/aOBUwHGwiFwIRQD6hpp2ECeYxONue5v8qu+LIg5moVn2TIshIWkGZcT3062lnYKy6yEHku0NfFRw==","signatures":[{"sig":"MEUCIQClxBMUG8SkvuQauB25K96ThxQce3h8DXxCPEh/kHFnPgIgXLGRccxiVOrvsElHPuGx0qvcGuimMN7I9EMUkLT+JgI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478955},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"52d2b13a85554eb2fe6c351d3feec6041bd581fe","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-52d2b1-kv80l4kb_1635248269974_0.3229721033205559","host":"s3://npm-registry-packages"}},"3.1.0-feature-69e029-kv80mumc":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0-feature-69e029-kv80mumc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0-feature-69e029-kv80mumc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf8adf80e4d826dbe0544dced60cac646558c795","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0-feature-69e029-kv80mumc.tgz","fileCount":153,"integrity":"sha512-oLBfZi6HzvZnckzQ5GvVznu2fnoYClWFx57pX16dmrhArnD0yGL+Uu3xjrHW0jarvmdJxLuVi6QVbHOsilrjyg==","signatures":[{"sig":"MEUCIH3CiUa5S3kB0B9oKX90sKLQC3/j5O99+J9oXjFaufz1AiEApx/TyDiRfOPVsuhOVdCCZxQcqa33TbN9Mwqxg8oGatY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461764},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"69e02978edb3b4b065a648bf656f899655966849","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0-feature-69e029-kv80mumc_1635248354317_0.4731014386504797","host":"s3://npm-registry-packages"}},"3.0.7-feature-9cb8fc-kvba0li2":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.7-feature-9cb8fc-kvba0li2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.7-feature-9cb8fc-kvba0li2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cce9425f4b822abbcd2b1a4ce1013b0fe97423bd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.7-feature-9cb8fc-kvba0li2.tgz","fileCount":153,"integrity":"sha512-KOOLAGR0MD5y/KlAL09+iSGDRJOdHXgncrqOY6BtAkJ08Ab0/cmbQkcQE9UTi3fDcy9NhhU5mi5+qqPFTqNuJw==","signatures":[{"sig":"MEQCIBPFohzFQFpGLdVGzJ5gDnPbXxP1fkowX6hfGz/PCL/OAiBcxG6VO3Fx99pAGC8+6J4l8RRayZYxftop6AV+/7YfhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448268},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9cb8fc6145f6ae4bea23cc386e00e6b1b8a478d3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.7","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_user_task_assignment"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.7-feature-9cb8fc-kvba0li2_1635445509592_0.49033761900524975","host":"s3://npm-registry-packages"}},"3.0.7-feature-04ee1c-kvck6wsz":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.7-feature-04ee1c-kvck6wsz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.7-feature-04ee1c-kvck6wsz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9f33525faa45ddad60cdf5a214c89b155861fe8c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.7-feature-04ee1c-kvck6wsz.tgz","fileCount":153,"integrity":"sha512-tCf3CyTzWrQpE3MJxSDxMxLV9LNrv6JgYfdkp+LZtJTRCEqTMCvs54QSTAoPLARu5Sg6acY1V6cduX8ZbIOZmw==","signatures":[{"sig":"MEUCIQCINuAENbx4mtsUQz1s5jiyBqFYWwxvTl4T4HSCx53gKQIgd+SBmjckJA6m3kpaxzqcx/+Xl3ILeoA90iWXhMpPkug=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448250},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"04ee1c7371ef73b14cf49694699e9bfb534ab6f0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.7","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"release~v2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.7-feature-04ee1c-kvck6wsz_1635523067469_0.07471906577752652","host":"s3://npm-registry-packages"}},"3.0.7-release-989ebe-kvckbjt4":{"name":"@atlas-engine/atlas_engine_client","version":"3.0.7-release-989ebe-kvckbjt4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.0.7-release-989ebe-kvckbjt4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"49dab87dc6eef031a9c0061dcfbd4f0ebaad2d35","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.0.7-release-989ebe-kvckbjt4.tgz","fileCount":153,"integrity":"sha512-Lx0rkVGsI8A21Xa5o8aystPdrFYlrUWx3jnWfXZkCXCaFRBRWD0+ZOYgZxT7XYqyq4LToilwOsHyI4Uc/KbN5w==","signatures":[{"sig":"MEQCIFqVYyB9DPB1ZcajJR/Zso3/x3Jv/caS/bY978zhW6vGAiBGKeASL0nOdgWWdyVeic9ROi6JRqhErx6DvTTnu540/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":448250},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"989ebe708571ed01760391d4798d1f49a7f79d8d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"12.22.7","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","loggerhythm":"3.0.4","@types/express":"^4.17.12","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"release~v2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.24.0","typescript":"^4.3.5","@process-engine/ci_tools":"^3.3.0","@atlas-engine/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.0.7-release-989ebe-kvckbjt4_1635523282562_0.22036727488018482","host":"s3://npm-registry-packages"}},"3.2.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"59516d76d1344b23e995575d67f78a18fe040b1e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-d32NLdOH9zUV6aavIpexC4s96KVB1WuzeAtmTKfxcvzT5uZyS37qEGsn3xPqGBS/CjAkKI2++ulntwvWs/zdGg==","signatures":[{"sig":"MEQCIGGwWrjNp/qIjPFzuzEBWwuhsmhHZZ+u4SO0EvXRxVOXAiA6bFzci11w8+ROcofbjm6Kag38d+cCxgdqXkgOAx8pKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462040},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8220fe9d8b732dca78de45f50d3c2c0433c239d0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-alpha.1_1635842908239_0.1468624498737361","host":"s3://npm-registry-packages"}},"3.2.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5de155a440ba158aa4330f44722ed8424e2c933c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-beta.1.tgz","fileCount":153,"integrity":"sha512-Kjpo+GPj56EavSYvoMrraQ/ezRtpmBmF6gzEk5W496L8Vy15IXNLsH9C4UBmBwSyng8YhtQ+rJQXw6TYZKYPnw==","signatures":[{"sig":"MEUCIQDScIh0ZOiJHTsAS+ly/NZWkEF2XFb/zZQU2XSP6X8cIAIgDeKNKB0BJYfCpr9ISYn3IOsFpjfejijfTQ05M/d+KVg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462039},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e4f3790226e9c5c27adc20b063d196e535386763","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-beta.1_1635842917217_0.8106987868395248","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2b57ca3207a3ce71ffe32031ee97e97b0f55810","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.0.tgz","fileCount":153,"integrity":"sha512-rUVaYpnxG2Ih89Z/qlJvBB4BmGyPK/WeGrt3JgwACd2IWELDg85vGcgmgAxGVgMPcpQeRD7kA6F3h8rLgA4hcg==","signatures":[{"sig":"MEQCIBLOqCUdDDim8ypQzRE2spEAxwOAOgLUNeBiwjFeajrIAiAFoAgdAoRdm1IyeyV6wbWEiPrgC51RoS36Ox6/IO8fpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462032},"main":"dist/commonjs/index.js","gitHead":"1d230eecf19cb51d992ff296875befd8d0525c1b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.0_1635946854966_0.03428973545631275","host":"s3://npm-registry-packages"}},"3.2.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ec99dc93a69e8ff2eeb733a2b7e24be3d309043a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-beta.2.tgz","fileCount":153,"integrity":"sha512-pXTNADaLwa77uGukrB/s+xQL8THJHN79ZEgp1jipbQfzCLx+fSWHSSbFkTperXVwKuz8j3MzpOPSd5czBCfQRQ==","signatures":[{"sig":"MEYCIQCu0FeKi4HxEWD+TKKe3XOVAjCrhEYxdv2UdojERKgxtQIhAIICbEvsMMdzy9+1N8nBk7oHltUPImmOcjNUBfS7ONlm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462039},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ebe0f97b50e1a6510c1bb5cdc3ff17662fa98737","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-beta.2_1635946971562_0.10068329506192453","host":"s3://npm-registry-packages"}},"3.2.0-feature-59fd16-kvjkow4u":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-59fd16-kvjkow4u","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-59fd16-kvjkow4u","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"af4f978f23e75d1391575c0d3904805b68476c18","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-59fd16-kvjkow4u.tgz","fileCount":158,"integrity":"sha512-V0EWKw8lTKG04Z/At6t92aEBf7x6VWME2BnPkDpCR32wjTFtzOJxB1J86OFYf5IJ1brENbGow26VAK32usazCQ==","signatures":[{"sig":"MEYCIQD4Z+eOrghPzCZPJa/y0tNJAqF25Ikow1p7cnIfTQKfsgIhAOiNktTu90mJ0gZ5qYRxsNcK8bMg1LfEbJ7yqLCS+Ajw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479299},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"59fd162538b0d9ff3ef5d05d9eff052c895b9f5b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-59fd16-kvjkow4u_1635947168500_0.0941663029022266","host":"s3://npm-registry-packages"}},"3.2.0-feature-b5d5bc-kvjkrx7o":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-b5d5bc-kvjkrx7o","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-b5d5bc-kvjkrx7o","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"53148dea4d9939db0414d73b659a41416f3f36d0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-b5d5bc-kvjkrx7o.tgz","fileCount":153,"integrity":"sha512-LY+pwaxloxppbV6JgeE4fC1ULnnElhoIXq7KRY9UKi+wzH1ppOrTHwjPZBf7B9+dtga4b4UC6l5bR1G0KtG84Q==","signatures":[{"sig":"MEUCIQDIg5lDBlrdJMOwOg1YCYW/VFk+4tqW6MxohrPVj4LaBAIgLqbYdwkx+M86q0MLpcDuMSR2bDKSeDbcY+ETpHJsGTQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462108},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b5d5bc6b0ab28a93099e05feb02f17bd3c21e59a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-b5d5bc-kvjkrx7o_1635947309249_0.11419795134796762","host":"s3://npm-registry-packages"}},"3.1.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"745c587a5902eb01fa40b8c565d6a1e1a64896f1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.1.tgz","fileCount":153,"integrity":"sha512-uc0DlndgNBtO0urfXgIeXZIgkmTXK5FZKvczVbclkGzxgcwGaEcEKvcXMJXTm6ZPQnYE9ZxyWbMmxaPtKGccvw==","signatures":[{"sig":"MEQCID2Tla6zVzqtXcwIzra4m7J/j2VcYpuDm+pLIEXu/1X0AiAIrfPjW4N4OOjl+At6ScRjDFfoHthTy/SpbQ5dhAXVBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462025},"main":"dist/commonjs/index.js","gitHead":"8046e9f1f63620ba38b94bb5f1f773ca8a7207c9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.1_1635947598443_0.4546395088761215","host":"s3://npm-registry-packages"}},"3.2.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3fb99577338db12656136de020a352d49b93501c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-beta.3.tgz","fileCount":153,"integrity":"sha512-WbEdaxY/AX86idvIgf06RNXJdCykXEWoz8pon/67OZ6fzOM8Fi9LDowIOns7O77YjU98p2iXLKUuXv9vappO1g==","signatures":[{"sig":"MEQCIE2u/jf4rFRZiI1y1R73X+PborHC/CvbNqCbeChKHzjyAiA4XNxFc++Fe2pII1cqs4duhsiG+g01nvX12X2gNVwrCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462032},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"282fb4aff51eb8a1db13ca4b6a09e40c17f09a2b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-beta.3_1635947765281_0.11492146472806453","host":"s3://npm-registry-packages"}},"3.2.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"03d2e692767364b3708ab9d9ed115b6baa7797f8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-alpha.3.tgz","fileCount":153,"integrity":"sha512-yZQnHWZbMYIVpScAMy6RVD62kNw6TftL3z+eZhrOXhtlzTx23dR2ImthgoL0OVmog6oL8AIE9nJVHb6ng3EnVw==","signatures":[{"sig":"MEQCIG1usUNYEgiAZ5wpetQLS552yBTVPBktorGBc0dBHoY7AiAYTQIy3bxkOEWoK6JrcrDYuE1JQcFrjLzpNQM5iyr6fQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462033},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d628e37499260bb868482a70bcc709b99307c702","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-alpha.3_1635947771477_0.3731206408580916","host":"s3://npm-registry-packages"}},"3.2.0-feature-18a73b-kvjl32en":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-18a73b-kvjl32en","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-18a73b-kvjl32en","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ba4aaac5ae74bdaaca56b103bf715b8909d4f01b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-18a73b-kvjl32en.tgz","fileCount":158,"integrity":"sha512-3Bz1PGrHwyFofhIQcZKidsyj8DpahxJnCfErmcFm7sFtaSU9MjDcQr4Xu7eLmw55IkTt8kGFI2y58IARE02lBw==","signatures":[{"sig":"MEUCIQCEno7u69ZMqqvm4ELJHF7zFobhZWJLxlawTGJezHfvJAIgeBG1ryGpKA7KBoD8IRqRhvAjQY+whRRtpLZ1XXAdEFk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479299},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"18a73b207f637c5a29f45b78ad150e2860da1777","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-18a73b-kvjl32en_1635947831748_0.2653669369497711","host":"s3://npm-registry-packages"}},"3.2.0-feature-a8b59c-kvjl4jby":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-a8b59c-kvjl4jby","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-a8b59c-kvjl4jby","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9ca9cf67acd02c5029d9d0fbd83dcac54f878d54","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-a8b59c-kvjl4jby.tgz","fileCount":153,"integrity":"sha512-6zX7358H2+AwwaBTkl83wg+FN5rVvVzUD+nKeFhyTlDU30ykHJmK4qtZJmp27auyQsVwV86+Hc0ALHilejh90w==","signatures":[{"sig":"MEUCIGtf+hL4A/BBMnbLgcA/Uy/PFzjf17Z7yw5FCPBmTaH+AiEAz6uIEgP96hoUOW77wI9SCiaRDDctDpwOWN/fmbD/+3w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462108},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a8b59c77721939bf242261c66e4fc2edf8c08fda","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-a8b59c-kvjl4jby_1635947897162_0.15349400463132246","host":"s3://npm-registry-packages"}},"3.1.2-feature-5132da-kvrzv3iz":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.2-feature-5132da-kvrzv3iz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.2-feature-5132da-kvrzv3iz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c74b1a48a21353c48316f9bc0b5908c315c22827","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.2-feature-5132da-kvrzv3iz.tgz","fileCount":153,"integrity":"sha512-xA3kd8Rtnlw3rJBxojvuoRwOgHkflodNWwCaQ3gM6MhMXClvTadK2vdhn4hNNWk92xSVsW5XwSKA0LLeL4W4+A==","signatures":[{"sig":"MEQCIDtkpIOfBhsV516wZDL2+8sR3rOgwl7Y7c/73xhDuG8FAiB5bERKSVJzIs7k1kUvhSHp0QBNSR20rvVpA3PLnEBb8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462090},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5132da5fcb3b7cb5914fdfee8f6989df8dae4e6f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_assigned_users_to_user_task_config"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.2-feature-5132da-kvrzv3iz_1636456384562_0.9321133638229657","host":"s3://npm-registry-packages"}},"3.1.2-feature-77d634-kvs0bxcw":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.2-feature-77d634-kvs0bxcw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.2-feature-77d634-kvs0bxcw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a8dde5a27dc708e6b22aabff4549aadd2780d050","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.2-feature-77d634-kvs0bxcw.tgz","fileCount":153,"integrity":"sha512-ZiL+QYcoYCsLm4fsP/QTvF0p3E9FZWrlzBm8THfw7w0Wta1wSdDU+IHRejqeuzSNBUfG6a1/ax3xmhuHXDowOA==","signatures":[{"sig":"MEUCICeMfaPaNGJq2aztAzh4DyeSjED3AVacPoas6mCYY4cGAiEAzaAMy4uQNrcQx0XrqXuX/BOWDP4hytHB7n6rj8VI+qc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462090},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"77d634e87961a8c9d5979b3d2118cdb3cd0f553c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_assigned_users_to_user_task_config"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.2-feature-77d634-kvs0bxcw_1636457167862_0.12319883484987648","host":"s3://npm-registry-packages"}},"3.1.2-feature-461308-kvsaqlq0":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.2-feature-461308-kvsaqlq0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.2-feature-461308-kvsaqlq0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ba770c0c27d3086abcc4e30d1295ed01ae87015c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.2-feature-461308-kvsaqlq0.tgz","fileCount":153,"integrity":"sha512-F85+1fFJIvSfq9s8WPqQJ/yiAN0ASDVxL4ErR+uZYUjOdHDHnXLYvqpxdFBniRJijxYSllDThBk/HNYsR+ViOw==","signatures":[{"sig":"MEYCIQCGztkSPycHLotJlyaIfydkdpaZmXI5DJMDe3NriWoOzAIhANZuf4hjFbfAfueK4ou02FECUttQvfcChTc1oLXWY7oj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462049},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"461308c9c74ec023cf4e78b24533b29fb8d79358","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.2-feature-461308-kvsaqlq0_1636474651080_0.5278516140945582","host":"s3://npm-registry-packages"}},"3.1.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"760ad5ab4d586ccf16f097511fa1b2b8f9f73018","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.2.tgz","fileCount":153,"integrity":"sha512-DjbE6Kij38v7S4GS/reDr43JrtUjtRaLrAB0cjf9sZyafjNROBV2/k9/R0DhHcYQRbdhlCkhyHUOOeri6A+jsw==","signatures":[{"sig":"MEUCIClUFihruJ3JmL8HfEHiDTteRB/fdHvL4zmH+16nmzAtAiEAwhQjgSYA8wsBDG2C1dyQCpXQ9TV471JNrG6IwO9OTaI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462025},"main":"dist/commonjs/index.js","gitHead":"e7ca2d49ef2884bc9735b7a434d1e5903bc88ebd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.2_1636474673987_0.8635011814498779","host":"s3://npm-registry-packages"}},"3.2.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bd9616d6e4731f748235cf4b0eaf7663a55467eb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-beta.4.tgz","fileCount":153,"integrity":"sha512-3kmpCoykFrjR7wjd9wFqGiS/vErOZG1jCoz8OhhJnORexHMeAxEA816x+Grp9LsDQM/kP2ddDEAPMl6RcyiOYw==","signatures":[{"sig":"MEQCIGte2x8UA3/D28cw2Ohy2ez/Y830IheCsXfoMRwt9gb3AiA7vLZ1Bn5RSXwZNqW9DNvPga5QfHV5p8U9TicHVq8ftQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462032},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b4ef1944a65886d73da2b79d9d8faa75bb574454","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-beta.4_1636474834680_0.09683520480370555","host":"s3://npm-registry-packages"}},"3.2.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"85eab58f375c9559add52e903fb56ec7cc343515","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-alpha.4.tgz","fileCount":153,"integrity":"sha512-YORX+M4RZEgaK3l32WcUch4ps8GBGxfD/pkOt7XGomcOnRyNykG4eIRHS9bjN2rQwpYy6zP3ldQbeeIr+gRUug==","signatures":[{"sig":"MEUCIDhWv8jRdP52qb8KCty6r9PxUoy1bL1HdQLB4tSwPx65AiEAr9CwjiQOcdxq9hVKx/q+D/qeZ3JucVkMAJOm2dcPkto=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462033},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9f41ca7897fc44b32ba585579fe7693d4c452eb1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-alpha.4_1636474849577_0.47223762915962797","host":"s3://npm-registry-packages"}},"3.2.0-feature-1e5586-kvtfsneb":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-1e5586-kvtfsneb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-1e5586-kvtfsneb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2323eeb40ff8d53a388564693d5b3b4eb3edec66","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-1e5586-kvtfsneb.tgz","fileCount":158,"integrity":"sha512-i9VHS+v9UAdKqMgK2VbuOvzs74OPi8L6hut9XPFllA8loydRc9/JuGMVHWEsCTGtpxcQUQ6ea7NMUZ46HLxIlQ==","signatures":[{"sig":"MEUCIEg7VZAe8CoGz3rIH/CwIy4SxPEp4jdqYUArnWbMDRM7AiEA5a0vML614t7ZgA+85Vs/3tGVLBT8fk1bVK5XV1Nzjbg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479299},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1e558602d64c984d23855e82c62cebbd820ce312","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-1e5586-kvtfsneb_1636543604785_0.5668990959539424","host":"s3://npm-registry-packages"}},"3.2.0-feature-f79875-kvtfutli":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-f79875-kvtfutli","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-f79875-kvtfutli","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"79ad88821bf4005fc3b9aaa7c1e56d1019475127","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-f79875-kvtfutli.tgz","fileCount":153,"integrity":"sha512-8oxenIgfpIHZ8a4vA39+pBpHGwL1WX6Nyd1iKTCquCf7mjzzH2eEhCKazSECdmippliWEU9IuKcLZrXgh4gwxA==","signatures":[{"sig":"MEQCIHdg73jPDSh0MdAp8dLZF8ms1jTNkiXJlHWS71yHR+ihAiACBnJJwxXWQr0VTlqd65AUVaJCcBXXhpMXfXfsZ5qU8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462108},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f79875082877198fccbb637458f8270f544b6b3c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-f79875-kvtfutli_1636543709095_0.5594338314665159","host":"s3://npm-registry-packages"}},"3.2.0-feature-d93749-kw39vzdl":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-d93749-kw39vzdl","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-d93749-kw39vzdl","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"18ed14544477e808b93e3d4e8fe23f6f39e3cb31","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-d93749-kw39vzdl.tgz","fileCount":153,"integrity":"sha512-mAjhkfepoq93NCQaZ4IG+onOKdqaVo9NLaK1kxxdLy2Lb/SCrMRK2Iho3WX+mzoSamJnm1qfKXq9LyI4ppLZDg==","signatures":[{"sig":"MEUCIG59o2aiBDDdeiE+UOSbm5WfQYuezk0SXfJURDYujVX6AiEAj6tYkuUzPS2hbuE7VizxqVyV3TWHMQaODhUmf75Nnb8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlL+sCRA9TVsSAnZWagAAIJMQAI9XDKuR8zVZ8hGKfOOb\nXdz+QrmeUGotmjBCr8oygjxoIapfD4KtygApJv9K4J8yx3eZcfgkxVPYSwJB\nQ6kwBn0H8cXOdeFWcDr0NS5E7kRJT5HdufzmABiSpwhfPQirkD6sysAZX5IC\n7xey5hdSMSqNs+H+qFJ67/JO2G0etFrf2gp91KgdzKNhQOKoxcWFLnsBxy9l\n0HVXHl9jmxWxLIU9s9A8UDqKuz1iH7v390PYKKGE0B/0Pt22LC6n5XDWTPt4\n+fErOwjyRo586zqDnsrNXFpbUoYBRXeKIVcpOD2jGMC31Q5dC1AV33r/BsOR\nP1K2GNWupYayyl3zm98RvQR3L0MjOenUs8BhHIVQTIxBvzZQiB7V2eoHDhiE\n69rIEybwEUAfFQdcZlBrdPkiu2KpYTK6JvjK80C7aO7Cx5FVv6sPhLzZqL02\nXzZ4bQCm22tV4bfcKcVUavrwj/2tRxOjn9XqAiGUUQa1C4LeeFy+vSgwWg0A\nGzoJrjPWrrKnz2BPlw+FfBNmiwsswBmiZgCksOMUYDcDTTVPvRM/fTG+89Qu\nrUpTRv5eigEzbP/hI5eXs0dHTcPp/6p7+muVOAMqPkB/x4esJd5idh6oCK4n\n48744og2nm6kdQ7WcbZh1pyqv23RULdUU2g+1M6fMbjQrTFLYuVp2xOc0c4n\ntmjw\r\n=TMUX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d9374995bf02c952bd2fabe467a2d467394b0166","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-d93749-kw39vzdl_1637138348109_0.5690404622592096","host":"s3://npm-registry-packages"}},"3.2.0-feature-2636e6-kw3a7sqn":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-2636e6-kw3a7sqn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-2636e6-kw3a7sqn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"56ebd0d7754fa27c8341dc1d91f062777130623e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-2636e6-kw3a7sqn.tgz","fileCount":153,"integrity":"sha512-608BcnecUDHk660LCuteUmu4AvTgB/mVYRNOgAyU5a4izc+5yKKfrMp/H5JD4n0r+rA7+LyOBlxMab2C5WD1hQ==","signatures":[{"sig":"MEUCIQDWw9DHNuyxehxza+OyVNSVplqrgYKkn2JUC8CuODe+mAIgRkwxZ67g4RDV5XnVylXSxwAddONSZ5yCbgP00gGBl/M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMHWCRA9TVsSAnZWagAAkGEP/3HvzFaf5fvx/e02AfaV\nZifnu3tDvyQQ/Ab1blCPBviroUmI/5GJqDtCs4fIahk0kAXOeQ8Ae+WLxJFM\nhyR1XvRVCbD5Ch5u/FhxzidPrPDSg63Bba0THVPfM+Vv/KjIOQdNsT4OySje\n2SbqtLtwOx6Kl4v8K0kC0hE0TqjtPzu7IyUvLGIFllnjdLCrYrpZr5QVLkfp\nXN5dviya8hF6WOpoq7Bp9W1hrhKgkHZ6QwhimjcMCjKpb8NzLNmD8j5lnueg\nQAUEY/f+xkKQdXD2fcw4xrsyOkfjvoc+SbiBSk4PbKSCcW+oYmsiOQH3sYo4\nX551u+fyyFPvdsCg3Ff9lYi8hV+UdfAHpPgsdBiyx24+w2snvKSSXAgNYYLv\nrpM6vuSaBQD/rpUDBOfJZLpmyON6C05cE0EgNysAut0/ZhN1hch76NKsAyZ5\nqmyDivhvGuQBWRHxfxpBYhBlFsyP19L93Cd70bpdq87w6BFM+kcIxV9a0Jcz\nqzrYNvJzyw4gLhlyJGkndFCHG7TiJnWdKegL7QmfSKGYk9IENiD/DZfAthsU\nsriHilmmMhWS+xRm9xN/ivq4KdFmDCgFdA8zM+w8jkDzVIOVZ7uzz0ubmRie\njulZog+dtX+RzbLePZAiI6ifORd9Kub5P+Y3jajtQgQ1qhI/XLX2tAV5nRMC\nwJq0\r\n=VwOX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2636e686d378fcef124f446f904459dbeedd88ee","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-2636e6-kw3a7sqn_1637138902611_0.5036991577285854","host":"s3://npm-registry-packages"}},"3.2.0-feature-0038cd-kw3advo7":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-0038cd-kw3advo7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-0038cd-kw3advo7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"18d6aab0e7a5733a384f7427297ebcbd149cceb6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-0038cd-kw3advo7.tgz","fileCount":153,"integrity":"sha512-qbAhx+R+8df5qYm1e5Xm7Aox17mUfArcpaou8y+c7BjzyBe+SGDRVvxZx83rrHnR9/G4jnHBrzhkAUzPls8Exw==","signatures":[{"sig":"MEYCIQDx0SQJvTKM+K6JvMlCFcaskerg9wisw1vX5sp5F37xjgIhAOa2V3tUlJkRKmS8YluopHHnlR81zrmuczPzdCDPYZRv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMLxCRA9TVsSAnZWagAA3oEQAJM9zeUP+Oh+Fb/jO5OP\neeiCEQriUBf97kKGVV1AtpQpj6M28lbmPOwz+OuI2s7fJQy9MkDP/mZN5QFm\nWT1SRKNL9FYVFYsPhaupHm+7/bQNaojyARlh0ZShfbWIm0n6+J2NXiEuleZL\n36d7xVnGbD1CEpt+tPISJGt6qBejcEdGGi7JRcLTj5caOMI4/O/E34QN/GWV\nZcTeWx8MOlCZqU1x1Mm7OjsHUCVta/LiDdfjm56WT5wkjLAqsP4xOvVLf2TN\nNCqNCq0hJj4mEdKZRPOnvVCYiprDbDN96pssYIFNRrIvedJ8JZ4k9DyfLTHh\nPtyXFJ32oHBeMC27m2I6hFFjtai4YxSHkoYIr1/TOZ5RZ+31BENceeuxBOyx\nIyYbeu1/XbItbB/z20pDLdzHwBDIYa2jiVukoS8jz6lD2M5UXO3SDFDJnMA5\nzzjqPeN9w8l0piuGaDFRMQ3MbqFMSJ/Y8j7B4CU1tHMtB617ZM4fjxBt4P42\nQegUdGNtZaxG1/EEKvRDqqkBRthH0zWyfp4XM0Zp9KfcoHByB50BpolF6bmP\nyLkSmtMBuK3bleJh5lH+GVC8wAOOHLJsVyt0LPqBJ8WsK39skNU6QYYJukro\n8e1JyhVtl0qFze9bgKm0L/LL1VqiBRmMhWsiZs2mBs8x/ayj9DCsaPYpD7H3\nW6sM\r\n=hE56\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0038cdc6ca237a4c1ebe9c4faac612073c2c2ec5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-0038cd-kw3advo7_1637139185185_0.5594885287885707","host":"s3://npm-registry-packages"}},"3.1.2-feature-01658d-kw3ahkte":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.2-feature-01658d-kw3ahkte","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.2-feature-01658d-kw3ahkte","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6f1f2cabbfd79bbd7587231b8b14b709464f499f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.2-feature-01658d-kw3ahkte.tgz","fileCount":153,"integrity":"sha512-fNOXLl7KFaHyq5NmE7TvGZvPeAzScfec6KHMbG4Fl1kD9VGsuy8XAaMjsJpTEHqVttAxxlLll+jfFEXNjAHzig==","signatures":[{"sig":"MEUCIFxjEA2/IwwYW1SSEjzAPK4Zoix7uKpezd2geBIKGoIsAiEA8Zq21D8DhFSATj1oWbq5iGZgJ757vIVdNtIOfRuI6TM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMOcCRA9TVsSAnZWagAA5zsP/1B5A+bRb/2e+BPEE3f/\nLgyOjc2f9iguWEKYoT1RxzTcbk4r00r3vanhVP/H53TjUGIQJtgdLVZSRkWz\nDTlhpd3a02dkXsjF4UVcwmudR9dnpVrT5y5oxpn34FvUMaay8L36A75QSVpE\nNb9xxbMaqnp2drLA9gIgIi1XIm/0JBLL5+C1y5ib8SuttUhmJtYV8+JokP4b\nV0UHfFmO1UO/ZhC0J+fEZsfvbZ62S5VWyGdjwI2vJa84E3eZ1YhaV7jFyatI\nOQcYXYgV7qYgHHH+rYf5smKFSHN7F6bJm6hFTDfJzuQmxL8vf9vs1TnAJght\nZT4M8VkWnSa5fpxWSSARAyNdo5BA0tg8Z9lNwKZRxl/szkeJPHT2A6IJZYrz\njO5hvQyA47UqI43+m0NbB8nN2AcBLR4dRO6mg7R1dIf7RSKLwg6ihVxtBvtA\n6dkdMWFhTBV2VgBCfD95IWLvgQQpKR7ZcuvIpu5NoHIv2I6xOzVZQ5pBrTNf\nq0kdvENPT61XnbKgHu+VBeD1MwbWziz1vT8OSH2qhcCnDhtXj1p/xMsp8q32\nAl7enEoz0yXO3z89eCgzQQiq2OOPB47KzXAxmajlBuTBcmSSdNcakowVMHKL\nosx7AuTD1jbL7b2+3hb38CNW63D7ZnPzpqLDZOjtdJYlqaSvDK8DWMETq6bY\nMjAn\r\n=JtLE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"01658dd6947db7fe0f8438fba0c2e3f23ad20ee3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.2-feature-01658d-kw3ahkte_1637139356029_0.2151358804669734","host":"s3://npm-registry-packages"}},"3.1.3-feature-45628e-kw3asxt8":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.3-feature-45628e-kw3asxt8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.3-feature-45628e-kw3asxt8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cc083de5811a6283b1dddfe6f991916bcd407be4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.3-feature-45628e-kw3asxt8.tgz","fileCount":153,"integrity":"sha512-imdTKQA4Kl4nSW13gfKA8vNlAl72rmh3Bxdu7AhNTA3AbZty69tqgBK01ChARZtNpgDhUTElly0sBeg8bZd8bA==","signatures":[{"sig":"MEYCIQCs8gNzIivoiKEuIH0eiIExKuUOXA1iwhNgIdN3b6vj7wIhAJ1PnYplnyYwZ8FoCGf8ILxI/le9LYUwnFjja41CMFnc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMWpCRA9TVsSAnZWagAA+FYP/iNvWDFhHschQe1OEUT7\nGI7gcc0XlKYC/eoK84Ac0IHvofnyHXy+kGz8f7Oel0Kq6xMfLXt6fl+IXIKi\nCOQWCWNig44uh5UPLPzmDOarpmOw19WvQydGDSQl15Z17qKo5scp11h6+gGS\nC7S5w2/4WGCWcXFTeBocMEf5USdocD9dEaEMKrSrz/F/OCPvyMIgzC7QUEQn\nsMq4OincwirivXgD9hFCXPTcgkob0YqiVkf1gAc7k0YN9IgCPGtgjwTaz5+3\nAClhtwNTtfLkp9aa/UAz29LRHNNsDPKaOne+CMhBJQ9vRHFanB2/WYhlNY3M\nBzTE/PToYvbqhUk3v0nDItZ9NYtGUX6zUDvYE1YYG1OSfOF4eMtA/Ra/Z/Wa\nrG+z/OtfCyi+ZKJ3oCzzz9CEoNmrpn2+Duv6M38n+Bt2/VSQ2Zc4t1zH/tx+\nA5qdckXZju91veoR6PINMDzDVy6hHRApRATxpuGPAUSbfELejfo44LUUnVw1\nYIrsmvAUgZscDISVqj9Vdp0oP48LJ4Jb/U0a0fE5IBuwMu6G0hWC2s9JL3Q/\nJ9zMPYc6PVASQlckYPeDlpB913+qKtEa3pbzlArg02bK4VwUFwJKWJ3FwqD8\nUxoO8dfPusxP0QPfwd9ilNymw08V+VmLZF1GN3jfy9fTk9CrnzvuWDkDz0N+\nkEX1\r\n=g9Yn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"45628e95a56132faf4df75645108a7827448924a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.3-feature-45628e-kw3asxt8_1637139880967_0.44987284730980215","host":"s3://npm-registry-packages"}},"3.1.3-feature-3015e8-kw3avnar":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.3-feature-3015e8-kw3avnar","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.3-feature-3015e8-kw3avnar","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3bdae27d6a36a5290c26538b05703dfb1cd06a17","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.3-feature-3015e8-kw3avnar.tgz","fileCount":153,"integrity":"sha512-K0giB2PqChVKn+qOH3kDAkvBV1gDds2ci2gUtEbKdChRD8IJugu+g4RYrAG8wHfmr1RwI3YGej2omd5mmnu5Xg==","signatures":[{"sig":"MEQCIE59OZ3XwyH8JHFW8EkeYU/kMk6t/TeVJOyU+unJBDIWAiAVY9+LDYoBJ/Lo6K59/HVr0Y8iyrh8R9NSv/axz2keKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463034},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3015e84aabd135af1a240d994e4f39c5f7c84600","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.3-feature-3015e8-kw3avnar_1637140012339_0.6084876379931929","host":"s3://npm-registry-packages"}},"3.1.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c6aa44d69d9942d536cfd877026d6feca32fa381","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.3.tgz","fileCount":153,"integrity":"sha512-53JveRjU5MWOiKGyHv0JSH7VKNp9hQPRXC3Iv2pEGVoQSYAW8z7rISD94XyeyJFwDPBW21xGAoSHQvLwx22rqw==","signatures":[{"sig":"MEUCIHSHnxKACr0iqdRmcKE7jB1UWj7eigHSQk0nRA2LqCNdAiEA2ZTlPBhl199tguJR74NHOPXDEDKjoXCchCxR+BGcOIA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMacCRA9TVsSAnZWagAAEckQAJuA0p25iClg9haKG+8U\n9T5l9p7gGLEAUHfkhutIfc8JPgu23zqXRHWc7tRKoaVF0TqQzGE6Kp/P9x0v\nwfgAi3bUJldJ+6Z1Rt40fsDSPQEtfRTgTCwC1Ma6fMqD3r3DuCDy8sAp0wbe\ni032LQKjpXZAmzb9ABAc1uzSxDUBRpGRKTnReOKYrUwQc6RSDXDgiHOoh15Y\nt2M38L7TxuHocXXv9Nv1uuCfrD3ZbP04Xh+RwtW9eGGrSTgByfeYMbBk23Ae\n98SoQDtSQqz7wFgItWuBP5dUZGc+Zr9BaqJJcLh/PKSXT4vJo8JIlLl2Kp1O\nVMvUaUl+Llz+CB9z9AtEJWO1PPpa27Mqqpe/li6on+C4AEMi67gS3DZmBhzR\nzAJ7XUdvSqPPnvCx6fH3Kdmi+96TXck3Y9PIJnEzaTJkWGvpMblCKrlNwaOl\nn7PI8quPd9qcyLCBahJIRVHm4LH54+O5JRRKVAN75CmD+GzoJeXsyA489Xy/\nAKeYCca0ZH3XagGcKb+5WXcLqfXAci6iMor1kTXk766fX2W42eVRpgyJBhxv\nmGZkknRF0t4ceY5UobJgEKSAeaS7DLUIvInkYpk+Tm96GgAjT9Lr/onzPFjj\noMcne4oT2Pvvz44rdpwHjDkaNyM4qKMGjZIyW5OdXm1hpi+qW9Df+bqkn4Ij\nfZsd\r\n=JU2a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"cfc27d1f64c648ce080af51ded6f2d46a97629f7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.3_1637140124026_0.8808336897682472","host":"s3://npm-registry-packages"}},"3.2.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2c432f5873f5665f1be36495f703a19ffecfafa3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-alpha.5.tgz","fileCount":153,"integrity":"sha512-E6M18pwUse5xyjTznQYaAo7CS57BEc1k0IzTQa2fzReYd5/USPOECpeDBIvjY8T4mgnHyGk2IimBNtBK+kj5tg==","signatures":[{"sig":"MEUCICf70GXD9A6z4bnprkV4PTRIJ/xsKvG5TOAwFg9LRVcNAiEAp88Yj+L2Ou6ecYZ1PWMis51QGdHd6mqTfg2NFg+bX/I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMdlCRA9TVsSAnZWagAAohgP/RsRPn9uCk1FqF4NPdli\nTQxNbEwYqYAiZHLGL8bDeT4fF0povAVfOWZLxl8ItKzYVGjBIL68BMWzIpvK\nKv/6H+DJ+l3jlWZHz8rxiifDlB7EN+TAh4EoCBq5T70K2s56kGQlkHnXHS/s\no272Sge5A/2XqY1jMd57h8F4zm1ueHgfCDvlSyXgwBMAgv2VzgAatzNoTwCp\n3vEhsjakf+TZ9GnzjF8zPdC2LJ2znvZeCtrm4iYiM5wYnLQnUGVWOn+nd0L8\nOvKzFA6OqeQnfhmZ/Zw9onq8TSm7sspD0B6Pk0y/oDrPZJWBhAeM/flpGXt4\nFTg9OzRmbslqICsvFpWlXQ0avESNhXfY0prv7r0e3EJkMkCZA7v3xpTgeLGf\niua9V78SgH1PLA2g8sCPrvqoEDfLZBTZbQ3INemt02jrha5+t/Cp0BlmHuQq\ngg8Q9oHyipWUvuUCKerzsZ7UHfEoruFBtez471lAhZPP8QP6LNmz+E3PYYoi\nHkqG2zxIPdhRhon4lc8k79zhZK3YYI4q+bVUmYFGTFwyrCdhDxB3y4nOcCxd\n6u1hQlbL8fmvenm8cS7w7r8jna6D7ihpfqaZ76VqRId76uWTIh2MN/OOaybN\nttf4TIMlYgLGA67FE8+3OSAtfCjLzXnxBVJLZQ7YoIsMlIahyJ5EF3q6CWdy\nh4wg\r\n=Zrh+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"681c0500f9519b0fb558c69e487ede9a50e53569","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-alpha.5_1637140325525_0.11854909581856754","host":"s3://npm-registry-packages"}},"3.2.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"214fd3a116d15db6e734474c48576fe1f24443fc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-beta.5.tgz","fileCount":153,"integrity":"sha512-9EU3WVO6Tv0PJS7uyliLrnMYrmqQhp1xINsXWLLIkiEECFIQhyxukeOup06RvCeepaL+2aUnqH963/r8MJ2CKQ==","signatures":[{"sig":"MEUCIQCoM6bTB4CmPcV/vQND8EFeAc7ZlhHbY68bU9PhKomvHAIgcCTO3eYh+08FBho+XmGm55sfnF9Up9YAeCVesic9jlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMg/CRA9TVsSAnZWagAAJQ8P/jY+rbV7M1WvLU1zFBEv\n6QShNfWOPY5uz7OTp337VbT48gybyI6UALTZUmswmLS1R4iC3ys3rYAUNFMW\nYx77qwEB5OxONJZ4hy9Wzdy3B3vYlAH53c+ZdXVfkh8kvieEelHSq+qtG+rw\nu6J2wpNvZy6yPer0ATN1tFQG9T/tISuTwBKakVCVk7Ub+GlwYDLampdBsYDK\nXwLJHlYB2cOdVm/+Vt05RdayFVzQqeOnE9WBoAXigoKz7C58VXe0f8Gjmuah\n5PcieZTGSl4gaiBhUWK79CaHDhzsM+3/CYmpuQ/HtIGj5dLYMZbc+UJAjskw\nexbM3lOzHIq4kiA6U/rxYMa+KL1Uh7LaFQU8u8OZPKTLKfbPRPsvZrnqX/Xr\njfN5Rz/Z89WQf1rKEntOIxxBMGV3JyhjsjRisRyeZ3c3OZFIeC5oAPKVli1m\nvCHgCGQJOGStD9CkaZBiI50ElC45XDnafvM/9HbrT76jSQ5a4p+iVBQW+NRc\ntIrITGsJzy35F+x5sYSQdjeQdvsPKprJuVRhjPsaMPmApuPDjZRxcrMiM8N8\nyPK1kbkDREERMoyfDDoE1P/wuMZ12vahQYu8nD7tpxnqBlAExEpeQkRS/QxH\neAVEB44OKd/M/BbDtDVvcin7K45/qlyvIHXmAu52Xc3SQRmVp+VK5zYTFu5E\nlZwD\r\n=9NYD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8ddd1000507a5e6356a82ca304ed7975ac583c49","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-beta.5_1637140543134_0.9271194965291378","host":"s3://npm-registry-packages"}},"3.2.0-feature-79d2e2-kw3bfzwk":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-79d2e2-kw3bfzwk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-79d2e2-kw3bfzwk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"40f3b02254e9cb688416a2280dc10532b2923397","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-79d2e2-kw3bfzwk.tgz","fileCount":153,"integrity":"sha512-GF/gahXxcC2nZMJciQaYH+7JNLAHUWjbH2/TJhagt0WRI4nTb+s5036xKtHmDTKvMbHlLqRGEWmtaz1dVfjm4A==","signatures":[{"sig":"MEUCIErnFrCtC63My6FEDbLQFYfKxfv3jnv7AzDb8WJWmWkIAiEAkIeZh5BXyyxNJIVGclZAFnGkMOj/T/cO1VTPD14h7jc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMniCRA9TVsSAnZWagAAvkwQAINNKoL8dCZTXGDB71c0\n63gqsX46vci8JRZTQ4Rt1IimcDplfzbw1QeMGkqI6ZAjkG6IyMo6Re9L9q2G\nxlfe6tjG7SV3lNusrgHUgRJqMKf0qdRKRTBa6MRcSaAhqKJSuKSliPJBPVf8\nxw5ft8PNVWneRlhnsIhAA1W5WQ/JYHcpn/8VC0Lxe2z71e2eVPzKJmztRHuQ\nVBng3LJc+wnhkY6M+dSgYbZmDrHLILQ9oLel/TfNKenRKgKeQa0LMny+hSIT\nrOu6bJb7RiWOnybm/Jh+DqkTgjMCsZn5LGvvWcD/n9faYbzXkmHmrrd+5ogr\n32BtOn/K3u97l5KUYWZSM9JloMDaTPADVz4V933cgsMvzI1e0pr763Mxreme\n531AxXl+/uOCKZ92PtwMvTQ9j8wjCMi/cExPQRrm9d/Qm0oTjKhR+rH/ZgdO\nF6yIJMohgFn97fjIglfsJJyej551+bdCsEdNCEo4AY2wopklpNxMBZzxaomh\nckAfatacG6WXAWk0BXSbI9O5hDcUrX8saHgaea+L5QiCJDrtRsbp0lUSEPEB\nB+QirtW61fOLUUUgLuHNNjVjnEqRqgSPULv1VBPsgb/RcrlzgXJIABpUS2Gr\nxaicu+lGQUuiecF5xTJD7/CzDH+/6ZgKanvmE8+gBQfa2yogd6ZCBMlnkcwG\n+MbB\r\n=VZnq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"79d2e219d9ac4615aa4783a56213817d9df01cfc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-79d2e2-kw3bfzwk_1637140962294_0.6216221849355379","host":"s3://npm-registry-packages"}},"3.2.0-feature-733bc9-kw3bg91o":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-733bc9-kw3bg91o","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-733bc9-kw3bg91o","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6578f9de9ece2cbba0cb714b065aea6c7a0b4cdb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-733bc9-kw3bg91o.tgz","fileCount":158,"integrity":"sha512-fqOS6HI72Hbhg1I5cWjMNRBgJDA3e6NUiZWqB1gGlQpAaVSE+W87P3PG1NSB6PidwpARVl6kkERMSetxYDvM4g==","signatures":[{"sig":"MEUCIDYq5K/H0iIrjz6nyiylEdA574Ow0UecY+rkxqvnfG83AiEA5E9My6Vpx56BBsg3XfJ2wdqKMO7EY0NA0EFJhZWXiJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":480284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMnwCRA9TVsSAnZWagAAgHgQAIB5bgT6XXk4DyVnoVrT\n4gEogQeqi8JOYNPIkN3jQrgCRCSTQaCg8mHRw0umChPQ9+PJwZuBgAiOzDmm\nz19sId3t7Jd97x2yvQ2Jyt3B624SGzf2y3ldnGP1cE818tfX924e9IQyXksW\nG0awt5aiiRUgEfiFVSgo6+jOQhJZ1Jlxow1l7YNZitfzWIkYUNU+fodLvUfA\nwMk4ByGOLRmbai6thF9Wbyie5ukWXGjNIWLUhdTfG4nNUPXdNjJhQ8kvUoj4\naT7+mOb2P7WOQxFZU54dMaSqixRuOT+QbZnN06aFio+oHp8AMt6NJgBRmvmf\nCm6JUXSF8FxELWPpny1TpCRv8bg5l89rmMPua1PM+Y6jya8YEnwkbq3imBVs\nerk6q0142pcSBER+cSWPem/G8pmDSNdzlZ3P4zdzkiQDvrZB+kAkL2jlFOBo\nCB2uru4e9XNncHJ1kVbh3qnAevNWm3P0Ot2LGAfG5pPcyEor2mNjbxrJUxbI\ngIaIBVNn8v6KnV+9TWN6vtlUot2goE0QJWNUgYp5RQFguojflbDixnVRzYLe\nBwkJSG/Hy205ypv9mh9Wsf+tRJIBbxZhpBNh5vbfUxG7qQdcjhCI3ksW1LIx\n4qxjebNUbXEGDGOCmfUC4HotR5lCGDV2zkrqDryd/joPgy1p6YXp+azqmc2G\n75Nk\r\n=pezD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"733bc996d2f45226dea513db4e2cae267c2eda7b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-733bc9-kw3bg91o_1637140975896_0.7567045857232699","host":"s3://npm-registry-packages"}},"3.2.0-feature-f25e09-kw3bhkhm":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-f25e09-kw3bhkhm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-f25e09-kw3bhkhm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9dd957f62066091d6597ad151c443ae2665b1cbe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-f25e09-kw3bhkhm.tgz","fileCount":158,"integrity":"sha512-eAz/edyskhygj6nDXUThHqg7t7spUnshJFc7t9XUzSwo3StwCvcMVh6mFrDu1R1RHotgytZuEbiWw2NTcae7PQ==","signatures":[{"sig":"MEYCIQCFvxcUPPUAD/jcmBM3P/HvnGtvJbN9l7MmKqsVgy55nwIhAIUqh2jFXon2PHZQrC4qOuoVz/r0x0lC99KBdoPq49Qf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":480284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMomCRA9TVsSAnZWagAA8Z4P/iSx2psN0ahrl9pDi1zE\nKgojchdF0s/W9cMkeVOgB/cbVNdOFUj/UIe/0TmY0F77VbRxan5N5AR6hesQ\nYcwhEg1xzRtI/8UcAA0f6G+cwdiqBRysir62WvWAEmodV2tl8QGJ4jEkR5Gw\nhjaXBp8+OA7pOYfbeO96hoFsaDFMpF7SWdLibrtUzYY6cszj9HxyYThmzHCp\nSfYYSxdNLoPQJ8Qizit/lEVkWKhZ07nhGkdHRVfwg3BVa99qwu3bojx8DXnb\nvh/s5SDuBQPxQQo86p9EDAqMDUNAzOWljgu4MXz+CBh/D1VQUsR6bo0/NVLa\nNjb+TkrUABOIxa3v11ar2rHzbXCXu3rUw1SgScCQH3mFyiQCr4wEJWy2q2J+\nH8g9NxobKsE79Bdh0LSWigh1/02uuKhY/oo19zp9qRGbSUDQqkh31ZgsI/7u\n8ZsjRYxKheb1Sxu0Km5VQVWA8Nm7BbWsS3ebrfWV71JZC/hkR/96vRcjbrJy\nCf9Y48jwkv63B/il8SVGGhARkVElv0fOtP+Mk3LvWNMK3gV5vxqjdJn6UQpg\ng5pcnoMeVBmZDlrkRGcL1PAzhg6LTCXRaG9wduuxC1g/RALn2MB0JlTo0a7R\n9J18UrRhMCix7W08NZLYohw8DOg1ENPKGPmUcPmZdNAIi6Z7sNzYUeVxQb7D\nwNMM\r\n=g3QH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f25e098065256b831a428c837e2f8f302ec564df","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-f25e09-kw3bhkhm_1637141030542_0.3321442190153112","host":"s3://npm-registry-packages"}},"3.2.0-feature-a6ca15-kw3bhrsr":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-a6ca15-kw3bhrsr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-a6ca15-kw3bhrsr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5658baee99c1293476dea25cb81a166b67132aba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-a6ca15-kw3bhrsr.tgz","fileCount":153,"integrity":"sha512-W2fzFikr6IwMRKnwbCERwRmkOZVawfYNZIV8rKuJx8D4PBjUrTPgS4iqq2Sfab8sgZC65AuJ7T67pAeMxqzGxQ==","signatures":[{"sig":"MEUCIQCtKlkyNBiZK+tJCp252/SUudwPC75aYAhjua03FeFW0gIgUwElPUvTMoraIANuPJiSfnJzg5NwGmaoK1sdpSH44lE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlMozCRA9TVsSAnZWagAA4+YP/R+3mbILdILMmaTwUTnS\nWKnDpA77RRKqWctcfJSP2PpqKa9EwaSyNhp/bM8fgfd7cPn8ZplOmYkhlzFV\nbQL5qeSvpJEGS0IVH5a/qi9XVnpdg5sKp+EurveE735Azz6mWF9SsbNrlnr+\nB2ivi1SVkX0fI3Z/0TWCQbwaojAtbIPR+yFUcG8apEcE43Pom1W0AM8FEAbn\nFd43KXlAMy6ZSykVpH+4fzQAcdlwT6kbs5dNzqe7u+NN4MrFQ3ZLXqCTqbvX\nXy5L46qi0E3xr2OWeZBPPmHwliwoWyOQ3V9WGmKcmOHlnwUuk9eCVRml8ytv\nTdiBL+3pSl6CmxHp7KL+ZiCBGKWVhnopxr9lR0N1uzpSknehS21/FbV/WsVr\n8SFmmB2JwZvV3aIdZH0LCypSXJsywCFxK8jAgBgAbkaUKibpm+EgRnK9+9FO\nH7i3C2tYE74IebOLQTr5jICDEX/ovykoQAhx6psupZQ0ZKH6hKfLQFyGCbzR\nO3BsFqEDDRYypq+6fb+fh83F8o1Qky6PXxSbnUwm6hEmpnRkZCiXFwuu+eJO\ntK4/DUHFI+HF9Vfr/Id4V4GvivwjNsIQvx07Xnp3VYawJ+eGdaSwctY/fDCD\nYKF04aevQT1Uftn4sIRBpa4/kRvkFJha8VLsZwRVqydOyMlLJG6nnCANaqra\n2iYa\r\n=JsS7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a6ca15db35e8911733fb66cf04bf79d3b687c61c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-a6ca15-kw3bhrsr_1637141042908_0.9531327985701779","host":"s3://npm-registry-packages"}},"3.2.0-feature-01137a-kw3dnnob":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-01137a-kw3dnnob","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-01137a-kw3dnnob","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"19e315179f146aec06b446dab91928670703a3e6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-01137a-kw3dnnob.tgz","fileCount":153,"integrity":"sha512-QtsLNS5OgZaSs3Kk9t/zmEI5NixfcWcYKKcKlu0Cpt6TY+JVG3/jjau3csB5VZ2/jALrSPU8cc2KY0ue6vI2qQ==","signatures":[{"sig":"MEYCIQCEeFaYH9zB1t7qkbyhyz5d55smcD29qSaXljinDC06ygIhAIPurMsuHY+hyyWISD0uRDq1J4tLUByEn3bBPxwKEq6N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlNhiCRA9TVsSAnZWagAA+zcP/3BvDDRKAuGfUhIpGJh0\nGHP3KowMpmN5IExnTJWvOiaGwfprvI56LGX9b2dsOBG4M+8C1Ur6SXjHcyA8\n8W5ucS/qVuO2/q6s9C2PQ04nDZ6zWbBoXhY9sKL5NG7Z2k6lTCWUsBciXtt3\nGNpyTt3gV5oUPSkCZIEVTjGRLlJTYI8wMLsn/2HPsOvFgTzbbvkTH1uwath1\nzjLgw2vAJaBK+u/mYrKLpxL/RPRGfXGWIYNhiJgZ3Ykd45eacPMEzmzy4gol\ns4uiR2EL3M84Hicjz8oXHp8rmvrsTHp6vpPtleWhD1dAPLYUUWyT9XRl0pXc\nfesk6mAjGmcwVwhG9Mpxjco96koDLPDSpWFS6oefV0QqdBQx983g2XUQzPGp\nhmZ8EXGcOfQP4cILCsJm1O3ZvpEKhuUQscGuW80QVTaUHJ4FDIRSl7XgxmhL\nTBbro3hvh3VaAGgS86Iqha3tOFBc9Dc2MoD0QlZb83UDPtsYiTyevgxwdzzx\nFzfIkV73av4BDwxdYcLxYjyoddDXcq/StXyRtAh1nykyUXWdNoyUXnZjl9tp\njZtbOL8qH+Xk1VfmL8Xb/bzbrWYlybJNPRbjFF18vCAkGLi2ZJ44eCMgsGjR\n0kUoGYvuxgy7VI/M/XX7+MDHdHX92hTgFJQn1uDhXqBmSScHqTbfL6/rVrpL\n0bSl\r\n=T017\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"01137a1e5d8349013ed16d006cc8298d85cf8322","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-01137a-kw3dnnob_1637144674200_0.4406517682247988","host":"s3://npm-registry-packages"}},"3.1.3-feature-47b05c-kw3i5m86":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.3-feature-47b05c-kw3i5m86","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.3-feature-47b05c-kw3i5m86","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6ebe6ec35049311979cf501e96e29774c5cb5a10","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.3-feature-47b05c-kw3i5m86.tgz","fileCount":153,"integrity":"sha512-vovBfTJRx93oYozIGrd+Ok+qrD9GRxfkwvh2eIabbTEFru9/KsyaRuQVPiC24s2VYfeMrfHUAt5RSWFOkyV6rw==","signatures":[{"sig":"MEYCIQCjEWclwFRhnBnk12TU3syXNDHarE7l/Ui3nQO7G3x7OgIhALPJFwA5nMU/X2bdeXMB+yTraOK0y64BAH0FU3GNp1na","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlPXoCRA9TVsSAnZWagAASswP/2rgSLEbQV6tXawIDQ5D\ngoJGbPeNvv51XZUyCyUAdAAEIUCTcentdCmPBJw5WYXd133v6FRKU7dkuPEa\nK2gvTL5dFgH7/J9eEoP6LMGU5KklXJ+tIr3arCPWFaziLRnKTKgnh7DO1ANY\n3sI0SPOGGMTZxBEs8eeAkBfd+RKQwbtsk2qqacd3d1XBlOnQakH3QbVz67TG\nDyEckQHdj8149ejEcR4qcHnv2uMoKf2ZdtoYptEd05gGC+a254as9vSP+GU+\nYzhIRuaQ4oewTNJA2j7PWvyuZ7A3+UqWMgHYBUWZ4d37LjyhOw+mjQBMacx4\nfcbpRrlW/cVC5FB8JbWQ53PXGz8vdqJaEsIjFRasbygGvtI/x0v89b8bfhWT\nE9Lg1LX4w8Q+8ZcfC4OkxFyKiAbM1AtyBqwCjX1WF2Bqp7IwR9Iuzg4+e1k5\nv7fnP9X+OiLyuoFvV1T3dpyS8LKNI38PkURaXI5TG6IVmisim+4GY86hXOwa\ngTQmG23ulo6YPPFybik2QvzHniKgkvygc7GinuvqXGOC7hxL3Mz7iLNqlvKU\nI9pXu/+NqsAZukZefACweW41fmeKOtzkJ2poL4oqmIV6FbU44xV3dx+On4pm\nCCErc1QBP9ZEphoaoeLI93SiOPaF/EP8SNYVmi401kiKFN6yI1ZZJAKr9svW\nZPyj\r\n=RB8H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"47b05c6e3754ef1f02e1a8f8f7de3a0faa6b31c0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.3-feature-47b05c-kw3i5m86_1637152232594_0.36255738877587795","host":"s3://npm-registry-packages"}},"3.1.3-feature-f80460-kw3obgwp":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.3-feature-f80460-kw3obgwp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.3-feature-f80460-kw3obgwp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0ed18d3bc6bfe83441af7a8bee78f20fa892c07c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.3-feature-f80460-kw3obgwp.tgz","fileCount":153,"integrity":"sha512-C53GsqUuN6zJGywLqESji7Tj8OUe+27qIPuo1KaNDLG3y7kTAuqhzLsxeKsw+rmijfLdJV2YLQ4x70nuC2HVzA==","signatures":[{"sig":"MEUCIBjZSo4QCVuyHAi8yxJaDGu9lxWN2l3omUvHGD0oM9bkAiEAvWRduvOqYDogV8odLskN0cas2YL/EqqZ+aCNuH2i75M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlR5ZCRA9TVsSAnZWagAAxOcP/3xZCdyS0j6Za0FIWA4r\nMmq6n0FSzrk94I+6S8IIqnkxhaNkYRWbpfjGtwlDZlOkLwE5S9Ld4mFi1bMc\nGDnkXpMpAJlNBn/Yib9i2ngWJLcX+bDa5fu2NX8w8WZNf5/DvtWqNXqW9BiV\n9oTHuYCGoWfSuEUIj0VWh72AQXbEq4ogDUUbcDdB76VvTJrS6Y9HPkxptxK6\nyOL+xr4Vlux0ls1OlT2gnv7CVOwNTnMM1SgjKdIXWm9HyXTmiSXODXVwSLEt\nI5fAAo5PPBMr+B1bVM728/0dGI+O3ydqYTz8MXCK0W+OZoKj54UAHRSH1Njg\nns+Bhmi2n+BCLy05Wg63Gmj5tMVPniNGgJyFyyKvWkianIATG1HncStFCCvg\nuSI4Lakl3piyuxlWFjBIxD+pMi2YbKJ69xXkBrbil/Lppi7jT6YvVgzY86oA\nelNSRM9DJVKRD+LSM1kfpMfBOoc5mgE3xYjF4mXAL1LZsgSCJ2GnGKbCAr93\nFJQkcEt2+CsOwEW0euo9EMdC/p8mYGUZ9GJkm1274I9hRQ4l6Y2pRA/CTEF6\ntpI3yZtCW+gIwu9Kk91jRg0HDpSHKqOCzmHjzC1OjUzM2yFz6Me+GOB7nzWE\nwQTVT98WvZM5Vch8p+WFEw+/rW1JHjUNpnaTrCgXRsT/ABa5CYHxdzltroSb\npilC\r\n=H7uD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f804606ff0ac62b854ba7245f40538c3702b4b5b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.3-feature-f80460-kw3obgwp_1637162585717_0.6059887405685476","host":"s3://npm-registry-packages"}},"3.2.0-feature-028b3b-kw680jue":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-028b3b-kw680jue","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-028b3b-kw680jue","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bfdbe73fe4637c02025633e7a9e7d1996ed1786a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-028b3b-kw680jue.tgz","fileCount":153,"integrity":"sha512-tklU117a11aORxPPtSNLxJfSizg4LX3Qd4kcq3v4D1OTQIcErMzf9mT9I+BHzZ+zVeeyfAeEg5kO0+17ImeYPw==","signatures":[{"sig":"MEUCIGTviewU19vxLQNAqJfGP1fFgGmNJPV7kgrntmck6vXMAiEArb90uSXGqM8sVlVZYDUTXXDrw/R4gcTzAXpMY7GQ0zE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl3f0CRA9TVsSAnZWagAAEyUQAIOJKMTXYTO4/ySdag8P\nLmsVMueRkv1/Gas636kjYykanDARuD3fCkYU9bcPZ7ncTdjKB+TQ5cjKhLfL\nCOldtaUg3kCNwqo0R1bYIOkzd5z3dvlxSssyxb6mTpwOBL/9MHJ/gX3HPYcp\nZ2BDnQNRCfJ1dqXYT/eIlpS3xgiisNWMVyhlOWWNG57pOIwsYozo12JlNH2r\nj3kqGP3JeDJxir3uBF763kC4/JderT01tQk9ip6UAkl8N1RwQ1RvbsJXQB9t\nFPA+9SnI/E4Jh64B28TAcML7TgcckNeBsa1GBoNU1opWrn1baK96ZK05Jmp6\nPpK4pTpuSQQ0zc/gJMTqbB5bRL7iT1FtLls+Yba+fWk/F/WBWlDx6qdtOhrB\nJOIZ+gsiMncX2vsdjvVdtdDu4XQv4ef6ansRYVB1WVIFzPGwkiLqUjblTV04\ncl2oL9eGfNzx14TEtwWCMiMvpmXNJSTZ35iBOVG4zDCmXGkIozHn8yvTyyKw\nLm1At180brDVOFmu0H1sSCEIlz1UqpkkCdEEBpGBThrDHFGPJ8bVRRuTbvfZ\neayzGmP8JmTj4kJQNArpyd8LgzeGhFsWIT38WEER6IBiUk1m5pfdsnNQcW8m\nmfc9d9cxKG/qEwScb5QazWSA8BeU10E3URCMdJWe9cy77EPDMdR1+y++iF3i\nblOO\r\n=MgQB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"028b3b754b775bc5a66539162f4bd2e30a7bc046","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-028b3b-kw680jue_1637316596688_0.42257736367633525","host":"s3://npm-registry-packages"}},"3.1.3-feature-29ce55-kwakw3mc":{"name":"@atlas-engine/atlas_engine_client","version":"3.1.3-feature-29ce55-kwakw3mc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.1.3-feature-29ce55-kwakw3mc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5c2e65bce27bdc6fae4492fef8b4f785fc675c4f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.1.3-feature-29ce55-kwakw3mc.tgz","fileCount":153,"integrity":"sha512-riRUj+7hdCxID8N3oSn4tUs5Szvyef9F7/yHgWvER8tmKbOKYcgn+c1sv1CYFhKRbNnxikz55YcSKx7rYLgPlA==","signatures":[{"sig":"MEUCIGkVdtOc9qZDUGY0ym/LEePwG7e0DsqqmxbSgO3P3LUxAiEAs3j8HCeDqII2rj1yu6uie4xV3USUn9UtvBNVgzxrX74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm308CRA9TVsSAnZWagAAJPoP/1z9vs4SKHcILZGjJ5gP\nT9yy7hByCs1KYgU4GowejKCCdGC110CvBkz9EFhAuVXbY4tIWd98uujnqWCj\n6RGQF2AOJ2nUjO9FsaDZkMOpPmdmXZ7ev2tXYEaspgRJ5pv/aCvsJSBsLNbX\nGPG3xGAVrMR1iNPM8fazWdU9xJZj2/H3o7t9AL8w5DI0tAjb22x48YjMhH4v\nYtOUU8Ayed5D/PjGLlndEC2yZH/WeL/vz4792T8umfycxxpx+s4YIZAupBu7\nF1CDqpliQB185d9+wiqhZRm96dJSpk4XT7F7zmj8gWP8sUahBZZHQJIACW39\nKSl20E0QHMp1H2zD5WG1JQbE3OTw9WUhUf+MYuC6DSwKH35/S2UTBIWSNnDE\n97TqYSYlZcx1OaJI/UPrOq9OX8HbRKx9ZIN+nDRpECAkGd0AA8y8b8UAEXbd\ntF9eUvvyRcTluS0c08YaQyacO+IErLTifx+t7xIBNNGg6EsqnnRr8/rEv2UY\nhQOYqmxx/PNUjUqjK0Y9/kbUrSqTNZNXEfeZQZHnXCP7X+OqLby9PcOrI8hq\nejbuaU8DUAK5tCJVY4/DDo0UCcTTflpNE0AsS/HnSKelSoWwXm3gvInZ3zRR\nflqktCpexVqalX0XNXTpmizj2hB1zXJFz6viBvhfaV4k56a4uQ/fFfteq1Wn\n/Rdh\r\n=oSl3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"29ce552aee68e62926a36dc79bf326b9799fa537","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.1.3-feature-29ce55-kwakw3mc_1637580091803_0.058871291058965936","host":"s3://npm-registry-packages"}},"3.2.0-feature-06361c-kwamkj4k":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-06361c-kwamkj4k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-06361c-kwamkj4k","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d9df485299b2e06649ff0a2904f9318d5961dd9d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-06361c-kwamkj4k.tgz","fileCount":153,"integrity":"sha512-yLff/h0glpnvJpol3AJUJ506xIAwbfO9IHHXkbdIqkYuWioo44xAJZTjqHYBsQ9FysGIV/in8WGa6NkciJeTrQ==","signatures":[{"sig":"MEUCIQDnpG5OBNScsEciievU+xMYE0dhllDnloY4I3Ht9drtpQIgdLDqzx6USxBWJmvjkO/yK8jIu9tZxT3wtiHSSDZhiSI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4g/CRA9TVsSAnZWagAAPV0P/icolp0FPeIQpyvk0n4X\ncKbG5s4SZqxO8uc+m8kXNmSUj3PYTC4izj4iUR4+9f3jI83IWpy1xAm3jqMg\nLWITs/kBEKpKEXG+iHORYlbguS/6Ln7mGCZJwb5rSZZy9ghZFko05JQjC74q\nTRjXppKdNd0T2RM2SZtf348UrCyNHSs9mwgBObsqZ/UYAP8hoccuCJLdwmNc\nC+j0L/5yTEzzW74lS8zxQ7BF70JfnTMOtPcq2aiqnxyme2qhWocpV7xtD8dM\n/LQP4VVuYOaTdRQatGWWSlkOO8p78OUBezCOsn7BdGvN3C/IWtxvIQ0u0TUu\nPlzL7LlzEVr+WsyL71r5gniVO4it+GZep0yZRzQKXryTZXg+Yty3wktPoxmb\n0RoWiQbocVBfUkTbgwRDttgps1PYtCn2Ss4Rq+SDW94dHMdWxoBOV3YJBCZF\nb5lm1bRKmwL+NmhYIZRbtkfGq8XnBQRYYoBYFDnALK+5rcPpaLP7njaJZAX1\nsZufm/WrmiJwbjJBPGtl/WC8lb/KXeejWaGk+sjZU19LeNUG7mtefSjkBJ3f\n41m8Rg0FRYpEqXMCQ9g+daB4mIVETfgHUSQqtE3E+a6MirPg4ydiKL/qIGXI\nOaUwO50lGUSvb94PfNqpoQr+vQVnrukAKHSYifz2fssglpJvdTjGqJBOl89O\nfkMi\r\n=bHb7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"06361cb14c9b4a1cc01caca768e86d2e95c99193","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-06361c-kwamkj4k_1637582910897_0.19661989551716652","host":"s3://npm-registry-packages"}},"3.2.0":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fe35c9125470f511d524477aaeb21dc22d15588d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0.tgz","fileCount":153,"integrity":"sha512-ivtnvVl3fHNVIxLuAov9sKX9EUCc3QIwolGmOWigjG8RCDkH8ZqND3fKcvyzPN+QTarOvmuP4Xa6wkNrjxoHvg==","signatures":[{"sig":"MEUCIA9/JzUir+zBjYuuXoJ2jobStrPpWL1u4w2XRVVblRWxAiEAkvQ5HBhHTBwpEOS5had23Q6IopuuddsjCJ4zT0DXhws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4kSCRA9TVsSAnZWagAA92QP/3juDlo+CbpxJhfaoKkU\nlHGVu0wEnjcZKUNsGhRdPDe8FsMlucWZmfrzBR6QKhlzu94o4gcBtcn7m+Ko\naGGZCV07H+8es8/giUACYrhrPY6F8d0qhJvHIWQo/6TF7ruXmkXVBnuvfMsX\nWRffyUjIZAf4PAteU/7diKcw7civagCFQ7dPP4/KmGFXbS4wIrHxQxSHpIUM\nw0Y/nv1ErnnmKWVGeemOLqIJofwSMTxAQze2qS0LQqld+6Pnmz1K2v16W9Zp\nLHEycFueHpDENqp4ja0wM91uiJJjnhulwspBYLjDAb2k+JXlRyBRz/a9c9O4\n9UV4jFmJwSaoB+dFK3jGLX/C6z1CBIzgpy5OJ6bV/NAKAFVs4bqR3efUc9O0\nyPkjl2CFLYwdP0cirxMmO38uhuMq9OYk0pv5RTaeEEoLADIwT/pBYy/i7UZB\nDNDJbQvNWmbhHR7v1b4p0wXFoCuP9iPVFyw8bSA+2/5rnnooUGn/XKXn1B1G\ngPqhpjB6/GXw3owU6wHrrX1h8E24R7ATZ0H06VatQHWQizJUh7X6foG9s41C\n5ZSvasYB4y708x0BGvVL9bfoeYR/mObk0tw4ZSf6S1ei77HbmfKl15RX/RcC\norkanGRUBfaApj2BJp+aQAVpBI9eF++EZ5Ic0v9Ez0ha2YRmJ3SZNVFCvaTb\n3eq8\r\n=dY4B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"bb2101d17c25e3393ee3be30dca7e34c3af45a3c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0_1637583122141_0.15862078849708783","host":"s3://npm-registry-packages"}},"3.2.0-feature-a262e5-kwamupat":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-a262e5-kwamupat","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-a262e5-kwamupat","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2edc4ea907b3341b0186e98a610130c99c3a1da7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-a262e5-kwamupat.tgz","fileCount":158,"integrity":"sha512-OT40C3YXR2SjgOUEz0NzraLCgNnT1I6z+MN28C64VW/TjPE6lbNldA0gDCd1MjdrZnBqfz8ZZgqexytLtmW47w==","signatures":[{"sig":"MEUCIEEvT68JTOdcslfkTxYnm+SpcSKSGgnyzy0nOG6pt70NAiEA8O/m/ii7L5a1X1bNheKgUJzkBWjvGlVbt+mtMtjTli8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4ocCRA9TVsSAnZWagAAUNkP/31Nkw8HyyjzyFjGENpd\nGOb50sYp5GdNOTtvTTvNft384avvoeMxckL92M3X7vT00IwNYj1eHCEfijTD\n8EXYsW9qiNC2PAlybmvUjC3LnftmtVehkClMgvtAUZlw8w9OxAoVrR/l/dwA\nyxk2xkuSeiTsbUlE1/kd0ixppFPsAOIDbjyrl/88xu0Ur6e3bRQjGt2FTnu4\nQjR/NOdQI4sQdBNI36vd2nfxh8+yf4jPlzisoEaeLy1ESdp2TFL4ZWae/dNQ\nvptwycCvVT17mBHgwYOF/8quwtbisCwLqJwLVORhV3IQcM7q6R/pHwTd5XXk\nz/3P5nj86g5UhC7oUq4L83an82J3oIPTen47VDGdgmdZdzJejQ9I/y96X1ZS\n3wn2fBmb6U0yddqeTMrRFroUe/9gUK0zBWKNuh4gfRUZruEvvfJ5CYYHdILe\nmB+HBSx+G34s3hx9yGLH0RSCH7cL+cG3kucH+ZH1QovnmSuWT+bOAMmqtASZ\nTf0g1fS35hWp4cYP1FySqteqXxIMBdn2ryr2RcD9cusUvuyEHVnGg7l9TP4e\nS9qKl9Yhkp+KK3d3ZEpy9watei4kA5zUJ7GoQyKVdX3Z+DaqekJExvref3F1\nfeYkLZd21wQEr07WZWKb0Z/67ejrKLrUOCUo69l2YCpPnCVU5WRiRCz/ux5I\nejLt\r\n=iZSN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a262e538a08234a0fb82e06b964e43eea0abdd92","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-a262e5-kwamupat_1637583388358_0.6734288190024484","host":"s3://npm-registry-packages"}},"3.2.0-feature-d12934-kwamuz7g":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-d12934-kwamuz7g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-d12934-kwamuz7g","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"abfccf852104e68a4c6b82f4a5e50cbe9a2fd8c8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-d12934-kwamuz7g.tgz","fileCount":153,"integrity":"sha512-VY1EAeLTQBDuYCbny1RXRgqNqXuLPaSubVubm2dd7g5jLdoh0sQyuSTiI0I1hqO35j6VMtOisiil/1P71rxOSQ==","signatures":[{"sig":"MEYCIQDlrd14tuvdALPibcqR72Xy7mmttek2khOjgtvnqic7EgIhAOtf3GBZnUKRbPbFXJ+cbHyvrHNBP2ZSk8x0FtGzoseV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4okCRA9TVsSAnZWagAAk6sP+QEq1+rZ3shQAt5xtVgF\nI1foifnEBHvEJpynvwl6x47Y7dhieZgGyEyTOJIEXB9AjX+4ZRf+N0MR9WDm\n/76CQHzS40/XS2VFwA4iZN2KVXR8QwZc3Hrb6teL9J312EZ+/xqYmy+B6ClX\nKmm32XwZdvl9u5CGUW0jPsSem07c4mo/mVbFy2rzvTMc2cuqbhHKbx+sxde9\n6U2bMlGPBPiuQdE5pcxJeYNa3xzFI85DIRtInrnUKttHZn/X6CoQu+8P7Xec\n44zppBnrZcL3i8awpvG8UDl43QmNfdTrtGIf7WFE+YCEcbxXweebM38kLkLA\njvGYAJjKPv0QToKc3LuMxwtoQATdjvW6G6lmdzH7RG2vAQlJzz4zP1tcHp2C\nZcz1BsCBawRktFeWuCmi2NnOIyIWKHbrG8A2BYhp7bpHjo/HzXzPKzhszuY6\n6INxpTvCSJKtPhUuKNf4ngSUasIEejJWs2ls/Ms0ObZPF1BB6+Ax3icwbVBP\nJquG4zQe5jXAxjIacQSjmqaFO1AHTfH4d3YraOaQO71MwlBVjzChpBEjQuPv\ngFBbocL2eoRg4VjuGSMntHmJ24D28DNbyHwMp8bE8BHi1zr9siLro3eDaETB\nW1n5uxRtFVbjiuVIEYJxfjIudWNaBs6NJPfeksQQNEC47KFzITB+cQx1OrdW\nKn1w\r\n=/hpF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d12934c56c4218979d7a81c4c9239cc034ee1486","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-d12934-kwamuz7g_1637583396284_0.703888344877655","host":"s3://npm-registry-packages"}},"3.2.0-feature-a1f19d-kwamx3yz":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-a1f19d-kwamx3yz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-a1f19d-kwamx3yz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"00c7668a5416427c3a7379b1ce64c76d1f7f4a46","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-a1f19d-kwamx3yz.tgz","fileCount":153,"integrity":"sha512-4F/pNWngqwQGUuU8gxKMWu0NRV7kfvcqKKunIYqNw+kIli6oAcCpnumR6jpCM7ZfPppz3GsMoTHOVeIBT/UFyA==","signatures":[{"sig":"MEUCIHT47j9Z3YURR66MttPHhxh6HrFJNyDhYPo2/3PELB4SAiEAhApxVOqDWT3ASOkjOWGUOfe6A+bZ+MdSN2yKFSznldQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4qNCRA9TVsSAnZWagAAoUwP/3PXujWRWCcM1/jDz7Bv\nVeUPvNTw6MYl10QuzHnasQbCP0wMvrvPfIv3LeEZliZ0TqpRUse9psltJS9a\nov+v+yC9u6EQS9fJwhd51YALy9/O0m56tTS6XXgI1VVobOx+FUtYkakkwWQY\nWggUk+fntU2XMFT2cJQsrZhVht/Mtr/E8Kex+sO9jXuCL7FwVi9xNlyNTs/1\n68oS7tcclcSdo58ByeS639+Umldz/wzpz43Y0Ld6FmqHhMEIaB9VZpzeYwU0\nsCy3Ytr0zBvdYwbGQp6J38za0qyiv+8yVN2t7LVCXjVizON6mm7ZqTQfA+BN\n/KX9b4dIkAANFN+HH78MnONxgWg3y7slxdcVTiZof1d+mZoZmnqafq9OXpq8\nz7LslJWXt3QsJqlvniDc2jPHhz/BP6wYowXHEHQleZyex+qT2cK5ET4lpEFi\npJVgtb6EQJtxa5n42uc9pp25epwjyBjBnhxb207cK1HlJPhIuOWFDzPHozKw\nDvfiZbsWLLSH2SzE/YHr360Wi96QC6+l7MsHatiY13xVhRyVHTiT7MM8RHhj\nuRqmQEXZtuBJ6Ma9O6pllaaLHh71qg0cWVvpudG93sAoQg2QgQqicN9mT0D/\n9/0PemM8DlTNPUJo3cmENu/BKYLeI1lQC9e37/UMXifx1Xug5ojcMaj/7XJW\nam7I\r\n=KjCk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a1f19d9ad763b32f4fb9aa1af50e84020c2f2d43","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-a1f19d-kwamx3yz_1637583500836_0.5714963481961433","host":"s3://npm-registry-packages"}},"3.3.0-feature-6d857f-kwamxlda":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-6d857f-kwamxlda","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-6d857f-kwamxlda","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64c7a9f6e4c1f213ac4720cef46003dfb8c40ae1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-6d857f-kwamxlda.tgz","fileCount":158,"integrity":"sha512-lYFzirivC5caUN5Y92RCRjWt2IcEP5vauSCYLTGPV/0HeU+s41yfkf86GFEX3xd4dAK3iePEnQxHZytE0lM3UA==","signatures":[{"sig":"MEUCICuzdVVfy/yTid23/11SnpWORJHNOCNShka4RW5uvzfLAiEAwoCVIf1PRsP966botaS9e1ehv6IWsM/nRV5LIpiYLsc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4qdCRA9TVsSAnZWagAAjIMP/3s8NPtZEKub84fXJv6I\nncAzQec/rgF5IbrH5iRWFkt7ovxQZojxtvPr5FtKjARCGy5mM2TN3QbK2rda\ncl+kvsCW83+XPK3H17WG7QT0oTk2nzYSNQCyjJR1dOmp1PIvcENzKU3buDuU\n/Ebm9OZOpzQG5P9W3zr69tJRtzw8JLYnF2pRcyGgmzBBzdZI0cokZyO5mg0d\n2Eqb5lxtfMSBDOrsM5iLfEN0UqlwqzPunprV2xTJaQBQw1rpk0O/ch+3/oJG\nsrswR5W3wIJtSUK/thepp+nF6ou6Oq9V8lQ37Vm08u6W7p8PB115Bz0lLMSt\n3Wsv4OQHQVE4h6dgorhc01Pflb6txvwWDERfJ3QSQBX63sTD1cRuwk0HNpkH\nBG01gffJL8d6mGSTPqX6C5aBlopC3nvlvcACXkslbySYnIyTzh7fuAPpcLjM\nf25IXpvbYg8Q3eEYZKsBqF3LBUZmD1u/Ihwj/GqTF+Bj3oWRCjdJqZRBGve4\nYqUSYZOq1Y1bVj3KKBlpjYPDdzmUyicJ6o6m8HEl6EFBqhEMKr5s6mBoKibI\n/gRctHk98HBdHjWgUkfaaLZB1TIpPZnar8xj04I6dVdxHJy870/8vg24NIoP\nzdV3mmEF9IvbRL1sfWxdH4BBwHS+zHqXzVa2YU2sZlltrefrvIzu0rxIv7Yl\nw8ac\r\n=pgl1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6d857f4ffcba59a26c754f9b311a4b75fa7e003f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-6d857f-kwamxlda_1637583517497_0.30189794356112065","host":"s3://npm-registry-packages"}},"3.3.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a999eea746bde2e659a7601f35924c31065fab3e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-PioxO2ZwWdWiArl2+DEWLkA6Vg0UrwOJ0CZtvhODkS2oieAHR9G7VwL6OlTcK1Tu3xgMkfGaxOSwBj+k9qhnuA==","signatures":[{"sig":"MEUCIQCnq3hhwaiqfwZXe4YkDkkZzF81jSDnOdWNp7xQANDJqQIgfhShzHlGWUquCTxWzpntkCloUtkiamQwVz3JEoD5Jwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4qoCRA9TVsSAnZWagAAmpcQAIVRzoPnReJyQ8fFWsy1\nUguVXOJGnAYvc97oRxuDTii/7d/usR4T2wDg4Ovj4a1+nWkxLAdhOuneOawu\n46ggEH1qtiubTWP0p0QiW1IQ9tPxmqM3ZfIs5nAZCI96mVWghxB1r1ksMcnM\nOyWcclYypL+LSo6wk0iF+JPLm4EASktwWKavcsDmvRwvB1umVQuAibLxPolG\nwMICCnTKFxJq2aktkdVp+hcXUptbukroWtJ0WyhEageUQm1VOtTJy1nkRmp6\nSCYaBti6Pbv1rqBZCnxdxdF9KsXOIXA+v41IhTY88oo0K4Zda4A8q5rEf7mg\nceX1mnShB38Jge88hnmryK5Pz2Bp7h6V1Bjg+X7HS69ssd6eSb0G2S/iA6lP\njoNaHcl4vixDOpq3uMJXPRRBp8ErIjwMUVrwRZKS7BhkWoMRfBDf8pb++RnA\nqjT7/9JN2kNASdbww9ekbag23Dg2Prw1XKmk9ze+0yBPc8ZgzLTdOZKDBl/W\nN9CtelsPmCxnfqTOWE2LKbuSJ9TCxm91yZbLaJaInBFF97gbhZBJb5qjQP9c\nW6q+AW3+kR2qJaLAeP8o4kmfg+hMrbsI8TaC+Ya4elso6pep0Ky4vDmALJY6\noM9goofG1VewUmeUQtOf11ruodMDUJxgnjBg0Wqeeqw+U/WeFQAcn2ko5CkJ\n8Ad4\r\n=wYQe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"29a68f3dd1844bbfb2697750ba75647db98a329c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.1_1637583528440_0.13537092035170084","host":"s3://npm-registry-packages"}},"3.3.0-feature-d76c0b-kwamxza4":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-d76c0b-kwamxza4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-d76c0b-kwamxza4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"783c7f9fc465f05df31db24d3ab0cfc7fb346713","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-d76c0b-kwamxza4.tgz","fileCount":153,"integrity":"sha512-HhzfO8qDbVM5LDZPYgr3OSdHOq7pv5znNlXZekgwPKJvpF24i569LMCdhJfoBLV5nyrKR12CZH/a6QfJpLkNdw==","signatures":[{"sig":"MEQCIEgewAADMgBAStvBvTxrLegrxw5FDRdP1cQis4C22cZYAiACs5xvrFVswHTFzoU3OX17meeigtOo+P1B2dNBNMwhOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4qvCRA9TVsSAnZWagAAwEAQAIaTeeKOsjDlIQoe1bJg\nEDhzqa2/3hG+bVY1NOEOQ3Y63FQj8zF6uUstHH8s5CfK7IlJfzRkSLVCW/6k\nnPbGS78KtTDiRqmasRwiFg+hvsvG/MlFT9dl0bSB+S/Kdqb3qbvclFiPMIuq\nwtqj7zS7SH8ON4SFnVV17RvoqfTRGgFfonLAkqfXPC0Y9s9JatQNpXNxdOgK\ntjeJOQrqpJLWpA3INRRctHjiE+TXFkjpLpnCjKL0I1Z4Yv3RBX5Ta5fKAzrm\nnZ34IVs9qxp242jf0q6mEDvebzJFQSjRKLd4NbfAT+9Vw5AxD4fALNM/0QKD\nhqVeE6tIJBVIV9JCVLZLnF6SQi54ApVtUIs7UUoyQAdcyxtQ7Q9Xclrz81KW\nx5jqRKbFxsSXWMspEZxOzjyp55+Uaf+LtY5CNDKFF5B9rb5GfTZIYVVgvclI\nqzvLllCgmNV49oJ0cdA40uJKM4aEBXCSWNRRM2bTd7jb7k7voAJOuLLkGL/9\nbatNt7zAwsdjSNvi0PGO/FzfK7gcq1UkEFmv/F8+soJEtvwBNxhGILVkurSf\ngeoSH/MMykwmVFsV2aeX5UnVaWr2NxEppZMyPvLI9tNZ6V8Ax6wza1tH4hf/\nU1YuCAG8D9BeJT6RaE7b6eYm35v98x925ahutBxVnKbdILpMZY2cTHnDdrX/\nYUdm\r\n=L/12\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d76c0bbeb82020c20bacb543a71adc83b332f483","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-d76c0b-kwamxza4_1637583535212_0.11098588179255797","host":"s3://npm-registry-packages"}},"3.3.0-feature-2ea9b7-kwamy2e8":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-2ea9b7-kwamy2e8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-2ea9b7-kwamy2e8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e214c66756579b2ff706b1c054bb5adf2f11dbee","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-2ea9b7-kwamy2e8.tgz","fileCount":153,"integrity":"sha512-esqf2iCdhD3Hvw6b3P2c8RipvPVj+DILBrhnQEu028wu64PpCe+wPNLYawNFZRmDUJZfbX0ow5/cThXXQ0gvOA==","signatures":[{"sig":"MEYCIQDC6eLOLYQ7VwmH0JwlXofmYN1TyLSuN1WPks3pGgAwhAIhAMIynTGSOorlj5LS1xtdh704/o061WDoATyUB9hPkita","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm4q2CRA9TVsSAnZWagAAqA8P/2h5bBRO7l5HdWg2HAvE\nNQ+77dlh0actni1xNJoGzeTgo/qdWappw7w4pUSJZmofNRsv6bo7ZMlld/nk\nN0z1Q/M54IIFTs0w1+814/yh2HOLKNO+2QEFgtaAy+DwgILHJQFDNtr2trPK\n6hmwEWdFlygDlEJjMWxeFLGbrDjBJZvUMfh93GFtRsNeeZl79hgyp8zKuSyv\nCOffHtN0TPdg/u/QSUbQFNq1ImidFYzBzGTGTn4KDxSQr3VmMSjsqOsLma0C\nk0wovFSU36lUL6QPnjXmR7w36INVCAP0U83OJt0PGmdj9kxPDFEag9gQv3he\nIzcITZWL/9P51GfU9FJtzkCC2Jb/maXYENKG3hmWiU9OVCMBKn6Avl3F5M1G\nDElzzje9W/aLZDfaCGi2WJmMsvbVuhSZ1NCRTv1lD7ORtk8ZwQdaYPx43rrk\nmGqD7OKywQmLJdVljFLzABQYavUANwfIhwnIdL7FZPjhYviJCZC3VFQIRZoK\nJjIUf6YJgNn9/VLu4vS36kZ893TijWE2LroMxp/bhm9J7X+5O1NLhZHkOQuP\n5FuJacUQuUJGouDS/tbQe1L2wCBIz/j/pNw8XOY4QUdUVVJyNBs7OrvPeZ2f\nyAAWe2Zs+yjLvgQPvgP5qcsRCppEDXtejxuJh7+SbnTfAxqJpo15vaVeZV/1\nFBUz\r\n=BnL0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2ea9b749987eb974200a3bb871826e5e64c9f075","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-2ea9b7-kwamy2e8_1637583541945_0.801259167508596","host":"s3://npm-registry-packages"}},"3.2.0-feature-e168dc-kwaowhld":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-e168dc-kwaowhld","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-e168dc-kwaowhld","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b5d5acaa5c56fa9a043438483e07d0503e5596d4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-e168dc-kwaowhld.tgz","fileCount":153,"integrity":"sha512-Pmq9MsOKhZUwWdZGqPI3Avkmp6p8hjWcJWeaYbeuP4DujgtRLG8yHwjcqzVuh+6tqzdiC0hWCgvytaQ+w9Mxjw==","signatures":[{"sig":"MEYCIQCjfsJ10pjsEsuSj8QpX8ny2udhWFBSDXm/tu/x1htPTQIhAOPF4kBgQOxYhINAsFm/gs5rtu6y3K5zRHeNo5AX/4vJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm5eNCRA9TVsSAnZWagAAgacP/27HKSHYMWZbiyGRvooy\ncyVFEIDoXo79uieJ57TWSGvLMj33zCuLl3g7pmD9ASXJCNzpa8e6Wnl+JgDh\nyIKRo+nyJB9xKDC6+ExOvbbC1GlYhH+AmFIWO0J5T3F7PXSvfORpXPfqyJ/Y\nqfP8PWwxLSeUEJnSPP5CB40ZKYfa5iOvOQPU097rSm4JI4DpAZTcYb0aY5T6\ndZPCv7zLW5dA7svFxM5phmoADwUPg4ljmMECCOnf+Enf4g7LMkQEcqVnkiEM\nBNH7G5eqhzpOWGkP95J8WMNkFlv/syU8SFK+6Fe8atUa1Qs+SKXw3MxIWywR\n9K3QPfAYyW28eQxXRD6rIMB9g7icO6LcujodgLgBcgzPpAoG+3KEH0hsKw7w\nrf6R3E9a8b/4bCJLgxN4krODq3mlWN9dS8fmbJU9y7InT6yQUhmDevg6ct+o\nKAO8j6gkvCE3Q3XcM0+HN2tVa2bSVc+UPRWT7FHWeddxxaKVDWCCvPYQdpsE\n/YxsNvO9XLVTCg/I0ABEH8nfGCKkPk1vmiwhMURp4O8oElakSsWT3H6GQ3RO\n5aSXXCqo7iwJJf8Gd1a5MLgInUVpecy/u2zKtNSlRMKDO7unvg2s1mgigsNP\ntlpl08RyQAQOFPi3YgyrZoHRxPpnzMxxDCrnmOk4MlQ2gHsJhQlWF6B64/Vx\nINfk\r\n=LFe9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e168dcac8ab56b70be3a01c0e51afd4d9b2be984","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-e168dc-kwaowhld_1637586829077_0.022060968378926127","host":"s3://npm-registry-packages"}},"3.2.0-feature-af0eb7-kwc547h0":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.0-feature-af0eb7-kwc547h0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.0-feature-af0eb7-kwc547h0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dfb57a8adc936895f0600c77efd850186beca91b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.0-feature-af0eb7-kwc547h0.tgz","fileCount":153,"integrity":"sha512-GIDEcPi+a4ILojtOzGeTlp1FZK/uhhqKL0X9aYgbG3WSOJjcbMy2RtDjqvoQQpSBSs4aVan+3LM4FJq5tUZOYg==","signatures":[{"sig":"MEQCIB6icQXX/gpxRp9ZoEXD9YHneYKWWPk6lY9r+dncrfmoAiBLKgnefOWp2II6ymlFJ9qArCOTUH1M24lfNvJepRKgeA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnO4dCRA9TVsSAnZWagAAF8cQAI3kfouBfO5AOsRypSjA\n71cYY8soYen6rgJ1LU7zsJUW0Om8+r57ArjHjFL7xAz3g+vg44erxM/hSWlO\nwyQFWjaQuo0zQG+dQj3nnB4YeUzwjpSRuaPPKOcSjdaaQCvmZEZHScORATFL\nXaZNAqoe9SuWn4Nxh+fkOBxTQ5MzAhi9O+6gzDJarYSXC7X+CHlGB7ty35lW\nZsny5oQMsfQuLER488WEL6c2PuLuiAExV07bjzIjxJ8p+O+KkoEz7hJS9zQK\nTv5795chcbn7luGAAjM32O4jMUXkpLerFOPcPAPzr8k5P8YY5rjyKnhAJ9s9\nxdSO+inImmP3E/27DGpbBDakKlKYyTZqCDvDoGa9gTxBCqF5nmV6IxkFydMc\n72DSuw7LXb0FJGFNY55II5rw2VLCJkFRSnlsWpPLIaVMUMSPiYi+zHbs8z9X\nYV4oY88Bza7cYnex2LsTJICZhV4z1TCJ6+zamxdPjhHs5fRQcct24YEZHEeb\nTjWybUxLwxly7x40npQrFm5nuK77eHftm4RaMB6jr3ZJCni0sCP2UOs8cu8R\nbUgFdR8LF++d1pJuVllbI58zY3+aUWPPDzKOWlcVS5AwjpIjV7IhUoVywmCb\nA+Tj+a2qAbSo5GpeQry20yhMYXt5EOOBJ1C0eQmfFtU9xvBosk4efJhRTJgm\nmAzb\r\n=ggf7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"af0eb7e43611a4e84b4497d461f00a1d3d9176ad","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_is-executable_flag"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.0-feature-af0eb7-kwc547h0_1637674524916_0.5421070324858976","host":"s3://npm-registry-packages"}},"3.3.0-feature-6faa82-kwc8t2vj":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-6faa82-kwc8t2vj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-6faa82-kwc8t2vj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c777d03a187866f8e4f51c111b3816c1508b6353","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-6faa82-kwc8t2vj.tgz","fileCount":153,"integrity":"sha512-5oMJ5/siCbh4yHp+6rWYStwEfpg6lL7ETM0PAV4Or1qMUSJD4jiegeptbAnOCQr9SDaxZyuqSkwCR5GGmPTs9g==","signatures":[{"sig":"MEUCIDaFPnGAu7ihuKa40jao6/hupwsmRB2opgUNiWNvdDhpAiEAnPpnjmnOCy/nSGR3L70FIKS1Hso9sYlbx3W1uV0N2sI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnQZcCRA9TVsSAnZWagAAAyMQAKGtfTZDY0hxj5MCvogG\nAiKTGbB03S0u2UmuwGRm/TzBzFGGjNWTOxc1TzaWy8+R7yrRlcx82f+tuwAF\ntUbh8ipB+j1xR3ApK5bPN5tW9cut2EMWzJDtAQ9hLbxCwcwIa9VP+IdzzIPh\nX8XcSCBIAe8d+Tjnv6AXsw6PAISWCU353CVYdNMqV3si7zkvcHJE3RtXFzgr\nqWCtRQ8UuLICY2ZDWrPWlI7Ovzo+tkgbqfc9E/Va7yJvNyFQq6b7kDDHst0d\nWcKzs2h7joyJ6l84s49B2kcKJWHll5Hg9GNwaoehNoIEhRElig8Ka7KjBmy1\nc0j74Wt09JDzOvlRpuPZ5Kxs5i4B7epPxPLiZPBuQeWhAqfNzX2zr5vS8Rzv\nlgfTT74WQPR7lKPkVDcbLtT9aUE+uRefY4eq0V5XsYk3kSPpyHgr2mq4XLc5\nCN/zi2iv8PvJL/FdxtP/V49Tj/kimLr6r8Walevs5zKOk0VyKdWdADLeqyiM\n/NuR6KdCbzkwfNSpexM1lPRaQ4RBhfrMBZOK4iy0a1LGYEMC8KNfRMClu012\nWEmn8QY/G89GGSN6ssmu54iM1VBcU+Zf6h4QcKlNIfqapyJq93MioXXyTtE4\nk1DJv0GtMCotqYvFouI0QsclaTW60bi+mGUAQvbhGLTSjGFDMggXBrbRjyIf\ntv5w\r\n=SOdt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6faa8263cf2bf8402707c63b2d41bb16c6352575","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_is-executable_flag"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-6faa82-kwc8t2vj_1637680732563_0.5282160734137442","host":"s3://npm-registry-packages"}},"3.3.0-feature-6a1f7d-kwd9aowa":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-6a1f7d-kwd9aowa","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-6a1f7d-kwd9aowa","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"46e895464eff9f53c2135f13fa4073ea6d07667f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-6a1f7d-kwd9aowa.tgz","fileCount":153,"integrity":"sha512-N2GtIb+OiHce7f8Jt4UV0WTRMRjbqk+9L/1WMQGhCvF5Yc9Ed7xw9ExgKCHXjQXI0J7iCx4tZE9cEWIeqPtBbQ==","signatures":[{"sig":"MEUCICtpVDOByahE7MFjWJfRZ5/aVD2782jZxaMtbgpqdTJ4AiEAv5r0pgRKwUTY8nt3TLKTFbgBhJlLYsVxL4DOVFMMSkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnfW8CRA9TVsSAnZWagAAiGgP+wRdsqT4WarECmEQmF/u\nVs+ndVcUrTvQsEXnweQKUFa3jRHlokgCS0Qnolpm9wax9QmgYl/FGm0EzYeO\ndeHAbqTgFmvRephPgI2FvkZBXL+GanKsVAEZQy0IWfSZViXBCpkB/KCZO16A\n50h19sgq2eUQc6AQRAn1euWSvfGcee7qTfEd4syy5KGzGMP0jv8hgky0Tm0v\n1hQUfOIzkArKeiRHbCMeCsKN/c5ShZtQD2tlBr/9XhhnI5GXxJKByBHBAG5t\nonem3kxzbxw7nChPTkuDfptn4rlmYradsTuSCDwjTo+E26vVPR4Plymxvdw/\nm2wR8krtJOoVFZ7LvpVLsJ+X13+AbEjoEGItaqOyOH6SgdDSe0WGK0UzpgNv\nw402EicsSaU9nYgTO02DyyfIptGv8foJlZ97lRondilGsAeVhAcfnTM5FaV9\nBVvBxWn2JOx0DlhwhsDBSjjiOAq5V5+MMMOFjAU/13EQo1RZra2P8lwmpdzq\n50oqb0g2YK+PxooUHrf1vSPTlj4lfhsY35OhNqN3f41XoiwSroaiAdsz1Iqt\n4DX6zh+DftCpHzTFZeJNZmmc+QylUlYN8mPuhPaMhypBLiyF31AqHZYsfHBa\nUnKx6y2/4lIKZ7ZxgDwvCej0LAAnq29uLRL7EvwolMJspLUiCBHbs9C/ZUYr\nWNme\r\n=pfe5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6a1f7d53e866cb2f072f8e769b7b822fa7bffef5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_is-executable_flag"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-6a1f7d-kwd9aowa_1637742012345_0.5807253600982676","host":"s3://npm-registry-packages"}},"3.3.0-feature-8ba4dd-kwet3amu":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-8ba4dd-kwet3amu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-8ba4dd-kwet3amu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7080209da7de06fcbdc8ed317ec8849625a50f60","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-8ba4dd-kwet3amu.tgz","fileCount":153,"integrity":"sha512-c4D2pZAvIPkEpOyYDmrz8a3hyrAq6At/Bl06tzKRsdUZ6p8NzyAZ3OAeExnU27wI/0UaIqE369o0mTi376fU4w==","signatures":[{"sig":"MEYCIQC9IB4wdfkPP+AQ7CFCKbWkDRQ0H0iT1G/ysfO2qoP/JwIhAIfABMSOgUJWxi/E1dkannXXjXs/WHdRj5iWH6wNjs9W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn2POCRA9TVsSAnZWagAAfdkQAJq/hkUvuonoXBpVW8WK\nxycj7VxaHh+l3T2e2Gf+cgt2Ue54G5F1t7X2Igf0ndnQ9Djdyp5XJIv4GEQ5\n5CMvb4XcvpL9N0TpnLZrfNSiD70OlQoELunvJWbnDP1rImsAXD5ekoqg6lvG\n6eimvzm2N3bqGky3F4q4HkxtRajPahaAO4ao/kK/JBvHsIxZ9P9/2zLPS4c8\npWqn9C7RCAPPL5yNjrE3Fb7qwu5Z2g2xnuW2wSBZ1qyBVIpb/F7pwlVmNp8w\nwkpqKNDF+tRj/SriADOZg7wH/1dWOD65nzM+TDUeulpEKj3Ufm1k/XiOPVpq\n93YMTEZGWaHp6zNk6uJdBK0XYdc+0Gmob2NYRtSLXawkTCLPlstTOgg0kYFH\n3eeiBkNY0U67Uf4QQ77rZ7aetBW8M/5/dXbU98Wkdlr5esKjAm02ijzAYj3z\ne0/JhQ+1fpzKbX7f0VIvs2kdubDbEV3aqfUbvaFKDGqAZBYQyjqK6XItLwrN\nbTlkgOl9962Qxr2boBdTe3hwnZ9U34OOX0XxnaK+YnINEezPan+R077s+TMq\ntYlRsYUc56zhv8M8uyEfH0gyduuPezdNPW2crGxhm69YgOeTWBh4Ypzphxrt\nAHNoLf9SBHc7HU2ZzbivdvntscejE63k7c5C16RlFzNhhS4MM0KegoOZhQNw\npdPh\r\n=xXDn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8ba4dd781514eb580e90ac2eca9b512f3145b794","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-8ba4dd-kwet3amu_1637835725838_0.7963880809004438","host":"s3://npm-registry-packages"}},"3.2.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.2.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.2.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f3519e40c22193ae55eba73016233fe1a8bcb483","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.2.1.tgz","fileCount":153,"integrity":"sha512-uVH2kktn4rePmX+zMd44ztQTsB2Z3DdzHvnA/UUDF40iUAUxSn001BNHXHAvASlKjIH7Ch7Xmyh+UOvrKBRYpA==","signatures":[{"sig":"MEUCIFHAOe2bVSA3j/r5VRRStwgKj0GswlJlFIhWXiKrPgYZAiEAqHBoYlVFXqKSxBi+RtqynAFPpFmWpDocyr9ykPXnL0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn59LCRA9TVsSAnZWagAAaqUP/0ixfD01siY+g1qHfbdl\nE9BCQXZ/7HZ+GHn7cH1GF5Mx8ZqeBHPaPs0DQu9EEkJyHbdwkYahb7nuYKai\nuwkPVLlZpYKg9f53iVco+Y0XLi+k27kj/Zej77+rOaVzn/V7dsn6B1Hswtyj\n9mEnzfavz5ADmMglK3gHlOBck3QfqkvTl81xYNyVB+lEKl5N83BubGVvIfYn\nHWa/uJQsyy0Mb/Kle03/Yr2vf4rYwK76ITfBux1GPeWuuOwmZlQb6PD1eBzZ\nVOHi1u7q/LztsPr+J5nAqnSJmfAbX2KYQ6kzhWaX4/k31absXnAMvxJNdIOz\nReJJpnJWuw9ycGBdmcapxzhIL6hRIJZ/mLVXB12S5LTk2pHN88eQfukmPT5t\nTD8cFf3EJVRDX6uVmkTY8sre271ml0JcdxJYWLeWNJhP64oSzkQqMdUsVldX\n0GLF6g9r2QTwrEwFA4zJ71jNbEYU/7j8gwdr2kSn/weYDz4c2pR3H1o7c4Mj\naJzgDS2Qm1wT69+zPIb+2Z8kLgRf961Wj4ofpxGm9iBQ8hCdDUZ1cYUPemQy\nOwz7tYk/HipbcPhvD69vfGUzYlYSQUY4gnBG2yyiTsdNKEH6qLeeKQYVr8+N\n8/9tbk6CFPXItdYi2A3CjzKcsACRwypnXPSTj0AXZ7Nlwnwyaj9OJ371wAr+\nllcl\r\n=fcCc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"a7d548a41e7de283bb69c50bd4fd83d2e51af4c2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"6.14.15","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.2.1_1637850954820_0.5784607259076588","host":"s3://npm-registry-packages"}},"3.3.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bb46710ca8d4842d7875fb0eedc43f246d302e1e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-beta.1.tgz","fileCount":153,"integrity":"sha512-fOMGw0dwz0jeI+kuGH2apsXtpWIFTCy91nA6c6VrNYTeDKKxHJguRVVxMlExuRx9tZxfZzoUL6XbvWpHNZ6jKQ==","signatures":[{"sig":"MEYCIQDlwCk+3Es5/YZtM0kR9doutm+di+UqgfLcJO+OuWcJDwIhAOtZi7Kn8ALaOe8CtLwAXf5JUhyXD+OJa9pN4lqBc6tw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn5/xCRA9TVsSAnZWagAAYh4P/jzUIedNrI5zUnGq+K/7\nQ5aFT7oxZd0MqytEsxOZVG+dNgpEhUaUYDFUG6kVq4YQGwOTDSYbNR/WGzVa\nrSOQ6MAE3zuk2VveEjOrXKDRjl8ulF3D9pwO2p4nrhuLCEKwR26LyUVPPPxk\nWwU/sH3c+Y+k/5aY1Z9z7gIzHPkXvBHHmtjET+z62pCh0VjxbuCpvNghLO5p\n8Z2k16ZbC0nNeVarwRQn8w2s5n7W9fSJC9l5exTnkEqF4vUtcmLcUDrnCZKl\nhX/Crp9STfZIOOxpYjIU1DH1z7EL6dRSUA8G1iR8dWkwY7nDlcYLlFfa8mll\nBGj2fUSDVVnZmIIOTH5pqT0+8W5rtkZvuE8ma08vu9rgYRfXxQdGI8hA0lEd\nkcF+ND571kF6VmNGSVCtwHvY895dzaWS75gpV7hpDA2WiMIcfQY2gEeci7RR\nIl1hEIN+MJRZsPr4J/sx6RKuubRq6mTS0RjarFdrKLS/TvyTpTZ8k82vrgIk\nWkcFFGLMOl1/7hT0AuqkE52Za7/U7uAK4B0aiZjPTk7+nmHp3GYl1Hz1mv4C\n7b0GXBQlSaogM5PRn7U8T9bQTZ75pcYbNGsiRmcVsM3VE5NnOkjTxBiq+HpG\nS5EATdcaqnFxxE3Uk27Nb3WphLKcmEWJsZtV7vxZ4eKIqq9KpSyuTbvCqrYI\nmgJY\r\n=QR0/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"54c8f0357ec72e80cb79cb53d3c4c8ee3141003d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-beta.1_1637851121052_0.3959780134982074","host":"s3://npm-registry-packages"}},"3.3.0-feature-3bd033-kwf2kdls":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-3bd033-kwf2kdls","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-3bd033-kwf2kdls","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"36f4d3df9a973b3d7144726e0c055ce73276ff80","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-3bd033-kwf2kdls.tgz","fileCount":153,"integrity":"sha512-qqBMjHsqLEi/IBMfW2fV+gx3smT8FbGN94EKWJzmh8Q4m9PhhFGKoo2BP1KN6FCbPWLf76xpqtHI9SRTufYevw==","signatures":[{"sig":"MEUCIQDAVntX5GhCWAHdbV3kjCPJcWbP/L4+CzxmmUvGJFaefwIgCNtZc+ZdmfEepy+eISlW5tK+wu0dQ41wgEJ0ZBY5rsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn6H2CRA9TVsSAnZWagAAbAkP/2b13NvYNvHaL7bTC9Ua\nY9WVQ4/+4JU7u1ypk/JHdC8WpCCx/NMHxid5maeJoZDEc6U2PnHoweMS0vGO\ni3UxGNqXCPQrnkVIEDGOXWSnQWWRtm07vNbzowDDR/khCLVw0Eh0cdPUazM0\nMByGCl/bssvtP5qKWTodWEk6/cpu7L06cr/WXWP+ciAnCmZ4gssVYbzUdcEH\n4UR5G5Kcdw4ue+UufPr/wyAdy0itBQZKEnJXbdLIjVxMohmW5tYELFUN4VHG\n1qCxytWtbwHkZDOINGdx/wuockoaIf7FemEejdbvaulwE2nhapIPwdoxJw76\nPZsEVX6qqfJtefl7OPE3/hDSD/2kWUuKmE3QXaz/QdqcHXLNjpGRha0aNWZs\nTcWbn3GZOZLuF9MMGm/3PNwmHTPxY85iOQND5K9KscVlu/Z44KWrKkyY4GjG\nXFHYx3IqPY6CxXA8TeygQtPZtqj+ppyHqFjPObpHSNV+kS4vWitMGH18Yiru\nMlAQqVBcAYKqNo1MAIZ7mpaYH0AkwDIzM1yTvhfbm8GmjDKPIPGzRa7+VTje\nYSoD44qESlBZ8itQakVVJlf5EiUeLKUlhO4zJnPX3PVAP9cV+pkv7x6ilOy2\nAbGy/Qxt5m6fqdW3YA60Au1LxOAvkKxQJGS2rghnfYPvTrDQ0Ymu31L1gAOD\niYgM\r\n=Lpy9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3bd033dfb785c5cac0082c34477b9c258f159832","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-3bd033-kwf2kdls_1637851638620_0.09815126395435891","host":"s3://npm-registry-packages"}},"3.3.0-feature-f1b686-kwf2m34r":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-f1b686-kwf2m34r","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-f1b686-kwf2m34r","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5f43c362df5c90b4f13a4d68804e12f18ad7bb13","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-f1b686-kwf2m34r.tgz","fileCount":158,"integrity":"sha512-v8s3w2MwK0vfbPJEYn4LocLteuOlRVrG1kysDJLqJGUxhylKfGXFQKZC2GYZUmlUroE0aqgoyamM6mc9fwxkww==","signatures":[{"sig":"MEUCIFRbKrNC/7HkwbsODGWZ91BRW7PsN/gBhyLqtLo8COqSAiEAqLr+8yMDEWHo3s2v+Zq7bgW45j+vt457rzFc4VDqTgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn6JICRA9TVsSAnZWagAAJiMP/020XUPcsZ+Sm0c05JEz\nY1Z0hCKh2Iseaf4j1G/3mb26KDPsu6ONOjW+sTPf9ECt58OXA59IRtI11c6z\nrmLva1vOSxzhYVLUa6Qb8nMBKizk0Wrxnf/Vtz3efb8TMfl1bIp0toFuuu55\nI9agYxheaJJ7KG0ow+FSPJ5s3LHPyOiudqpmrxg4OwW0HHbraEsV+60AzsSo\nQ5DBWsFRTvVdxIN50OLLjajo0o4Ikg7PeHLYj+CglLZbVGlx3yVzMzD/enXE\nBki5rNVgB/dSZT90b3cRiLL876aVHJOe/OepqSxDJqkCmBRBkKy6tKQEOA+w\nF1gDhH9K5Qq1XTidwXqAkmGqz4CNom9JcoCQbSHVlwLjWdfROXjRE0Cf7DH7\nsoSAlUD4lEal7q5GCUPXOjYFUWiEHaFJwDf10sK2eszP4iC1OYiHEnbRnASD\n6OodPWBqueBLmzfhav6HytlSnCGKLhgLv2CnR7wxb+NjbsqPWfZ7/9KFaMWw\n6IJKvQFxxMWznVAvFvpjFS+b8W72/ixRkMs0M7eCV7z+ykASPRF8587KORjv\nEdjcMr+obZPUMZqHjzlMEvR7I4xHf9xWSz9zvoveDk1YpLUvE/EI0fFCtlp+\n/lCHmPxgB+kzH3K9o1tYuoKPDy2qlxzyJlb83qSHU1g9FwF+trfZNhVXogCM\nCSnT\r\n=oUeb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f1b686b4d88693946a0d50a29d92c6dce3f8f3ed","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-f1b686-kwf2m34r_1637851719969_0.47712867613279464","host":"s3://npm-registry-packages"}},"3.3.0-feature-1b798b-kwf2obf6":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-1b798b-kwf2obf6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-1b798b-kwf2obf6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"99fbe267882240b93a0bee55c7db56ba9458ce34","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-1b798b-kwf2obf6.tgz","fileCount":153,"integrity":"sha512-j1qoDd/vOMo8npR7gjAxizcFJogx+/AliZ8YDTTEewoGDGMSVX86PhCsEm0glCfDojQb4hzFH/JJXpv9Tdupxw==","signatures":[{"sig":"MEQCIADAjIcoQwPglnAuLMRKiZzVN9t/qg6OoovDYtP9dMUKAiBgu/RAbCpKd+tLQ4WTatbeUnNTs7lMHk/kNxk+qZIYFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn6KvCRA9TVsSAnZWagAAoiYP/0FcscwOuGngRTZH66Zz\nU1Vj3k2kXTNj5QmiTQinFbN2tbV/vuF/Uk7zuNhTLl+k6zOWNVt+c9avWaXv\nDy49Chs8MJta4qPMWu7mPzYutefuzzrzqZTiQ6osPhM+CW+v+qenWXkgk15K\n9Q9e0rc8oS2Tuq81ePa45au/ejZpthSkEPZJaCzTcd/oJ/xPpRJyyLV6avSl\npht5pT6NSZxGRdmnjPs6MWCTjlCsYXvQ0WDfu56gfWlGRFzoJ0mcW7mmMKTr\nWsXxyRVF9ReXMt6k6tVHURvSiRjfFmQQXHMiWxj1A6vmp5TnnS9IMPwB+ibi\necfXGoT+AwQyUoYLvBZmbxe/4frESuTrFXCwQKagChev0cJvdnjhRJZJvlCD\nQwMcKyffS9GYIwGIblegg0FPdmMo+EOdeVTM1uMAm7F+C/RWvOg8uxJ15m1f\nSHjRKVgnSjS+PRjn2aTfKQ29jHtHWpXX9K0qz7+y2XEF/A0ws6BsWLFR2ifO\n0trXtp/vuLPJXJHj9xb/TsqSt2MDkea3xu85uAWFmSWcdVjb3w7PbOFkFYDC\n0mO+HyRoVT2H54rPVbByTzXtvChPwagmUElqw1rppiKZZDSG2jzK1p3t5i5y\nZeo+idjq7XCkAQGFgJR7SV3sALKSczRdMG4hP6DYS3bbkXli1G9AHap768kM\nKb5W\r\n=sUqg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1b798bbad7de3a11c5a7c15a5ce8633d45c04f4b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-1b798b-kwf2obf6_1637851823543_0.9332533346587897","host":"s3://npm-registry-packages"}},"3.3.0-feature-874cbb-kwg8gnc9":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-874cbb-kwg8gnc9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-874cbb-kwg8gnc9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f856053f3c0ee5638fcca2d1026271aa605dd344","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-874cbb-kwg8gnc9.tgz","fileCount":153,"integrity":"sha512-38gpGN/+sz9uwhRdxAf7V8/CocN5Mi0Gs21zZRKeRV0kTV+MLkTFdJkBPscSW2oZL2EzaSMcw4R35lMvCuaudA==","signatures":[{"sig":"MEQCIBZOTFo2X0X6j9VXvCUmoWrsrmTkddc2c6bgu8kOOLw5AiBKy28KK6xNnGkdqFNE3gsEIYrC6b5aG1Oj1M9ayIFbew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoLTbCRA9TVsSAnZWagAAp+0P/iVPmM6JDYbzFlvu6C3m\nYK9IBqD9qkl9KaChNXTC4wBUWn3XnaZWlH3LwI2yXm0WChIjzkqWDeueUrCp\nufISP74NstmiX0mBkylEqxzbnWSmAQk2BBl9RE557sMVk78RO3dYobMS4C3s\nFy1UBWlV1Cy/nwIGZGvPrj6IrZdm+8tQk06WRCM2Z2f7RJUdkitGKnop7ZKJ\neFjMfEucQBGntsYVyFAsV33QRTItHYprUQds2KsUmvJ/Wh5KjVJapgWV+1Po\nCiFsMT52EBu3kUPJTxIzzPF+KfwLKeNlRIceNbd1P/ZErzMBWyxKblVVR2nC\noT2KR3sVC7kn3KE1EKi8cLMDlKDIbsXC7NU3/UxNjLIJjPRclEG2wG3w4le6\ng1cn1vRbkBvczGsdJ8fT+//QG+/gbZRL17TPuZRBphhJjhX3s0VyLRm2mhpG\nF5J1tJwKXG8DFk1veQVkSEmlLtibQiNPFey/FRrqo3li8glxuW4zwfzqYGd8\nOooTaL96w5H59Cf3c1KxBFrDxcGFWD542lm0zrOo2C1yH5wy0tyEGDNbEwLv\nIQx3g/hlspk4SfxvrP2lN1mfU8i0rDDnhV1k0R21uBB/dOO8DQ4vR0ibcDqp\nKg0Jiwp7J8o+zVWpluek4yEa7rUZd1MNNDhKCkcq3rhy1oEhimu83mR7+djP\nMSOF\r\n=qZTr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"874cbbacda100cf7e12040d51872c5e994873a5f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-874cbb-kwg8gnc9_1637922010833_0.03997734571867029","host":"s3://npm-registry-packages"}},"3.3.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8f27b575576f033e9f3acfdafdd602fb56f04b7e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.3.tgz","fileCount":153,"integrity":"sha512-shMS0zQHvJ/yaBH5fwzP/gpWOMAF8yAYxS5CyfQU2bHoTaRfBF1qVKkaIRrMVenB7gJdFiYnNUW0brKC0AaQ9w==","signatures":[{"sig":"MEUCIQDxZKROPPj2pn6Koo8mnm+sMZaqRCPiMxSi3ukQLKpWrgIgag0zKFYCi13No55Pqnt9X9tkVVHx0JgVS1eR6JHySGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoLaVCRA9TVsSAnZWagAADLkP/0UhENb9tGppVNrLEdDR\nMa1B22rm/tB4Am2Bc1rlKFIBdWsF91HUSiTXiQuF+mQJw90QSTR4sq0VS6bb\n471DyrjvVv5Ql7g1hzDNO5HdPSdRp1luVpRbgmeLYdOKfs2P+Ir9QM20IRZn\nuMaVv7jxASGe/dhaEDviyDnCCPIYdhAE8GsArHjq5wSbWgfHtAguZkwvn8zu\neXE8TvGiz+6GuFao5DVZMOUEWoAWaQzVpOSZPbIiIZ6N9KFkwXzJD0LNXBpS\nXEG7ftxwOlB7WqA/74d07js1btK6/t1TIEVIe90K2A9vWvimTINa5EsxMWMF\n6MkL1nLY4B0qSYgtt6EJ6KjB7ASdSPkkZCM1eLdLxsBm+JYM6wJmntQVE+st\neJ0JQ69NQ3PRQe2HqwJm26ItWsu6Y5mpi9faXcM300QiXYHECccQaJImVzfn\n1r/UkNkzNMf3WArlXGX7tt+Rs9F5VuCAHfJBByRzlzJF2BJNeLRHu6XRZ9if\nUSMWjDa53OQOJ6uJavd1lzSAUClvaly67+Y3QNK1rum3ea/EKz4siHfJ5/pK\nuu9n6jAIyvNcUFP5K6T7fQnblVJ19Z7LVaPC8vTO8bPVLJI4/wv/E24+gGg8\nbyUPjdVY6BpERt4GByhV37eW41hiLr6k/VPUD2mg6zHfUSv2zp+DSJtNMtVo\nzD14\r\n=ca5e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8ff0be786e533ee650183340cbb01e00a84b4337","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.1.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.3_1637922453492_0.5998731794894354","host":"s3://npm-registry-packages"}},"3.3.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a2e4856c48d29d7602cb4f505c5edff4f38a727a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.4.tgz","fileCount":153,"integrity":"sha512-1b3W5hdsJMrHQEWGZWv+QDRx3KbxZNm1b5CDuZFKOdSeEzS4bC/RrFvOw+beFtrr0Q6L0NY8KFOqvMIngc+Mug==","signatures":[{"sig":"MEUCIHC6WubzL1sK1EC4BBlt1lfL+UKQ9T1SKDJsiJXzvpjKAiEAvglRShtT1vxuqYNqQsU5lk/GvGsP0U8QjiJyMWtJLMM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoMRTCRA9TVsSAnZWagAA3vEP/3p+YAl2DoVXQXa8BH/3\nCPVrPeN6VZLymcr5TKMlo4X4dylkW62Jwgu5SwX61ud8QS9GsTNKqawJCOw8\nQ+E5POgqK7Bmya9fiANyJs1Z8ZIRrawDZazoZ2KEW6i4hl8Mtf7Gc4q9tJxp\n8V8bK/zWp1g2va9r67e/5uO8mOcURM2N78uxMDG/Z6OHGT2rxfqz5HSHNJeL\no92rJfQH6g6+pQo8jUh9JB/cpW+AU0hd9JjiFCeHTyB3q+9KmePqWlbVH+Av\ny+fb07EhNmgt004WHoK0y6HaAhjtq7wrYJR47F/fkl4OlDaGQ7aqMYL4fzOF\nnEHULaZQvMMWqOVXqkLoW8lS5zqhQfm8baQ2oEf3ZC3VwKSZi9Ny6qZ+JqkM\nzLRKJInMy/GH8AjqlkFErO98ECCqaUWWfsbXTQakvCrTz8TOmAasQK/uBvMl\n0tugNhKMw5oCDS0SAFb/78baJgHTR6XdrJilVUGQAmrF2d1F7zDSf6oHh0zC\nIJGb1Yi2keUN2yMOlmIOKuTp6elAx8E28tIC1XC3VGkuNOMARLZoHEnQhMht\n7fwPj8Zsj1sNWKII8W9daseW9St5/hauDynOQ9mRdoxB9oSif1Gd1AeFWliI\nFsfk6cjqpDDPzx8NpHoLdbfg4Ofab3Hfe6Ibzk08vCjVizPWWPAsJWGXYDFp\nnKku\r\n=rirY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"18c8e5da0e909e883a68ff81971caa921e8af40e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.4_1637925971099_0.222600282264102","host":"s3://npm-registry-packages"}},"3.3.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bdd5b075c26a09cc44891a2a3ee6042c2312a02a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.5.tgz","fileCount":153,"integrity":"sha512-EyW4TcGcvtljOQJclCclnZqstzv56XQ96s8W1DmQ6IKEMdzGJA3sS1OzVCHz8x1X3OR8QeWW7ql2UtqCLDxe+g==","signatures":[{"sig":"MEYCIQDvHw+ykktJyY+ebjE2DH9V9GAjM3Cm853Z9Hio5PygyAIhAIRs0+ei59RdTlqi9SXTb46G4jrDBhvdA6hUl/00liSL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoMpWCRA9TVsSAnZWagAAPJYP/0xvni6JQsd1UqtmypUC\n4X/Ge8kLvQIqR4iKhuJIhvWhd6p3nNWYx7Le7uW0r7jPEll45Q6OWjLTk6Cv\nnBzOPsnS6DI64E+RSE+nO7GeteuSFrmZfFmvP4VbRecZMeULhJi05Z538zh4\nVANXIe4/29bZ6K1jlWZIxYZmYL6O+JWb2Fyzr7r3KMuILIKiIgVbA2EsETH2\nwdZCokzNhgtSgYlJLeLdlP9Ebq26xt+fEh5hddlqD8SU1B75c0vUh5V2gMAv\nH01Z8OBUYs+CmHMsOhyKxuVps/PlJtsyzgx/IrTjEMHB87NVcB5Vam0akcay\nwECfj8k5EUFBuxOFu7DhXVkR0IIoYc6wjeTXgiCO2tGIjypT0VFDmBL14ojV\nDVf/wGcXgcdc0cw7un0Z93WAVRmpaNgT7jSudjZ1i7ToitQdPmALVlnpnFcz\nLsGv7l9TXfMMn5yMRq04Jc0Ao9gZaaZeT1VAtyY3Iddm5Jk6zJO4BJ+2T1k6\nRVQpDa7VA6P5AViHM1Oe803YY1uRn47VKGGOON6mJw7TRAOwRhaYD/OtAYMp\nQgHd8o4QN7EyPn+xo6NgRhOEeJKcFCQ3cVNRqlxaf+grb8geNXM008obbJND\nczW5NwTtPyQ14QyBu5ev6Fnm7deIkXe5yj4sOhb3xQdonQvF9FWHiF2dGbwn\nPzg7\r\n=sZcT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"eca38aca296edcd5db2cbf528c08cca7c9e178a5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.5_1637927509819_0.6785608805509264","host":"s3://npm-registry-packages"}},"3.3.0-feature-3ce44d-kwgidjxb":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-3ce44d-kwgidjxb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-3ce44d-kwgidjxb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9655078c3c5f104847a892be5db0515153fd2438","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-3ce44d-kwgidjxb.tgz","fileCount":153,"integrity":"sha512-H8rTBfLnG2l+TE6/CnJzJMItfTZzqbvfa17coederGlIEw82EJ37c/Q/xUzGl27h+cw14sUNL40XGFTxIxDVsw==","signatures":[{"sig":"MEUCIQCUw9rAx0Vdm9QhjdtDw3FlTOW5m2Agp0O98hEwN+6OwgIgXINVZLmEA8aD6guTfFyKPh7F9gmrofgYzwZVeL4UgxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoPXoCRA9TVsSAnZWagAAKO4QAKCyjDbSRSYTyOfQtjyy\nWB5Ps8Yx8YA+Rlwyf7dLVpHL9gjjqOccqma45L5S5mhV/1IiLysziUbZtHls\n1YmuKCHr+mCdQ0N61BS+1+5rOrv0Jgd8HpTdN+kJKRIED9IKTASqim647H94\nzF5/8fyudpUbqgz9qOX+cZmhnh9NoOMUwzkWBbirOLSCSPf6fL/3DGUsgmTD\nBXyY3QKPfhafimJXd/BYZ6NnKjKJILCrfz3A3f+lqAYSohfcn48itiq5lNmp\n/uDvVYvcd9sNz8eNDvVGh8dcLVo63yCJhknjPkVimC/wW+SxnL867c18DaYZ\ny8HwEwPrgCMjTuvAo7N8ASlOK/WfMhUKgY+hUh764uFIBaMw2HCl08jsg3Ur\nF7y5WNZ6BxE6ILpFCqE12Ow3Ba3D0HwIiZ9gC9fHxJcx9/XJABzJpzkiGqjS\n6QCh3+Cc3+likqtOmKWzQ1xbkTwnyesFlJs/yzLlvO1jfoicz6PXPlOOmwiE\nyV3B7bJKd63PKkhKbQMucD+Omp2ngGZrqvrP+5+ZiKJ/O0W9eGL/8yngpa3C\nvamtHBRQsZ3T1Y6+u59hsPYGE6KeNxWu6JWo7DjI5L1NiW/yS30xl7zNhQZX\nDSYfFq05UaAI2uACPqd3mNp/jAzaSzj8dTHrHjZRyLHNYF5Cc9etcUS+DHaP\nLy0x\r\n=jgzP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3ce44d194ae5bfe0a0fe685c909ad50c9915f091","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-3ce44d-kwgidjxb_1637938664511_0.2655730916078489","host":"s3://npm-registry-packages"}},"3.3.0-feature-7dbe42-kwgig92l":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-7dbe42-kwgig92l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-7dbe42-kwgig92l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9abb85065b2a74dca6868b108216de911216466f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-7dbe42-kwgig92l.tgz","fileCount":158,"integrity":"sha512-caguI14RCjAvIIr6MlQhMZx4IC3RlGZAIpIy0o22ZLq8Q9s0PqhlDtGgcC/ThctOpUk9z+VJSTKdsa2Y+tcVpQ==","signatures":[{"sig":"MEYCIQC3DGQxWXWvyGEcq64XOQX1ifqwflFAN64ymXjQA+jBNgIhAPuLLZFv1tCkVlI0qRkEtVm4rFSpfww7wzlYl3SM9Zxj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":488324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoPZpCRA9TVsSAnZWagAAxk8P/3DG6IGdE+dofKMTZVO3\nx+JGuzcFxFywRwTWX2dtRCVdHru1whZje6XlLDPuWyojwf+ghF1R8r0VpZsv\ngDIe46MltWMQ5IJA2x02J2mZRU9rHDwEb+CEEoaW7UdZ936VbsRKko9QWBpR\n1ciilMrISD4We2+ypoeS7TXCRlRuT9LpjwpQfvbdguoIr98oXztLtcqZrNBb\n7kU9LpwTtXKL71qdU6NINWaDE0vDT+faL0geiOIsZjjTyXHaanRYgT8KTWnK\nQHxQFLyyjE/ntCknzO/7ekiRPAvBFXLZTR6kU5VAgVRpyoUFY9tRvmnOI4uJ\nXYAyOTFlgd52MmdW5DH/JG2bv4i1VxbCAZTty5z0BS2Xdagp3yF7nz0xEYaz\nRSS4/KkCEHpzeO+zYXNc33dbSoRgbZ5R2lU7CHTW9cRByOVm5Axd9plBZ+9J\n1/l2hfm/3HZhI6ebbVZ0HDWyZNg5SwSP+UCNVa5WXoVukK1Q7Qh4uVCOw/ZJ\nlG6UUAiFfJJG3cYePmMxKLfCG3tRQwitENlzEKh0hxbAkPg1mDkAgM9EKfVo\nbedXJbZKbI+esprC+otgKV9pSddisQE04eS00DzX3m0vH75xqvF2HA7S8FE5\nLbJiLvdbXh7kdOzohWWzKuq7EPME4KOSGwyfMQ8S2q9KdwE6Tveom/KFfVUg\n7kxS\r\n=6kLW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7dbe42f5091c498f2e87f3d8067ff7df4e76c027","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~business_rule_task_poc"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-7dbe42-kwgig92l_1637938792855_0.7197508664711496","host":"s3://npm-registry-packages"}},"3.3.0-feature-56a746-kwgincrn":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-56a746-kwgincrn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-56a746-kwgincrn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5f0f243e64492bf5d596b3b95025910b2892452a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-56a746-kwgincrn.tgz","fileCount":153,"integrity":"sha512-KmqsSyJRfC7/P2UO5fOaOlqYYi1DPleH1V5P8ddUwUJnXXNofxZDUXDXg/7aVRjV9mT8KXC9ZB2JVC+2RS4zqA==","signatures":[{"sig":"MEYCIQDe8ynm3WTHtPQWtaXhrvPRq0rKl++fplom7pboa7+u+wIhAN417LOpHwbQfniRBfY+0wQCiy1EqVHkGOF97T7pFFey","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoPexCRA9TVsSAnZWagAAV40P/RE/cI2mISLJGx0XqfM4\nsieOjJyxopX1Bn+uRjPeEePqswwZjgZTlP/uxoICj4RYVF/EE+CeOtQSgmMQ\nioeHkscW3aTtsqmKHRCZGABPLulZF2+Tvl370oHnGfCEE9ZT2Z2LsvmLfXHm\n/ul6lmgXyHnwCaiViEIyXU1YALnOgqHtxvFJw/qOmkaNXaOx/K/P0dfsVwbb\nQOVvx5q/lqOWc1tYYv5owxb6ycI7JVB3pn2Na9sMkZcVH0wAkFqdnt0pvCQu\noSdyVzT+mZZqUwuULznLVQqqbvs5r0dD8w/wqpRQhcB4EcOCfXjrIsxfQMEO\nRS/kr6iyX7NarX80DfqLnPHrFu7wILWnlk3+9SWwHa/UPW6uC6RtcNICsoO3\n+BmiWinnhV67gR7WFsQ2gLkG5d+k9UF2i9x2kawsOQjUx5VE4VCwQunLJAdh\nrdLFwqMqsAm0GoUGoCcYv2ircmw48/ejwV6XemUhfeljYeH8IU/RRnzU9uGS\n0TUfkny0Me6zLAjnEWtvJ0PKah6gGInkm4UOgHsaXMynA9VRNVAO+n9BXU6g\nEGJJsDx/pVYThuXvKLXKKNo702VfrnTxCjLH3tp0k588DQ31vBSBAhtR3iut\nhNILYwaiCh+p6F64I1CeAARLw1Tx7TV5lxK+OqurEaLYlhxIa+Dmi3RR9gL0\npThy\r\n=6mdK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"56a74664c6726967bd4d2894ef2785189342d99a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-56a746-kwgincrn_1637939121663_0.33812317501471534","host":"s3://npm-registry-packages"}},"3.3.0-feature-d4ce1c-kwko9tud":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-d4ce1c-kwko9tud","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-d4ce1c-kwko9tud","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"73354a1f6fcb8d67860e59ce111476aaefd4240b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-d4ce1c-kwko9tud.tgz","fileCount":153,"integrity":"sha512-6Y0nCxHiDpfxycrbjlvV7KeL1E+ZlAgjnulyfLpKxeCxGIwftOXHcxRCpSe7mDzwhxdNWKCGE+hllDYnjp/tbQ==","signatures":[{"sig":"MEQCIGq16wmKbrnQHSgRnwxpp51H5Pj1T3VmKaesCL2ivT7+AiAMaAPYywEpJFgceZGiy0bGhT0+P+DekNB5QupnC/AO3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpM1jCRA9TVsSAnZWagAAUnoP/AhCY7x3MvjUGFJGljhj\nFQMod44sl8+mmHvwVP73M8EwH+KLYnbPilXO9oP5s+Fc94S9wy5NARuaD34o\ndntv7u6yoYMHK+xMMcZABXLFjT9+gKYH8UV5xVd+1t6Q2jSqmNf6VTzoyMH8\nAUYOObmwZterypNqsAEcIitgrzd1u7fy1q41T+qqW2XJgq6e0uHPKlaFDDln\nuaTMAIJSA14lQh89tcggxrAhD/E0yUIWl4e6cYhoOUtHeXejHxlmyqH5aXlT\n9SGDMppMS5WhJqSuCFrLTR+nZS3dzJjtiVLSntokt0g44KrgJCtjLOfYkS14\nLzn5cHC3sORG+EbwJ5hDrW2KixxPOha8w7BthWnU7+O98X2+eXREbl8a4dnI\nOTih/BJDoi2N4pM48FAoOShMnIT1UMJaCe1uvDSphczb7qjlMpZhQNZ1Ic7x\nqYh12hw1LOiUTUJUnKKXRMBB+Yf7EvNHuWD/VMSyegE0dxCfAxjGRewOzBko\nuw+nnKhwWEqrlWOmZuka5rR4F70bef5AMyuB8Ek11Wv1mkCFw2DP8rjBFBjb\nfbWSqxN6n46WT4pVap0uGknUhfbvK7Oa86rMCOUJ/FvBHY9yUz9M2b8DDjji\nmizfLOkxhWhEHnr6RrWK0ie1aEjv0frqHUIIVvWjvfDmy5Lp8VMRBfuyBCnM\nZWPQ\r\n=QJIp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d4ce1c235a65738b8ab1300b68e3e926c8f6dd55","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~custom_correlation_id_with_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-d4ce1c-kwko9tud_1638190435597_0.3386997805293068","host":"s3://npm-registry-packages"}},"3.3.0-feature-f6d9cf-kwkph9jc":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-f6d9cf-kwkph9jc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-f6d9cf-kwkph9jc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fd9a5446c28bdf5238c1cba88d4364a4a78c592b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-f6d9cf-kwkph9jc.tgz","fileCount":153,"integrity":"sha512-DcGaxhuirrKeF47TLUlbUZZCabhCb2FFyvqsXx9U9tJZV2TdwgfPbigJ+QE56JKlso+uBvY6Mxlua0Ar6nOLoA==","signatures":[{"sig":"MEYCIQDgGhiLb7oy2lIcGedcRrCFskokMuNFB/8KRUG5kLcFswIhAKBtineVKiBtJvWtBHleE7dWdvWzMKDKYQ/5/ENNS8l+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpNVKCRA9TVsSAnZWagAA97wP+gKkd50rNdYff46LYUuv\nx3cQcVbLIEo+Rj7L/M51VosQcSd5VVb9/VN/LfpyKlkwNkg5gXRy4NEkgjVQ\nXMXq24qt9yyJV/O0JDU/RTkao233k+erlrsI6evWBlWSDNRVDjt1YS0se592\nb3q9rl9fwQIXE5xiu8wjNCSi6NaOOsuV0IRLwATpqbRb/uz+6jTs1jlQkmKQ\nsJHB12tx+zieNPNocxa/mEzkxoleVCgC/Ow2qqcDBw24ZsVggUkWFm1q/8XG\nPsGkm1YbyKDKYNoRXfDpe6UexTy2imPU6YP0r9zSgdjVFYlPDuBbMpmP52zb\nuqlTRuzjWFV2dSMTswYbA1aN8I3aUB+gs/Odx1g54ImAkLjLBiuFWJjMnA47\nDF3/KhXiOv0Jy1pmSs+xpCofUcglQJxaAwk30tYrHLYqPvpaHxHzphkyDiE4\ncREn1HEPvhMjlaLSiCaZ6OvGaN6XN0ovr7yT7wtnIHcYOMhiglDz9MPO9l/U\nNAv1SmW93c2Cy9W0g0yVTqdaLPapVmuWlelWJMazgYkRcsLJ218PYVcipQFJ\nHEy9nZJlu3g9v+zJs3rOuryykb4YPVSLhVjfA9X0848JFrIBcq0JgDGmDbn1\nKrELNM0HPSNJvHeR4JXRgduOX1bJ8zOwe/wpleX26vamFuHW2sgTntLDfJcC\nkoja\r\n=Kg5O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f6d9cfd87813f58dcd44aaa480ecca8daa85bd83","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~custom_correlation_id_with_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-f6d9cf-kwkph9jc_1638192458332_0.84976501196558","host":"s3://npm-registry-packages"}},"3.3.0-feature-0605c9-kwlurnnn":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-0605c9-kwlurnnn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-0605c9-kwlurnnn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"530617cf1912f00dc7119fad59d909886b667dd9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-0605c9-kwlurnnn.tgz","fileCount":153,"integrity":"sha512-3JkDBIgnVHiWuoEFoAgxOn5DAuJadSFUMzfxhNATItXC9JYDnr9JDuTH6wb6VU7YecDaFo3N+p9z6mrNhQv+KA==","signatures":[{"sig":"MEUCIQD2JxjQ/QpQFnn4mykK5z59dUKYc5PucZhDr8lCfeHXxgIgChlApuJd6A7WpKaW69Pp6K511CHSHbyvIBPOXNv51Ec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpeQuCRA9TVsSAnZWagAAycsP/jxwvOIu57fQr/N/mXC0\nZnysNeP9WzwOLD61aswIY1sRmGey2+k5dgU/EEa37P52JgZnaLJdqfcanbJI\nRUo1Z0xDvxiKVU55it75+snTAEtdP7xDCNwi4nmdOWRrvbIevD5q55E4ovLU\nCMVzGoMpqqUvMwPaaGlEjhSEFJf+rAGPbOHZH4FroDY070HG3cV4KJdjevYS\nQMgfArVEOai8bSDBTORcuMOXbdQ2pSTjHHg4FUziYSfyI0we+OH1c3tkr7Y0\n3DFB3qlTqvNn2qRfdcwn7T1dHyo65WdBtjAmwpSQoPft4/BrEUsfMEA9vvcT\nFU4+JjwABti5aE39Ynt3mEk0jaQupGTL6eHlWRLNFUzeNns0QWHe4cnpXDRg\nqDgQG09pxLZMAWB0XuSyo8kk9niGKc0bSuJRzZUmgzuKLVkYqJfH9ZcwY2c/\nXRfRgw5nB+h9QfeB5+zyqxJqP5SB4U1S7v/7q0n6jUwO3GwVGaLn4ts7NDug\nCKV4Uga7MZfCjpC4XwujciBNiTDBWiJb/393NCpcBF4CC+TXEXDZ8FqhyKt3\nh9BaY1udgxP8HKIa1LW2n4Rbtz7zTehd0HZtlSo0Zc0GhApoxzHMzYkTB5/U\n5U6O3BVA3B/tBW7VkQ9VsNV7GpnlGSe196XFp8YvmZoKSCgBA757HOboLUtX\nl9oe\r\n=yHwd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0605c955bb29e0353fe60a256ebbf1cb336fde48","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-0605c9-kwlurnnn_1638261806733_0.05206743697408256","host":"s3://npm-registry-packages"}},"3.3.0-feature-725aa5-kwm2sx3z":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-725aa5-kwm2sx3z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-725aa5-kwm2sx3z","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"86dd47e235c8f6fe72574ceb04c587b8717a0262","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-725aa5-kwm2sx3z.tgz","fileCount":153,"integrity":"sha512-17/KFONskjHs9qSbMi2bFaKUR0RVFCGmz0kJ5tx8L7WRJ3kDaxT9Ysxi+dWyVASZQZHplFwhBc7KPs/d35HIFg==","signatures":[{"sig":"MEUCICVd07z1c9BGtXsjRPpE2bXY+0yiuWqc3/SAMkkq63ZjAiEAsfL3Q23bclXXvSJ0raD8QzbGoKeObqJWoZCsCi4zLCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhphjuCRA9TVsSAnZWagAA5T0P/jtoSZco8hH453mk2FQ9\nr8gSlrNpnH0oxOyI/coL4h7heGUtOuk77qCesM49w8t/V7eq6sQmzTiZv44/\nIujN5Pm4Xy0icrKUS6FIaNlVP2LgZRMl0JvnIzTuvg+DvFWTtKuzuB9JmQh7\nsJvFKU0jjWo6G4aATqyUtaIYYCT0TCyXptdlUozkOivJytaTF4Dow2m2goaT\nnKMcKKfE5DBfMIibRTmhJ0iHPxv1jr7Y1e3sgyIndzKVOWbDkpju4yAnkzKe\nHZCGpzRZGgB5iDbqfX16Aqx07RzxSXJW11cHbVL4s2G/HjUDZ5ZD9wBiMmHg\nLrzvQZFoRfJdDoaC9s2NXZbIlL1rwwebcFfe9BP5ueYXNojhhtrqh5IyRESq\ngcLDMt4AAX0KS7mFL+xZCMqBFdUy1jiud6Dr8u4LAdkFXnxQqZlXxlEBZtcy\n5fU/YquajSb5vkxZWIzJb3tsQSVb2suGJCJWqYH6DjIknLbS41O6Y6gkFI9n\nGuvNzoRJz2gosMuJBOfpfjKbc7BH2hEP6q8LixFb1Soa2C47TdhlxVHZyL1l\nupAOQUNZ7rUtFLmh4zN7EOunr6qTWIslZySCFOfFRkYpz6M7pfyIXGfF3Waw\nu9Gl9PjdSMjZyW8+kOLPwobcDBtHBAToXyw2e0A1x/T78VCAopR4MCxnP3CD\n/xPm\r\n=YBTA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"725aa58262975f729b01e1c8d995d59dd7124e21","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-725aa5-kwm2sx3z_1638275310140_0.2534492525427985","host":"s3://npm-registry-packages"}},"3.3.0-feature-a0ea5f-kwm7uug2":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-a0ea5f-kwm7uug2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-a0ea5f-kwm7uug2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d129432d69eb164e20a09a742a4f07d0099743c7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-a0ea5f-kwm7uug2.tgz","fileCount":153,"integrity":"sha512-qQDFVTODI4aa5ZHNznIkIuEL5sqmq3JmVqO6U3N6Jx3tVVK4wCg68WL78Ixvr/WHJEHz1/5NiX1lLWtK1ORMgA==","signatures":[{"sig":"MEQCIB/r8rBXbWU5E65QFRJCdBbBfuRE4XRKAWj8+uwYRJZ6AiAi1Dha+ui1hbW/YCQdi9Ea7fRHE8DT4D+YlAvaic/o8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpjoRCRA9TVsSAnZWagAAFlwP+gPBpDaf6XnDHWFkC1rb\npeDcNQT/4bkmedh3zZljPF9IU1HrjTRrhgl0DDczNyY4g+xzh1MQdQDx78wg\nnNT2Jvzpp/s/iSzyhMo7zxZatIrfjHYW1MJrnTZnoN3MDhVaOcyzD4w5inDT\n4XAIgWczsw3c3wmnM87NXLHhgs4l3qkIaucVOYkGTnDG24LzUpJvB6bgqyJV\nbqwquXqFSI+omWqNhRkWlYll3rRImtijg6GZlXytuyQq+oazGgXIw0QK3Jc3\nWjmihQ0ZVziGthJQ6p9aoxP7O13ijNdITXglSL9YyIxWGJi/PhG5zMPCgYfZ\ngm2KdLTM0Wu6KhSmRsmu0SNSIwHmDTvcKqHtOTksXszXLxNDkkXcbqV+FLtd\njUCj1pnf8EnDSii0uyv9e/j4QMEi7Mv4UccJoC1/3k+M+KG/QgxoOQRFa3CG\ncXNjMQVeByT8wZtbZrPmZEH13JjEoOJT6VN+uHm++aXPzo1jDPTnOKJwmLvC\nt3E9t8KcvrJuQCUDrn2bViEdDX234to2giICwGlXyMwDmp4U03ejHHzViIdw\nZJBBnYcDVzVNq79zOirUK/SnUpwPXHvfPM5g03aK3kW298SoR9to1lROOOo3\n1/KALgTUMClD71va3131YYMZswgCC0M/nJ6JdHsndEMiz6wtP90pSHRWh6/y\nTQ9s\r\n=vROn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a0ea5fa26febf6931a33476995a8c1397265247b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-a0ea5f-kwm7uug2_1638283793080_0.45663015939552554","host":"s3://npm-registry-packages"}},"3.3.0-feature-9cdb35-kwn77e4h":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-9cdb35-kwn77e4h","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-9cdb35-kwn77e4h","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"80088bb30c0d10b528cf4ead9f9bb4651144b05d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-9cdb35-kwn77e4h.tgz","fileCount":153,"integrity":"sha512-+hJX4A0ZfbXOpy81OU038OG/DpoGYPxRkWOZHvoeD74hoUBA3KkR7O1HzNzCXAfw8t3sJuqq8mFV+NH68fdUZg==","signatures":[{"sig":"MEYCIQC38+gQpQbDLu5MOtuQakGs4GNcJzKnc6ejM9MEYGKUFwIhAL1+tp+1EMOpYF6F09C+9zXtiBPvNXa3VfsgQJL/68jN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpyH/CRA9TVsSAnZWagAAnWYP/1K1rMN7kzJGqWzAppgm\nO+g6UCXvTp+SZhoIQt/fDiflvcoGtUqoQTk60pNIBi/7l5yTupllG6l43Aa8\nO70kjzsbxBKW95FMx4u3ArgICVFaFxpCITI49YkqzGfXCtX7tf9GMJ17tRE1\n2OE1aubtO4hbnlgMjoebUyzEnM9l3HSdzsPqc17XyX+VrMIPJ+iTmPoXem1B\nDcuDJD87zjZKxCLFqoYJMnzqQqmXNrRwc4gTsnwqzPLvTx13gHwIBOtn6K0M\nbL8OkRR/kLpLLUzgNdtcp3+xHh7StRsaxZV9KJQ2uBYqvAh4WEy7oM38B8rd\nnHPVdMue5v67LbXGsjd90ut8IkSQkikftADMYvW9gj6cDHCHtvltwaICYJ1l\noNDsEHxPKJNaTJJMRKy2cksKG2JFFbV+zClcTLUpzAr1Kcyqin8787Md+TfQ\nuV3wWzy3BnrtkWTCYcJbgtnArvo5d4I9ZrjDvRgesJesypPJ69/53wruUxs1\na4a/J22SEgqOA4LRxcGWrf2eESn6beLikqSnEAJmuw5ROxuqfwIlF5LX59Np\nV45EJEzjXv6+hh7YkgYRGZqURouuIMuAmYRecxkERJ2b0+lXe1tCwJMkuu7J\nhDVKFGCMalYU2w6VvVNi3jReO18CMfAISV30z+h2XesHK/Yh3q2WmxqClvHR\nL7Q8\r\n=uprb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9cdb35deda3c15076754bb0f24438e3c1369d6c4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-9cdb35-kwn77e4h_1638343167005_0.6932255054522873","host":"s3://npm-registry-packages"}},"3.3.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d35d47a113f392d7d18129b5e5e69fccded30914","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.6.tgz","fileCount":153,"integrity":"sha512-LQfYgptT0yBiyIUFoamsfDPMIRAvi4szYU/wl3+siBB/xdWsfocHylneWM1r/YqoHM+nM5BZ5gfHq9aMY7WxRw==","signatures":[{"sig":"MEQCIDty4A5dPrVca5hGb8x0Urnsy/B5s1tS1Hwe5AMcVFLoAiAnAW3UgchA8wt0nQQMmW5miiAAsz3t+DmVyM3E10XcAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpzKsCRA9TVsSAnZWagAA1tMP/3Cskb9t9eihcEwtHNgb\nNKVmMAzMCi9XMeMePVsZFfS7G7XPSr1yBdS/M9Bakj5p60F3RFgBc66/vnY7\nKCRNCZpkOrnq/0TPuseDGmWRaIpAlcKEm629oJFoQV7Lwb5jJmAe9C/SwEEK\ntPNxsiKKUhTc7wAXO1pL4RSdeEC3HKHjtHN4GQceK+9bQ3PdigBZGMK/MI1r\nYGoXbmCzflBQc3b8O7nYaVNLdpL5QhjzeVvyPvOpifoFXG3lZtCclFGT7DPH\nNku3Bf+V9x0U9zY/zpVc1hsnsItzF0YNypoohUDqpvSP9yCfbG95qJp8X0uL\nPbm3e6tln360dsblNkzuPc/Lcm7dLTUK7sp61ulZXQ8ZcnOrkRLZaFyuCiRL\nhj9gAtNFyAXGGd4aXz4/t6P4qmy4HBzDcmVhgp34QubolZrsoPXJPXxXgtNE\n0OREdTWkVHW7DypIJjh23cUy2/zZPqukIfJDP1zHXF9Te4oi+TkTt1NRLaU1\nc2E0wOoaCxln6QFvD6x2gNePcvNi/MGnDlLlWoKlTFoMQfJsRT4ruzLOTAC+\n3LLOHFA4WBxgY5jIj32+v8N/AnN6+ZbSmkR8S2uXUam790ZdPPGBL6c9g/vi\nZio9kWIWBox4goTrHl9SdxD7v5Xx3XD7zjfmjUpz8S3NNcMkemS+IU5Yvx6V\n2A/T\r\n=q22+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5003426f3835db9e91880ff7f72d294701e0a175","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.6_1638347436087_0.5737872126289736","host":"s3://npm-registry-packages"}},"3.3.0-feature-ad40e7-kwnjgttt":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-ad40e7-kwnjgttt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-ad40e7-kwnjgttt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"560106ad6a8599f901361b3132db123d0698779f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-ad40e7-kwnjgttt.tgz","fileCount":153,"integrity":"sha512-qZASx2GbWqLuaJ6wqtFa3WAzhbJ8LhdM4FUwPy0+LqT7lVwaM9c9SBlhYyQVieV65/Wxr75TgtuKa4AaWsAn1g==","signatures":[{"sig":"MEUCIQCh85qbIe+fAyGhqXvm403+a5wKb2rCkN8N145cXygD3wIgMB8sy/lNezbY5Xl775nCSBMW/4jbiTr4SORfk8Jghns=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp3JzCRA9TVsSAnZWagAAnacP/i9yI1s1k12nRyBqVW8P\nQi+uxu1n50W1vET0gZhDSKbqyKgxlewahtrAmIMNBq790NbQeR3NK3+D07aq\n9fzLi7TN0jmKUk4WV06XyTmdriazJXh7Syfr3dYVQmiqRy5YAKoE1Oy7QK4A\nq/NWdkKXEqjU/0pKwsqwNVHP3HCWi7PGqmLnUtDIW/5rTYaZmuOxmOwBpvZv\nJVwWRjQ+TuhlbuoDHdOW/3SFO1/mpXZaqGk9cqy78+ls/o5aQkFtz1jNk53o\n1Sxub1C0bUpRz7tW8xAcJ1ivtwtOLiFo9B/yWANZQ5qVO+HnDSL+YAJszY7F\nPnOtWLnVSSzbq9Dg68IGysQHF0vgnpi7YsAe+rkqvnCdn5ZFwG6RBFShty//\n0qosBHFJg6zeNuSqutMPNPs9Ks9CwcLMDgSPPxXF+jrWi0rGuasmdPcQjBT2\nJMBh+2WEj00e9EetzxdbZHU54htsStU5KCA5WbeysJFyo48EZZQ3fXXeAhVT\nqm1sibO+nQ2Htenj5lxdxvuXbGI/LkFUYu8as7+sbrcR8hq5uk2vaJ7imWpE\nRFNhi6tKVP3oqEuhGm5QCo+jLVu3Akp4CY3Qa5kuyq+XF24tFF08kDnUSPkq\niS4T0nfIhwKcP/STSoO0AkgS6ZdbFwB1yjQaHXWRdhsbf9IRRz5S60lE7BBQ\nVIjN\r\n=vrDC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ad40e7a077cdec785c31fb76aeb506a6cd491453","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~custom_correlation_id_with_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-ad40e7-kwnjgttt_1638363763491_0.4363105153602682","host":"s3://npm-registry-packages"}},"3.3.0-feature-202876-kwnkel3h":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-202876-kwnkel3h","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-202876-kwnkel3h","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"edeaf485b2b211226e2ea51390a40670a885d708","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-202876-kwnkel3h.tgz","fileCount":153,"integrity":"sha512-BifgrnO/iyqnGshw3x7+aZBCuMvv44et/O6pVYOPpvUmgjQtnqVyeLMWTNAAFFRQzW7c32MUb7o3lQq4P475qQ==","signatures":[{"sig":"MEUCIGunpsNZA3LznqaRCoaqfP1CLUyql6FhqNO3zRpxvicSAiEA0W2De0l1SHa/MGe76aNMqgRgsUVLhuJJhi7Am71sCdE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp3iYCRA9TVsSAnZWagAAkDMP/1oDd9lGvtzyzyjLdEkr\npqyPNf5b07uhR5XErxr9rj6+wvdSktfJUTqrpMsZkmtVEYcUndJqnocDf73T\nyVipPmNDrwM3BGhGuw0WWusIUzRaKpNrfqG57Nvfeasv6DX3km5PeJWU6YM1\nLwZqt6z94UmH3D54dSZq0aOmGK+mIeMAi1Bj2CROVukm36dmvLuBwCeXDFWC\nGXljI+/ts594zf4+gx5IDSONIqjOs2gk+skwiiBYtSmmeVfddSCp8qQmfM/n\nT4fi9ria9s8dcMf/WxtR6Av9b0Li2oYnKfW6S8uzOYN3ktin84qr0e4hoAXR\nUikt/DZlNMndir7RrpATpIa3wYQPOgyNbR4q9tiZL+XocF67dDC69r+1yYxL\nUuJ9kRpTDzeqTaK76ldGLswXe/+kmqbht5UjWov8leOCn00JEA5LowHIkrwC\nHQjsFqa2t/9J+7jSZ5LGJfy5+GKRY1cibf14+w1RXao3dzKI/uXzpz6hXeU2\nyjmfDeoOIeXl0Pj+d7fJLBkYkXvH1MPbtyJCqEmZT+9HlTCkLsTQfi+xztkI\nObUzQxF/uiXcaF89eL16O8tISQIChJ5GLTqQ34sLk4t38ETvsZAYSfDt1JP/\n3hLsDXcNBTO5QhUnChB2v/ZTKNcZjt08o1dbf4lOn50jVMKf+fHvXwnO2xic\nVF+e\r\n=t+rA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"20287687c807a0686e2396bcd24fec75a7103e81","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~fetch_and_lock_for_multiple_topics_simultaneously"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-202876-kwnkel3h_1638365336488_0.9809891096970313","host":"s3://npm-registry-packages"}},"3.3.0-feature-880267-kwnmbacy":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-880267-kwnmbacy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-880267-kwnmbacy","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d1b0e9f22281f52d26032401969d4d304eb5af7a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-880267-kwnmbacy.tgz","fileCount":153,"integrity":"sha512-NO+wjTQigpRvI99k8uGS4Ry+6CR/LLEPep91atCUPg4i5V5ZxysnvjfXt3Me+PwnXbzer02B3qlNJCor9ihsmQ==","signatures":[{"sig":"MEYCIQDd/3g3ic3EV5yToC09CeVS0plxzaGb9+HYNwmixWhDnwIhANaZIn4ymrFK+yfBgOyXOLk6peOJGy70GPKFY802PuXv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp4UZCRA9TVsSAnZWagAARhcP/0hXEAGjCHt1Lh0C6rsm\nqKC5VDp51bMW52cIesdBAGgvhc/VRaAf9YJ4YVe11YD2Z28ecO0il2DPUn16\nHvmH+aXqTyFhLzaNWMD3JfT1AdvdgiGhM9RbSCt1RCKOl5F4WT28FBrDW48v\nIyUz9U3zLxAckRjooBJkZ/q9A6fCygen2/Ra3v16XNpGNFjifVvhC7rmauUS\nNhPx0YmlDS3eZSY9V8E1ORmRNVnZKCyxnpWet7hFKjvp7JTmEawvC4FhZbiv\n+uXh0Elk20IEQ6V/8gzWlON2xdjr1419whYwM3E+T4P930uPt5VcIuWB29YZ\nnIorGDHAv6cGhIX/kTKS996EbQd3/JhE/0B8r2dVyTuJAek9VaKgSHuLE0GN\nbQGX0Z56AmbJ5gd4zckrMPCCDm6nc712KVPKvNXlVaOvYfs04L1SG53ch8F+\nmuOMPprRhyYD2Q0bIuKZS/duaaQ5F8lecnhgMWK+fDw8dza/przPSCmi3D1U\nkNQUJdVxUYXIIc3EEsp2VjXxQCK1z9AnBKovZSytCjmdhDuv5Hh4H4Dcs9Xn\nETil9p3QCmeOZXk92KofTXus5/yXQgQHuzHVH1fhizGwu4yWjqog8euK1R4z\n1lojHrCNIVyclf4fHfDsEmwWflxCns8mEwPWb/hl6Bid4F+vl/U06mpU7CvD\nzFSu\r\n=6RLu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8802675f49217dfb0ef1417f3900e3b4cba76f5e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-880267-kwnmbacy_1638368537059_0.5477007903826578","host":"s3://npm-registry-packages"}},"3.3.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1ad95d41893658f9ed613e4d23985893336cd8f4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.7.tgz","fileCount":153,"integrity":"sha512-IRUMlST6JehmrYLDyEbqIpRHwjddl4SmeZvqIyPN+q/+H4ZqGLkzpe0UolfWNUXYN9fOiYzrinoebvSTfZwepg==","signatures":[{"sig":"MEUCICigaiBuknkXnGyXQEUNZ+zaiDGcGRP52rxAvZdm5M6UAiEAxUax22Jv+F1hGn1c++l2HXBWxoemCYw27ZKFmismaHM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp4XTCRA9TVsSAnZWagAAmcYQAI8mSK6DOOfTecgB3OKP\n8teLNMLs4lTJ2mvmzjB6guyEDmyQUO/A5niuce3b7NVzk1woBqo+SZ1xbcML\n8sQrYrDhFdHpwlRdZjnoxA+Sa/ENBuN+ZSSDnsH7lrBT7iu68SRPyPlnSzmR\nW7mh0C11u9O3N855R6y6Qg0nqPWsIoeyxXpgTQDMpOD5Ffmr30GS9sITl7Ye\n7jozdjG0H/9Urtll4IEV37sDhla6bsP71ECb475hDktYpf/wMttLuepcdhlC\n72ERsuuvOfM7RASOcdYAO8Nt+H/wLpTL2AfRDt7HUQMi4PYiopW1E/FKGgbY\n4wZMw7wch1YszUycBsVvyH4CgNVXCWMQCCbzt0p005Ef/h5+t/a+UJw+kVXC\ntso9wEh74/vbfUsssHiGhD4iUSSxObKFQ/zmkqH8+tA1sAJu1sxvtT2hd0Fo\nEn/NO9hZvCDypKux/YjdV3K4nSrfJB43FdDevQwBPQzS5vATKFPYUyCH4x7Y\nZ572FVH6zV70B57hh6znwsNl2pTqpzqik6Qn/40pHwKdvWNidVOyCRqHseMa\n3Gv9cX+bzGgx/f2i0DeJd5jKHLY3+emp0XHuB7LWBUZuNvUOm90JtfuGPLQO\n9g3SBtuhYJtdYPz2VnfHY+mSKt8wUyFId0oQl614mjbyAVJpIOgGyyrAwfcp\nZe0n\r\n=kVGx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"28da8526953a94e9036d445e32e0c53e317deb50","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.7_1638368723345_0.7124863324921789","host":"s3://npm-registry-packages"}},"3.3.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ddcaaff18e8ce742cdbadf707b134e96f7e5c5e3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-beta.2.tgz","fileCount":153,"integrity":"sha512-hAxIbeyX/+U4ba8FcLwFAd7Rzqp59GtnYgqR/sxgYNIog+D2b6Y5PlJygxi0Dyo5CVYbleccjR3n1ptMs936SA==","signatures":[{"sig":"MEQCIDRtcLvgzzPGScaDtUJXn6aWEmtcvEseXRPJOXCyV9m6AiB93aJrbAyJmKyPPZuienzJ0S4Yfcn3L3U17IXy8zpkbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp4ZlCRA9TVsSAnZWagAAbAEP/0qFn4Uhr4IyQ6Bu4b49\nq+uMK9Mot3TNnbcbEhmKoHxa/ctwFTYa5a+pQjUzmkEfnNV6KXsLDQ5lwvUv\n5YDEAvTa7ND8y2Mk1NilLEieV8r28EMGI2f5Th6QvAFDqdz9vVgYhYTwkNBt\nApRa1xif1j+cCi7wpYvA9Bk3bi9iLfvSQaFzsj4Lv0DH4w7GaO38ZXLV7XyD\nPKVe/6FMXmG0/H4iyBs+LPIwvvXWa5kVIquDQTImqs0QjewhA+x1mmRyxVyk\nTuhBU3POyzV7LfVsewdtqmE6Dg0sJ2TWJPZkf2rsDj7NY0t80aPlj+XoWbzm\nG+CtZm6jRZdhRlo0HqljTTQBq1lWBDY2UhSKzfqjyiHTSn1okDh1i1LQgxVf\nCWzzyjkR765FWe74pg+oTrpVx/rUcOicowODxvrAu+8Azcmu0Lh132hvDYRa\nl1tgZG7rH6kUvrd3jQobLwWxuV49gcaagxGqsX1IbxAq71R8d1TWiVGsBqsA\nJUWsLNSuOrNDStd9rmLRbG0L+PvsCJDU42KDcSHk8sfhnZIbvPwvW2zjx4bJ\nu87NM8NMQOuNcZov0uAPK+gHwQbY9Q8Oqs4kO1/cPfuY8n+JA0xW6+x4PJTA\ngPjAOTVE31KxUxtJrfXhxbza75ruV8NIgDQmC3nGc40xxcrsi0kyof4zBcmh\n+Beg\r\n=uo88\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0ba5c4d423944392ff2881109ec3c2ed34d9d4be","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-beta.2_1638368869011_0.5653500736391479","host":"s3://npm-registry-packages"}},"3.3.0-feature-e15295-kwnmnihm":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-e15295-kwnmnihm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-e15295-kwnmnihm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"737fda35c59cf0a3540160b1f3a9062ab8f171a5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-e15295-kwnmnihm.tgz","fileCount":153,"integrity":"sha512-0pzT8QU9d3oEWjjlYQNJrFZm6XsqZGKnHWuDwOjbesw7APqXSVk/2xwmlKxCM0nfEUBaiaH5An7UIhjp/LOXMg==","signatures":[{"sig":"MEYCIQD0xEcOk7QIg1vid+abt9td4lbkO2nVkxsWfJ6PWFgSpAIhALEkF/QhkBD4aZ0hhtkWv8roK+IKr/AarkMtep5Lq2YK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp4dVCRA9TVsSAnZWagAAlU0P/jb2klDtFvtKEYy+y78I\ndJJT67VJwyE2UqSafNBgv1fn36wbkfkJRfSxO/+XALvAb0IFpxjcrP6pK4AD\n4OFX1Vc99c08Vkq7qYqnXmN3Wp8St/kNSVm7+62CWOavgEyR2xn5Ec+8yZt+\nVuEDmwa7c7I61OLuwpIhczzcD6Iy7ApSM5JKit804N5eIIj6qs/g0vssnC3D\nesTxVlRAP/zeX3cwW1iZZD90wEYUbZoYpioS5mTPn+HwYLZQGuC37am//Usd\nRwk1HUPVI66U+BJx7YczU5uBt747AiE02wP54QXGrhGND7JEZ99juT7fqSt0\n1tlLSSuug1es/wMB6JL6zTZJ/OTVSCsOWVEiis9wF2TUHIUqH1Lg60N6co6P\nZv3ivbbieEsctjvQsX5z37FMGvocZMGDvE20qbL9ehTLGOxVz449CMBLFTQa\nEujVrtxlwUEYCcrhm9wNai8+of54Vpx2eMZjbpjuEI9GT8UGTScuFkkttUtv\nvEGV1rfZ9GITnDneLdIR1j+WqFe35aZdyPIKREfWLrsfqMr2BXY0x1M9Cfso\nnU6tdZT9OrwbdP5b7zgVAJiqMu+O0XsB8Et+InPBYScJ8ScrKPpMP4S1sRzu\njfO1T2WITR/ovgJTrRkEa6eW7ZaQGCdRDHwBQDxB97rhCwkwv6EsPk3+4+Hf\nkhgw\r\n=EKqC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e152958a6639a106421965e8db649df9eeccc3b9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-e15295-kwnmnihm_1638369109429_0.3171785904597333","host":"s3://npm-registry-packages"}},"3.3.0-feature-1638c1-kwnmw4ar":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-1638c1-kwnmw4ar","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-1638c1-kwnmw4ar","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9c0c78514d348db317f67d1cc254a586b2f2a4a0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-1638c1-kwnmw4ar.tgz","fileCount":153,"integrity":"sha512-pCreeCNTmZJVYeydhAO4sgfM5vcr7+eJQS1arp/tqWGj6AXPUWdGVoc4yFSusGC/UZazicpF4qEXaqaII3xGUA==","signatures":[{"sig":"MEQCICMymPYerPvkfTY1HwJFEKdbzKN/Id/igSHiAcg7oCMeAiA9RFs8PLndU4TKhR+w3dtwa36TJLK3lR8s03nwuRuqEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp4joCRA9TVsSAnZWagAA82oQAIUfVd0E22NZVKVFf3jn\nOXIny2/TilujSVgfIoUeWnJ3UKtFRz0WrYtMoWMzRnYLR12Lz522UBcBYS/U\nD0li1X9/Azfdz04oZ3H0iDKplfhfc/DUzcJM5OSJLKeqq1pGgckNlyzPLlnx\nLWAUmwmy9cbIh1MUY5ytqLYN8+U3tdYmCAiG9DDrun4U7k8HsBvkVMCCva06\np8QoKhNSjpqH1hAisnDYsufTXrY7Dxp86fqnK7lf/HF+BH9vXwPoSTWm1zQ/\nbYIzgOLaQSj2ez1W/wzZn8T+cO3EqZeEdJa3cw23Mtsf+TU8bk9n51hbLsmg\nWiZ7v2SBrQTDigd9Cp9F64wZAUi+TNyzv0yI+2PS+OXSTVdotmgL4ERM7nGL\nTR1tUXxyeICt5lEzU1rtZa+9mvcy9mzjZ2flMnqNYW+mR0bZWN7nLoZfLwjG\ncLOD1wHKKHOPvgJ5l5jaGCd/e/+az4RSO4Ai81zZG8KtFB7wedjC5WkEIFTs\ndGfr0fqgt9cktcazGQYvvRufcZ5Mv8W2GnjCkIRHYFxYPAbxtBctwyiqy9dY\nVdtQWXFtVl5vUkSAt7Unew/G0ldmjpKj1UQ8I9oN1s9Wouj4JR+hjheMslos\nYxG3T8wRdl9vsE4gKhmJc/j1v73R/y4IzEMjX6H+tz18WREcq3r0sF0YZtXU\nB+SF\r\n=5OGi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1638c1afde1125fa4693657f66dcb025783e3b57","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_flag_for_removing_process_instance_data_after_finish"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-1638c1-kwnmw4ar_1638369512407_0.6265915159693263","host":"s3://npm-registry-packages"}},"3.3.0-feature-67fc78-kwovs914":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-67fc78-kwovs914","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-67fc78-kwovs914","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9360a1461408d4756ca9bd8593d899961dab2b6e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-67fc78-kwovs914.tgz","fileCount":153,"integrity":"sha512-T7vB+/QQL+5/+XxSFdiQfjUViZVBB825QsZ+cmpAOwDr4sB5YQy8EapkFnmFFdN74s3YoCh7hbSddMC055uuww==","signatures":[{"sig":"MEUCIHljuQ9ttWjgPvOJTwzAJk+bBTlmiQwbgDhSlib6vNyIAiEAl4Sp3/gwX44NrfltW6pNOcO4zvOudZnXljzBU21/MRA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqK9yCRA9TVsSAnZWagAAg0MP/jc8xiWehF/Qf7ORpMZD\nmiGNv1b5qr7SptkP6l5rmODpmvihE8TDP/fsPOxdNzImn4RyJj4mh79dsQA4\nb8W/hitKfDt0JloOT0zwqMzqigq4cjLeQbpSk+fqatM59+AN0fHgtFzk80vz\nsCQa5Q226LeljhfouYMta2f83kyJnL4QSMZJ4GmmQa40CuBw5C5lMPzA3tXG\n9e5Ye0zJ7uvOv+m8RsPmiH7DIozyEkZv6pKqyZRWMROnjzFGC0CvjMC9ndmn\nBxQxCCCxRw3fkm0lAG7AsxDheXaMqiY1hXbCZhg1RirfkM3y+RlMaxYkNeLi\nKsz+02H9w7JNs6UlP2t6WP+OR/qKPmdWZ/G6UDFfYgOcsoP/UEu9np5LNcCO\n4vpeqsOzwl66hGL54/BMg6yZZHDgyoeigseifcbI7OiEV/w9a6lNLzlSgnL3\neb4WSwvFKlvMOQrl9P7F417edtldDE7sjJHXPcWyxaBolRGGPZeoGmh3kY/5\neQRIhgDKa1I8g5M9G+YvJ2rkQMussICztYaGNif1i0XQDCOPgArix6GYAy2g\ng4qsguErP1Y/kLth5F1dXP6HAfxUaF1uuv10BJiJYi7flQLQ++4jymS97Bwv\nRO3hgZXzzLBXcMAKHQb2RaZzAFzeoQt3epv0/FapgQGKJ/eBreShOC/Xo2v5\nSXb/\r\n=rJ6Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"67fc787c1f94bb72ce88d88aa294c807c99a56f9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~application_id"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-67fc78-kwovs914_1638444914346_0.30920070968809665","host":"s3://npm-registry-packages"}},"3.3.0-feature-793fd2-kwq7piji":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-793fd2-kwq7piji","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-793fd2-kwq7piji","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b215b193ce5df5f9fd26f9a23eb151a6bf4de850","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-793fd2-kwq7piji.tgz","fileCount":153,"integrity":"sha512-8HA2Ex3XCubB3mjlLHAfA++Hx5KFwD/dU1wsZv2Fa4DSRIx5OfptJMhXhTTjANkbgto4w2TeChYHaWKJ52q2Eg==","signatures":[{"sig":"MEUCICkmub5L/3YiZP0DloW6YY6JdZBYkyEjO1SN0B+9fLcaAiEAzZbGHH+VYK1Z2qzE/oAFP2Ig36+9GiCdHDFvrp4xh/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqenhCRA9TVsSAnZWagAAAp0P/3BbR2zT+xPjsA7zdy7H\nlpH1spLw+boQ4y0gAaIgPZ0j4LPbc4NMj/dQw4hz6vMSH4EroMmygNVtdNFv\ndiMae9za88XqJ8xa5xZbuxfHnD3+BawokvPCZFGZYrsVo4akusTT8uMXUBxX\nSTJt4dmFZYBvDTL82VoJSnJ2wMHtsN2CFD0ZBcA72B0Y6/+KzLRUQMjilzHr\nAgjgM32QmW0pq7/4Nv57d8eTgNDs9pzCMw70gjAMz5HoxBcRwEbuW1OzXqZ4\na035Hev/LfB1Jt8MGB4mMyvYxBxGa8yS29AFog56pXGodJg1Yja54hQQt2Fw\nq7M+26ZilUjPDzUVs2+7rTMCDHBW6dJdVb1cLk2RFrJhQWFu8gIdEJ4mhy2B\nnl450prbjFrdg6Q7WdzFzUjw0gka7xRu13LD/OXg5wDWHL3b2Wxjlv1w+I1P\nTfna8ZUZXlnPLSRxH/dit1bSBoSQ+ntgBwyBoLxXaIv9fdZRcAVmYcavTSr1\nb30mPWlrw7XqAISLLB5PWrjUqAoxxSwZJpBDH6Z0lJ/Mqi4sVq3aRmDUOtlC\n/35UQUyQNXRPoocHQoq4Y2RTd9JPuo+6siM7esh7GkAjdHT6aZYrHEp2uMqO\nC3aF3bTe5KDa+MRCYrWTj1DRdQ/oO8PUZbfL5WDAHui1vm9amtYIDzkt81c8\nHzBa\r\n=GKmu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"793fd2d2581ad3ed21985c30dd8bcff19fcd9d58","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~fetch_and_lock_for_multiple_topics_simultaneously"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-793fd2-kwq7piji_1638525408866_0.8662527434963232","host":"s3://npm-registry-packages"}},"3.3.0-feature-ef5364-kwucoqiz":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-ef5364-kwucoqiz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-ef5364-kwucoqiz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2905193250cf6ac9dd205ccb7d1e28a031d91f47","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-ef5364-kwucoqiz.tgz","fileCount":153,"integrity":"sha512-Egzpb0p8t1YcazJZkExP0WzF0NOuZexp0/PNOW+F5u3izv/XJMaivRHlz2LNyAZL0/aS0m7uyGJG4+P9+XCPaQ==","signatures":[{"sig":"MEYCIQDAle8cm5BRjpIz9EjdmuscjGbj8veJSyz9xAjpnXKrfQIhAJx/jaQ6HHL0QVmemCWJ0IYQAf2WT499CvnKKZFS92La","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrbtPCRA9TVsSAnZWagAAfdkP/2HbK7fxle1UkfwwJ09E\nqw7psCp8EhQVyB10BmCzp+8kqfzYO4KQoS9FL8If2XTqC/salskT1JCeG7wx\nIBx/hplGeCR5nXqye6G1s7Srr/eSZ6L7jmVliQQDhCCdFYv2e0x0REcuL9fX\nIdnHxWtwBMxJ2XQUO+zvSyfZ5uE007CXO1kaJGNXHxchzpiVbCCGnbNOE92G\njcINQwo1oT9yjSTkkJEHNYHcHC8oo5gyt8zDQcIfIYtNHBTFBze/ZinpJWgy\ndxhwMLJRrcCK1FmLsvOv3/WxYfNYNNPkdt7dzu3ioT6lFGNI27SxmIzaC/4j\nMaU8MFygV18zlJxgS9hV/UHGHw/dNETAr7WlWMyZWU2M+tvSLXrHzQa+8e3P\nF9Jqv48QQALpemYTm649CXWpRana2VdC3+93uqctmflpNJduqP+XKyxT4j4B\n46U61CspDlH7IHeO0d0irHUJggNb0QI2nWW5aUfE0dTHHqI06cRe6I0a85YH\nkHgqiiIkIaRcA3Bjmx8KlUjStN+m/lYUJGTu92gXejajybBV0i/NJrvGki4V\nUUvBvdxVwbKt3si6jqep+bguY/Cdk9SXXNHEXRAY7682wu1oYl7di7AVRRcF\no2JdZ9zYOtCo7EJg920l+243JZOo90qWsDdlnkJW4sGoA8B7PVM2GlKgHOpf\nmNFU\r\n=ZpqJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ef536445e0e77851dc8bf7bf9cbc7c06c4a50e46","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~fetch_and_lock_for_multiple_topics_simultaneously"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-ef5364-kwucoqiz_1638775631502_0.49862592456015364","host":"s3://npm-registry-packages"}},"3.3.0-feature-66f73c-kwun397h":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-66f73c-kwun397h","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-66f73c-kwun397h","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2dbb33d5808fee5c85209cf57d07368457c9c815","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-66f73c-kwun397h.tgz","fileCount":153,"integrity":"sha512-DrLqqz3CyY/MHzXfG4+ACr09SqAorpTx2Ky8I3d27Y+BsSGvF50mmSOHSCKElQlX1DxszxayKlXP9gTX8DeU4g==","signatures":[{"sig":"MEYCIQDAH81D4aD8+UsnNhNCJeUh1i3DTuz71Dc8uDV7sz5pUwIhAOFuykRuymtLnBOVZhX7SR8w0ZKRuWk4smGWija53a5M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrf+VCRA9TVsSAnZWagAAIbcP/2DFRSpCUdzwxCKU2ZG2\nFirJ38Rn0Sc8yELb66KzvrB837876TMtWui017QEvleYUewG/NadWxbqOXO1\noUOjrUrFgGXs+20MNw06D1aRKwhSggzGJgv/cL+31sQniE3HCmd+HA/df1dL\ntjlnOm6Hf31571ouJrADfJBLZnMsqrvxCnzheDza2Sxb6CIoMPpuGqVKvDBE\n2Xr9oF8D8Ib/p3EL/rG8Yke3ryO/Ib85E8pewX5e64YsdqkZOqHdSVSmSmv8\n3LwOtHNmJVKBbbWz0eaOjrutKmrpR8bcpABlce6HtHlcrRY2CbJhbwAaB3nI\nlor1IECtAHiBC+JccbRc/hk4ONNfwyhXAR6GTRVWsP3zO4xw5xaiaXZsRHKJ\nxdqgv5yDudjBPCNDe0f4ZbSl9S/mVNaeHdnX++yLotMD0Xl91pKWej+xd14d\nWRtJtmOccOOUhCX2Rl/0f53dApAMdTsaGwdGt9uxRmMtKpue0lINk2/3M7bV\nZ8LMUrwNx2SFOqD7GTOPIyFsCfY264O2lspdoEiUNG9C6xom1ffulH9G8skP\n6XEuKh0hK6JB34JWfWhuBSUAPwYDtDJ4ksWDX6lL6+gj2FKEHPAOQW7K933M\nI8N/AtcqAgc+0lv7emUssim/qW36bEpT8rB13McjlYbjwMn6CbYW9u3rbwGO\nattu\r\n=DjID\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"66f73c8fe92598499dbc78687e1ce761e7df7d68","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-66f73c-kwun397h_1638793109678_0.6186306571751023","host":"s3://npm-registry-packages"}},"3.3.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a9c95e04a56edd8b6e0882633cdb5330c5630a8f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.8.tgz","fileCount":153,"integrity":"sha512-AdLhCp6YvuNVnAtqkVKMoY6obGoG7VN3EE+z/sIpalwliuUZK7IjkTu9whqWcRwXfI5cHlZvT3o1cT3lK0NoxQ==","signatures":[{"sig":"MEYCIQC4+JYpypHpP/XsvuDl3DtfPStEQCd80erSh64k9gvWFwIhAPbhnp9/P4juus6gu3Rue6u1wIiVFf+kAUGUq6teQwm2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrgACCRA9TVsSAnZWagAAmmIP/0VgPGZB8PKhocq/Gw/E\nn7ia8evUAGzHS0OJ5bs7pSajogKOodNw2P9MTLp7cNcwadC9TgBWtnKoMu5U\nP68OUt2N6suziDDM8CQ7kBmK06XAovdEFWf/fuzfx8a8yTt8dVv6lz/QfClZ\nCaDJQ1hRvXIQoxxIgRsRu0KyEz+VsJ/+hZppl948CfLHPK7qLjonVL+CdIYP\nIA+hFJTsSfC7FHMqIyLFAIWFOdfry+h4+T7mszby45YJWlAsPJTqVKQds3fr\n+VqfpXe3HeKu4krHQzJjP+h1je1lmE5KJCFreYjAocSgmrDFVzGAD/COwbnQ\nxGeV4gfTj2RQ+bNKA8kcNLAfPbusmvzmbOw+XHWdDBf/VVZ1O67ArRrcwM9e\nDOgvimpShJAA36zC7lWy+3STFc5uTWipfTbMSsAfNl+Pz8YnUcriexk4t+8O\n0ipF018iaN2n8N8vw3zxkhi5T1i8I3W+zmZOO30p5fn9pCJ9fEOZUxUbRlNk\nTzqlrY9CPR8UFuzd3USTl0I24UsWsYNWKyzWicPSPTG2+zsLVJmKXq2jEVt5\n4n7f1NSMrb6/Jgg1ADlH4040tqUCgx2Il+0QSnIFR2Ksk68+gf+n4egQrAxJ\nha4PURQ1hHbLSxPwREQMXsxXonU7grO4wq+tBGjUcdZiSOpr6D78Y55GP6j0\nZlQT\r\n=aV61\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"33adc9e3b15b7794e11dd946ab56a2442d92963d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.8_1638793218497_0.939353812230497","host":"s3://npm-registry-packages"}},"3.3.0-feature-e1a4e8-kwut56lj":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-e1a4e8-kwut56lj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-e1a4e8-kwut56lj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8184549e029372c92bc251ab05ff5eed091720f1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-e1a4e8-kwut56lj.tgz","fileCount":153,"integrity":"sha512-F9vRZ79tOT6nh6bU/wFdPQGBS7FmlcHojeqEQ8OBIwEzhWgzaNmK90uCId6KoS/oYkHTkMaEBzYYNajXdhAgIQ==","signatures":[{"sig":"MEUCIBiSNRIIJHA9jIkOe7C5X10J8yxoO5O2ftMWkOFL0Lf2AiEAu8KnjANpZr9tfXdjdMQtpB7lRgu2XTp96GcrO8xEUFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhridMCRA9TVsSAnZWagAALn8P+wUSjkS/fvyAN52DwFq+\nlRekvE/nOZ7nbSUYSQYc5h/6ZCT/nIyaLobFJRCv2eJlcE7RD3yy1IFWzks4\nPUu4fqSocmqr8rfXrTVirNLjrlSTJaRT47vMcd5ENtMorn9ZnaDFOFdsHvBY\nKf/YKlnq7gbI2qOzJ0oMAOhHANu/FwSTFV/iKEegRFv4NMz7RjZtlFfTTlFG\n3UClbk8tLkKANTBsn2dVJd0X0opmxDZRXwOQpyQtl+/Law1lsB+eXkHjAOMk\n4aLjtEWnboIvYh1S5/A73iRzmcOp01IEiY+CeJhf+Up0GJSR+qUZYfdYlpPN\nn1P9YGcaCIWGUb5Py+xqwyvCPKGYGpfuwmesczpFTXY2q4Ek23JtHT4lTNdq\n902ibYEvbR2U7zxbyFNfxn6W6iWgLmp/wAxVQSkXK5hqkqMdm6blfeZAAVle\n4OQZUwhyf+41qDrsZXpGh2iX8U49pCVPCBrpgs+RNMt4IXnuqkHXBJEY5bT+\nrvlFVf8KamsZ+uzGLwTMDYeaso11RUFbQ1p+4pKxlg5FbX/ORFk6di8g6uyQ\nJg0NKTycnGLK979jBR1JjUgjKlnPIEsYtwSOihidI/et9q0w5sDerE7vvD5t\njGh40JFHGM9+jh5aPNLyIuRO+obxTo0JglosWDwlSNPhbFOwb+Vw1RDS9QJT\nnFEe\r\n=z7Gu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e1a4e8da83552638bd4ba4ef0ce3fb391bcce34d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-e1a4e8-kwut56lj_1638803276560_0.3471507478689655","host":"s3://npm-registry-packages"}},"3.3.0-feature-d577c3-kwute4t6":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-d577c3-kwute4t6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-d577c3-kwute4t6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cb58055d5451703e9f287f825743f131fd2a8bb8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-d577c3-kwute4t6.tgz","fileCount":153,"integrity":"sha512-WkOOku6ThGe9sn64bei2GV8JftkMmQF0QIgKlr7OOjTj1lGblfpz2+oFt0Ricea2JjnniY+lTbnJlB5uP/UMzw==","signatures":[{"sig":"MEQCIGEGOekRmjJ7S0g8YFsi6mAJGYrUTb+RySaK2hbja8BFAiACzl+st1Yp5ObzLhZtDgIv+LJJOKxlUXq4On8wnM1asQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrijtCRA9TVsSAnZWagAALTEP/1H/+fhm3jsuNskifDwT\nUxi7V39H+s7800QaEelaMojH1d1C6xEw/Mcj6ZajOTUCGOM/9y10BPCuENEY\nDy8LaF1rn2NiGeiXwlvmFUwkAuPLystDDOK0NsKXMNaHSEgjQP9RATdRLxTC\nqZb4DNCy00ROyU6Fa7W5kQWk/mycaMKBjpFKaiWFvxtFQl2bF/iRfL6g7lmL\nEyBTOQRUmk1Hl3tywiuUy8NRLd4NHdg8RMFJ+FpDKEsGnD4TtNOHk8qVcIE+\n08071uGQzLiR4oPyDINz6fwQY6EewJoWZgDh76JrguR5+VvZcNQIXghSTXMO\nhe8fIZRGppq6Z0u+6FfNSpsnrWaM27ACr1usUt97f1reHgkc+CrahAROHPhb\nb6BjbLlaBe2GOf17fxeEIADmt61HPreZxR4Fcvf7yZN0wFqB4gRE/yAqgzWN\nq/Uu+TpgIPaeeJXLBVxxvyhc6jwTt1SAy97N8kcJyY2U62Bn74BcvhJzGkgG\n0SX8EOmD5pD14NEzsqFIiFrK82ik9PPiIVdfdiOoV6N0508nDvMe+OV3wpZX\nT0/Xph+yBYOB/nNKYF/k4PVD+fGBAOYxQQKr8FjTtr9PA1t8+A2a9gmLxAqK\nw2ESVmZssrJt3s/0FgE4zZLqApApFL0Mn8bqAuJ9hY6hQBkm6j934/QvKv0y\nWgFS\r\n=YYR1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d577c3b3e4ae0572342087fc0bfe72b35dcd918b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-d577c3-kwute4t6_1638803692933_0.9678480086624717","host":"s3://npm-registry-packages"}},"3.3.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"90130a21596aec3ea6965ac4500618fbe7d33ba0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-alpha.9.tgz","fileCount":153,"integrity":"sha512-ATLCMdaV4RSjqc8TwHjYOo7Mn9kxwjHXh1zAotkwB02v0OHXZpIhJaFnG0qJgunklsZblGsZXfJm6IEd5yHU5A==","signatures":[{"sig":"MEQCIGfBCymrZNEceWNfF3T0uX6NY52239DU1mLykBjIOFVkAiBgLDfnwu9TQHtCIGEzkUIcvPxcDCPf4OuaxREBSfoM5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrilaCRA9TVsSAnZWagAAE8YQAIQv09dj/tDOHxgZlAwn\ni/Lv8tVPRZuFbnX8lOUoHXnbOP7VNpn5bxQzZF8sSGjTXN83m7/TEi6Ass/D\nt86D1jGVliC0YMxsOp3tIDoOYGzDOeKS/W044Lhne8zjw+8/rFoDcL2J+Ml7\njlGw9ow7rwSCNsX0qvNEYQIIG6OI43WUBkbUURPtSoFPVuIjRzfuKTBspomr\nGW3PeziJ2Om1RGvLvH9TtiJNwdbF3tZxZf2XkZctlJ7APSEfokWbwR1Vu4xo\nPkuhaFsxYvM/oMuqHTZXUKlAibNvMLdA1E85HdvGhTpx3NGanWpyICDqnTCs\nqk9MBJ4KZKZfvHn/ykhFt2T58lYnKKPR6vI+J5dGlcRKSOBL72NUeCQWZPgl\nw3Iajszv9WCSecCoZD+nVbjaiQAhZ62aIXqN+mrx11W6+LhV1wxkrotOPI/D\ntQwg8pw/4H9rNYel0Anw5OMtuWXxkF+pvMtqXmOT3NFupiVi6PJTBAiapb8Y\nHbZGx9oECCoICarcAfqUfS/VqkxSQ2edtpQme0gJDAwBmYAZk5eDXrFFek4k\nJIa0jPQ2ZA0iMmmFcbvIwfFDww4TbiqICa+8ulHEKNMHaZfJIbR5rnVZ7N4O\nNIAkZSK0S6iIfz9OEmREdaitiibkKb11fE07raD7cKhnMRrQUyZ5c2LfDt8X\nKC79\r\n=V/HD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7f3432688182244b5927ed260a9eb95b73f92b4b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-alpha.9_1638803802110_0.3477383649650858","host":"s3://npm-registry-packages"}},"3.3.0-feature-e40013-kwxgkeo3":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-e40013-kwxgkeo3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-e40013-kwxgkeo3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ba337ff63df2362fbfdcd694906450fee84a7349","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-e40013-kwxgkeo3.tgz","fileCount":153,"integrity":"sha512-dv4eEuSxg2Qvezk09apjyRQaYppS5NP/vvzDEAwwBZxhozhRAzfR1PerEiH7eB9a1JszcV9mQfnLFF4W6KKWSA==","signatures":[{"sig":"MEYCIQCgrZfOMBL/g0Am82p/Gj1ZOM4yVO2b2AaPQdqSzxxyEgIhAPzfcVnyWHYGbYNNu1qQxsNVfi5UXeo/oTvpswqqBwtZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsJlhCRA9TVsSAnZWagAA9JMP/RaUr2rVc3dfLkQhjaw5\nHV1n9utg9F/qT1eYqFz/vVsUigu/kfEdxYZKxGTIcX4h/WlR9ONr2mMu8Ngx\nHYACx/B+GHFu1BYuMd4qp4IeNOq5Kwhh0HzInjHFb5tJMY72pcbxXLTifB7Y\njpONwgbPNlS6P/U4CBH0r6GPxN4svJBgE0ok0vBS/RHzbgu8Mtb7SUAVqB69\n19+fSBq9jrLwwHTlI7y2RENuJEC0Z4YBrFl0ToLNniDDX18ULagSO/Q7m/VV\n6GJOeaUgFs37L85bkdXEc+u8gFXs0Gz/ml1XdUO8RBv0V6tfJW7ZE0rEm03r\nyMxF5gYeJZXrbYaekpbBbiFrUotzGDO3aMk0L23d3M+nxtLe6bzopZfmragJ\njO84VPBML9LkK0/pjRYvONa8D8NQjg77DLU5T35xAB+cRFWGTGXG1VauzgPx\nWQ1wDlWcrn7/6WkJMhpVipfslE7KhnWt3LUNVuX17nWEAwqnuD1IjVLo5Cw5\neNj6ShqKf9R+Iul8x2sHW60VWRabmopuUL3F8ynk7AoZTBKBK22iVDa8UlZ6\nrtgVHmhaiyGt4I5DLvbLhVOOuYGSz3GSvbSO3wjsIlJO+naDeIYJvHzsxx7Y\n6b/ONvk4qW+w6n/8Tr0x4RV8aSfzHkfsphCA7/A9y6HUsjzBR32Navwba+H1\ncOvt\r\n=3SOe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e400130c066376c417f61a16e155de29b9a0b77a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-e40013-kwxgkeo3_1638963553005_0.9425784381090259","host":"s3://npm-registry-packages"}},"3.3.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8d599e933e0eb21ddf1c32693ecb679a68c3c852","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-beta.3.tgz","fileCount":153,"integrity":"sha512-dBcrL8Ian/TuLvuuzsTSTi/AXvKiUsL3LH6kXrDASP6e3lgIx6gA0Y7c/thSoOhkkuVJepdtNuSInhGdBoKJsw==","signatures":[{"sig":"MEYCIQCQJCPo42tb+4301zSD84R47NaK7ZU5N3TVMZPWzwKL3AIhAIZYieV6TbpLKZxeTiBEZ1cYBlD3mRfhYr3OfVeqsWpV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsKD5CRA9TVsSAnZWagAAn3gP/1JiWe+VLcU4r4bjQU6T\no0gHtciIjInB+GO9pWlvOETuSjb600E9FhFi0BLVez0o31/0gjqTOMYcdfNY\nIYwjWG5E/ZDSctRdXO/o8DsGvKChZR2ItqCnrMykCQECm/sQFsRo0sRKMjiw\n1rhL4ziKWqa1IBZ2dKpgSlkRMMsvWMJVLpp3igCBn4zK0Kxact1k2Y41eooZ\nAMH/61XTHa08nnlbhB1gu6qplLBBSTUuubEIag6QmfbALa31Vz79EJEGjwj1\nBUv6z2JBZCF7GnyA/DCvl7/FeTB9OjulOl9GfkMY5fEgkJsG2LaLrVLtpXME\nA/DtTXML6jArt5L8+1A8O3BmB3zaOfGtTWF5Cm59PFaYADQPo8kFpn2yXIyA\niRjxxha2B7Y3VgalUX2VkCEsa12h6hyBjFO4dK7htcrfN310kXuSSGp3lY6L\npi0dQ7r1LE0KiDRKV1o7aFpAUZKwVPd9Jrt9vYng5rDjtjBa9xOQ56+9/kTv\n8yXNicdBVACM50ypPOHtzgqd1RylaqrQzDXbr0u6vWK8PGtI0f8zupjKQfrB\nQXVSXZmFGhaK48w0uIBpvcTlKY9g/Z1phRKsWWU4gZh55DG1FZpiEMrDMNDn\nVBsPvFkDbhHP9qenqwVpdW4vM+94VWwcs87qKE40Tn2tGjzhWkBEtOG16uRK\nMRSz\r\n=sXR8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2c42c897cfba98924c0823355cdac148138f1229","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-beta.3_1638965497104_0.20871599907654326","host":"s3://npm-registry-packages"}},"3.3.0-feature-381f4d-kwxhv3fj":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-381f4d-kwxhv3fj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-381f4d-kwxhv3fj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fc27f28122fb1de09cabe87f6246dbd2582aa3ec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-381f4d-kwxhv3fj.tgz","fileCount":153,"integrity":"sha512-GlqpfhPVopW4zrzzaj2qjRMs+KQbu2n0PKIeafq2FOllFao5So9iQbZm9NVUbnMMNgjaJdyoUFFFaOpAMdlVEg==","signatures":[{"sig":"MEUCICPa4ObrH1wzBf3uA/i2yc8MqXYsC+SB54D11JOf+oWZAiEAmVLL8mIzjZ1mJP9O6RrFLSkuedw5txpWes6DVHWp3Us=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsKHcCRA9TVsSAnZWagAAZ1EQAI9Xk1NtbrFM2ivsLLvS\nD7Untv8ROaEn7aFOhOag2jTTKR+4HO+SUcEE+sxwvyPSXWPIzXkcz7j6KadX\n6TVqD8FuRIYLg1rAaX8WrSyQZDXBFToUM9HtFQ3+PsPFwrUGgqNzaPwr1cN6\ns0lmQ29m05yMqGGzCFWOWSMrMKXJal/kMiaMBJn7QJ1uSi5cEfAq29WTfCvr\nOc8HPsVQRoz73UDIL/R5fK1QJNVFnE/hT6jmf2jsG6T/FMOfU8kspsGkTk8V\nk8XDgEdS3qX244VY64TVQ+rZH0VSoZO1Y+tVnayfjpMj3nIQV86tEDSw3brO\nMRZElZ3elsLaLiqW1rhA8hmZDWVCq2pMVOFfEo+jsAw5Z+knfE2xprv2Jf5H\nFRXTNY9wmVmfi8d7A8tcdgt7Pouu0svLQlV8qY21Vb2IljyH505gCZQzVX1V\ntFOByATI8M9KS3IlprNsFo53c8fq04StufoekoPaXyoPKTLeAKkjdCy0kR12\nbNg0XM7Cglw2DSzxG0U3eP/QKlg+aR9/R/qpciJM4uXMJbfjG7RuMnE4ek5+\nnmFIRc9gtGj7spS2wEiW7RBqwkjUnoxxWpp7tF+/NjHRscpCJwH/dNKLUzhp\nN9wZugJt2W0HGRbH+uRnB2jG5/RJyv+xOWDV+rsnI8goT6q82UVmpbV4aR+U\nZ5ao\r\n=C4ie\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"381f4d97cc81c41f5d8ebd3f7dff8629ca802f93","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.0","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.0","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-381f4d-kwxhv3fj_1638965724554_0.395714320096618","host":"s3://npm-registry-packages"}},"3.3.0-feature-a499e4-kx7eiy8b":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-a499e4-kx7eiy8b","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-a499e4-kx7eiy8b","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"35cd37bd03f19627b6f3d0cbf3fbd288d7be7dcc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-a499e4-kx7eiy8b.tgz","fileCount":153,"integrity":"sha512-1ssFjgmHPOEbcHCAtUqfGhJIyRPr1VJycOYHaSFk5Bf1/lRKrlhfOZBL85KtggYaEkk+sc71J8H2sVNHzniw1Q==","signatures":[{"sig":"MEYCIQDAmVJGO/Xr1tfoL/dedF0mhPieZJeYytTrvnbpE+SzOwIhAOQlCSJrAzIgvJLiK4ks+oFqArZMtjtSRxMIXnKcRDzb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhucXwCRA9TVsSAnZWagAAeYEQAJzo7hynycLD4LnMbUuT\nGo2nB6/Bb8UEJSQkxmwdlj7QsdIT9QUrGT2wZVxm0h1hIUJs+rXdhXROuFqh\nKsuSE+WAzQVGyrVkaPPOlZLtCQfVNY3lq3RRKYGx/MaQhTHJoO89nhDaUm1V\nmK8ns39qxiPkCv2gOUA1aCfYVkPtmHERxCcVcqVJ1iIK8x4HD2jmxTVeYUv4\n938S1JxzrusR+swtA0oxeE4j/NnntE1L64EW80Ipa7WC+woHnduk/C7dnOjU\ntysPs6MamGvCQcm3D4z2jYy4WeKjhpI7bLzW4MYulgXq/OsF90uzFA1M/TMX\nkQ7XKIf1PbTL0pPjdaDC1vFeMMZbEuRwpqR4Ya31dZVlx0o34t+v/PYLN8B9\nFkQRjpXYJnYO0sECIytEztUof9tvHYNRvzmLBTW57xiZMyvhAURxx9P87iPq\n4yd2bAjvMpKbv8gRhMKrnfN7BDnXkUv1aHV8xuYFFRYju3c99P9QobsyclT2\nOjfdQaapxmZYPMU+Dx8Ed4wpQ0Zffq5bkTXqHcDC5KtXCHvDuqg8ie8lIiVs\nxwVnvx/bsLehQR9Q8O00yZKos5ck6iOvdx9tNISIXOvdTLgJ/+nARscFX80N\nDvrG4g/htnNjKbaw7nhCXuiUWlqYrqb2atR9tkb9GW3yUmsqZegtB/E55d+I\nBq44\r\n=diF/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a499e41c584ef46880de62f9a827a3f9065e08b9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-a499e4-kx7eiy8b_1639564784112_0.11840983435754171","host":"s3://npm-registry-packages"}},"3.3.0-feature-20dc46-kxfttlai":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-20dc46-kxfttlai","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-20dc46-kxfttlai","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"40298eabad9799ad05afd72299ba102b86a1a8be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-20dc46-kxfttlai.tgz","fileCount":153,"integrity":"sha512-O9xyBAcVseYvJLn+VECe/4jMhW3scrmd3BeUyfbEiOOCm5M3aAFsq+NMQVyxbpmBaAboOUMveKO1zSGmX1H/JQ==","signatures":[{"sig":"MEUCIAjyq203hIapYjh79nIPLi4UikzAxdMIq/ncyQajVLEtAiEA6xt8tCV7/IXX2iAG7iErrff5KerJ+yKyWqi/9ggJgKo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwYveCRA9TVsSAnZWagAAJFUQAJ7CfPsBF38bXm4bJy+4\n/90Fnxh4NcCOenIcSlstnFtXUGUO9j1gEtaOI6vUz1xxUmASRu3TTtxbfaVE\n1tLvVCvJk4pVtfxhK7NraA6BgZmZ1DlQgdQJuPD0PTOOZ5b+kbTrzZC2hVHZ\neZZVi0AyHWnvI45Dyj3J4oH8o+6vCSs9k6DJcYtZFmtOhKC90VuVbpFu1dna\nyDAy609Gt+5HZfcninhWpUFgw8od5NPUw0X6aY7QweW371HkPHAz9Z5X+WRx\n4bGkW+WGgwWfaH/lRr48AF3fNKGJuHGp269HIKFdBMgArJbxVEPPUp25vM/f\nxbwLKRdzLKubtazYZbifMxd1VHLE251S7OPWyjzD6/pzng+YHWzNAaHw0IXC\nrgVjVwMuMUUPOToqbmQJENjt2C0oRlcfSkOTYilLDBYZv7nfhLAfntMJJ9F0\nKTlEKzQ+dBHyF/8afEwbdqNvidAWQWvpP12DYqtWSnUdKssLqQE0b5UMWVym\n/EeIjvjHnR4CCP7MZ6osbqcPvtaQGQEoCDqGKeEJ8kIHt7gs58XS8pvnmzvq\n/+akyvHG/q1itedBptMgL3rLDN/MvcQ+BezrdqWEY5vn8FW+mV1X5aYaWQ4y\nhfX4tu9ow9sUlsvwhgxWvbc6UZboTtH3ltqQfvYJ6f7fsUMx5WJreDPxrHtM\ne5Bb\r\n=PYwi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"20dc46be005c94b699de5fc03ff6ad6deb1587ab","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-20dc46-kxfttlai_1640074206201_0.13565404764191547","host":"s3://npm-registry-packages"}},"3.3.0-betafix-b5b694-kxg4v1wd":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-b5b694-kxg4v1wd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-b5b694-kxg4v1wd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f16ea0c7a7308e440c543c7c21983ac53ce8a84f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-b5b694-kxg4v1wd.tgz","fileCount":153,"integrity":"sha512-5f/xhxqEHWLoSZQt92cITRt/6erIusk71dC6ySBUZvYNflvZaKwh4+vygH3ueEm0rfYYOtVtBiKE1EPJRt0RDQ==","signatures":[{"sig":"MEQCIGA3ov2d7OkHveJ4bWuy/8KyAlpVeVT/q3w04ilFyvbiAiAFjURLC/EJbG8kcElZ+vKJmdud9Ri1rFBRZQDTTcC6CQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwdRNCRA9TVsSAnZWagAA36oP/jK+2aXLdESeKlLvEk8a\nvGBdh4IYHmXBNFFkjtvmnT9EvqpK730/fQfG0rHmmoafVss0qymHSlCqAszk\nBMc7Oby/RDxpEEF9ccEuK0rj5mnzbU7vZ/tXrZoRxRvizLRKLFl85ugc6IkW\n83r6+P7T3c1olfxXpyhL1eMpK1a67NY4GzGq5D4+aJ2Jy42FcYLykYtBZfuG\ngZXjJ+85NtSyZFuN7XVEds2NnAER/H5ywif69kGHO8ID93GUQlgTprWVihwy\nwGX7bMXwX7sGdfgxmy+GVtLdDJMrZ/w+GGy5tqG0maqHcQLnxvL3bkh8EuI8\nB2hRqeDQ1uwNYQfAMy7rCWqhKzaeuSXToMUHS3o6JZOJzdO8eb5s41euRFuc\n7npYyG/IglULjDLQMev02+vA7gJLR8DZBRpSPMEVtNrRjYSV7wuNuC34jKPG\nwj20BpNpZN4T3AKPYPHOMLJRseDzKx6N6OWAHjss6WIErdv9ifUm5CXKkNUk\nR4Uw+dmydkfe6KlAOi/67tozTWZtI6niHF7dntGMKfr1qLqWFRlP82N8vqFP\nTDqbT+7/XhlocwrhcD3pa4UkwIpKYhAViC5Mk9cSoklolJzu6T8bXII1E/OL\nFRb+TyoNiWHOYWK/SjaPI+bqzwiGw0KSaLDHTkfDhUxplzFfh9bQCDkWZfPT\ndDmv\r\n=AtqB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b5b69433ba1922f3c8b25cfecda7812473e2f974","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"betafix~add_process_model_id_to_external_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-b5b694-kxg4v1wd_1640092749151_0.36377734940346795","host":"s3://npm-registry-packages"}},"3.3.0-betafix-51f112-kxg5v6e7":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-51f112-kxg5v6e7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-51f112-kxg5v6e7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74d2028e91c3b27003870650a9d6bca52c3c2b7d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-51f112-kxg5v6e7.tgz","fileCount":153,"integrity":"sha512-FOlPDuPIN9NQ1TUSMKOliLv390CbS4i7bY+ztpo2iirJwO/QiPE3h9SO/i4h+kQ+V7pZhOIgn4dlev+qDpjGXw==","signatures":[{"sig":"MEYCIQDEqMLxfdnt+sAoMdhl1zMch0Fe5nuDDto14ojEC8QY1gIhAIVn87RrPY/ZnEWLKcDj3QgQj4OJeMVnxKqjjJlZWE52","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwdrfCRA9TVsSAnZWagAADA0QAJ3VU3/oXkBTDkwPinuY\nXmmlcGrug5sVuDZWlYgbZzI+sxv5IxxzAE8E4INUEY/Uq0AgRhmTmA7JShhr\ntkDQ+4kiKKBn8hVAjqqpcdi0T1Mfds4I9fqkomSTI7eQa9zZ+cQuGd0eEmSF\ntm3P0wmqs9cOJ4Or1Pjr9T0CKUna1hGheoEf8dMy/SuDHz2q/430EDj+DxvC\nGF+svFRDeN1v/6LbRJMMhgSegiVNLjNDCgpducF5U6fBaFPNoLmdy5efY4xN\nGy5VooLVlrZhWr4JhdLa9LiSag+fA2O9VWSkOQSqz+JlBdynrZz5nGPMBDCx\nab5n6UUj6DRXP0XvNb7Cm2FnqkVx+3diCQZF8urBlCM31597FNGHhgU5tr5B\ng9c9iPylJlfC4J8buptsUeqC8HJP5YxT0P8uKcp4Qj4ffUSvaNGySqiWBPAI\nbznzUQiQuOrjQ3XRlEJUjoaczjFHd3b/ZlFlpUaQD7y/+LQhXyeuQwlOXT9L\nIcZiQX//witBDB3dNoYAP1Pam7NpxdJJ0SGZv1wprWPnrIQPxng3VR1SFPai\n8ctpUM/MEKPDHIx0novFrwMFtF6Y0Z5qppdB87KkU/OSjKEMMYp95kQ9oe5i\nw8HJoPWo3v9g7QWFLN2YCT3/vxEYojGAelaevRXdO5rbNqz0Zabb1/CsroJT\n+NDk\r\n=KL+t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"51f112c6e72510a4ba6af87aa7317d4cc9e61ee4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"betafix~add_process_model_id_to_external_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-51f112-kxg5v6e7_1640094430901_0.4539251604735173","host":"s3://npm-registry-packages"}},"3.3.0-betafix-79b09e-kxhal5o5":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-79b09e-kxhal5o5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-79b09e-kxhal5o5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"af6b343f5518f00e2da1b0488c2525e231533f42","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-79b09e-kxhal5o5.tgz","fileCount":153,"integrity":"sha512-4/xPKJqIGlRXMwtNSC4pawi8OehLSVjX8hPTjr6j1FvqejpmOSeQbnJJza1VRuZ2UuNSWDLolb2DldvX7FKl9g==","signatures":[{"sig":"MEYCIQD5R1x6xlt9fTNPFYMT3M4Ri9vG6oYrhvmbOJ6lSdN4iAIhAJuxjD1S5pC0gPSGhjz1zlPA469eCo8mw0DAeGqTv4ye","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwuYPCRA9TVsSAnZWagAAMFgQAIoJpdhuXWSVgD4CXwPN\nHEf7sw+fHtaH5uUxrcT88rGM8CPSblSBg9vNRG4+G4tUwEukSClVw8ttGC08\nI3P+J1JsPubQnKm2m6XwarbS2PlR4AL3+SqyJMuhlLWLx82ny9yXHyNf183V\n16CVB2vLqyFq3/gTIGfAHj5fP2YMgL0zIJriHS6eoIKvLsNheRi52A7qXpFR\nAWjVOosukpOuxQ/GtfBJPKtYj0iEtQcrVlE8oOY+1SpDo2Knzi0SVtEj0EEY\nOMzxKqO1hMSEkcWa9HL7FKbg3+22sSlZqnPkeKSve/rfy5cygAVkYIfSPtLS\n7q9Gd3aGcvoeVsUbh1fdrzH14xXsE7wrhTTlSEm4iuI8pmV+iHGpz+tUDhKu\nABXYumftnuTD2DRDouoOGNaqyWulFfwigibzJ03dqDgFYpXIxjTDNIfS4AhT\nIZ31WQhSGKbbf03+4qo7CByjyTW1l2NeSOe6Tfv8qKkNkH8jRAUngQ3teV2q\nGQg3I1galbs4CV9fZ3UDyQAOdHAtme6WiAsZEXb8iyE4Xlk7WqfUcy5PDyso\nM3Idg3bBakzL/zywkihsei2jF/2GJq7pxfOqTRpixipFRxVL2nuLJKm7Od6/\nw4ijyZWlVMUJL14x4EEQ23EN2niD8DlhTUK3zQiMF1h7ug6uIgb0ESbmJBq2\nosY6\r\n=o304\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"79b09e76e497059009cc9d5dc6894135af349853","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-79b09e-kxhal5o5_1640162831461_0.7519871174147492","host":"s3://npm-registry-packages"}},"3.3.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fe01cd6d7be833608728f26f5dd6dbb6bec4cd86","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-beta.4.tgz","fileCount":153,"integrity":"sha512-e3m6tZgqCLMlYGftWt78YlpCs4+4WdcNjs245rz47Q86orFlZJx05ONo4owZ2wc0YBH564S83418f3QLm0iYHA==","signatures":[{"sig":"MEQCIE1bTuYCzlaDMgOlAILRKe5O2rFj5Ua+C3yI3nG6bgHOAiBKA/JoFW0SNRJ6EYy8Sb5Hpkry8l5YCML/6JJvCzfYxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwuaaCRA9TVsSAnZWagAAN00P/ReVOSYSMv9RmQAeMVhB\nw2KKruYnZhIqdNwVd+zvIKSKX6tZnQSBopNSM84ml1zKD0bIflEb7JLUtrPm\nVov2BK+pMUmikijXcEqZXe4u5vQoV67UBznlcwdqen84d2N8WDdQBtNUFaJG\njRRLhpvX8wWmKpUaSwcv9dhRnxCePj+Q9rkVJpbq9xxZgnV/KOU1WTz15gSE\nCA9ELBXbyhoeexTqwV7vuV4sULPZlCIymXd7UgotTP1EFdlFfecxRzSEVSRa\nDP/Smdn45uhPeVQ11Al2dfyKkPUqmjVGi97gAbfGlISw1kdh5wjM0yqzAY/2\n5XvekArWC0yvgomZL5b21A9Z1ouMUc7zfk4CZjV/IcnTdzwG7a4tw3xnZsqr\na5CaH6SrwwRtJb3z/IH6P8Ntd2yP0tBfi2O0tPSEJYluv06j1jf3h3+2BUsb\nQYmNmFP8bgAl6O7ZlXqdU3e9egfaWUsT8y6iyu56N7vxtA9TbNrNUZ51d8Jx\ncY3wbwqE/3lWNEKupSCHwR50Fk0zTt1W8II92QIBP3ECFAzNoMed2DqTmyAt\nW6bh4YOIqkCSOyM7/ZF1afJ2zEHHPRxnIQ4Q3XfUgHKKI7piq9f+tOkgmi2C\nS8XXtC70RmsR6qJsG+QtZiDnofsl3wXmfDl8IQEfa7yXia6ouBdxA5yGBGvc\nxWUT\r\n=Blt/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0e4b72a2904048dd8e1afeb77f265d72b768f0c1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-beta.4_1640162970243_0.6370220086903535","host":"s3://npm-registry-packages"}},"3.3.0-feature-5eb067-kxhayhbg":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-5eb067-kxhayhbg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-5eb067-kxhayhbg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cedb2b00e07cf9dd79c204e79451f4034bb42bfa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-5eb067-kxhayhbg.tgz","fileCount":153,"integrity":"sha512-2Gjd5LluhWM1f+DShJ3wxv3q7f1LQhl8jIpFrbhgWxlCzdMhkfq63+MsP5dQcLr735P8WMgmUc9NH1iDOAJGcg==","signatures":[{"sig":"MEUCIBKX04EvgOK24ksE7mB4Ijmk7m8o8bfgYg+TW6MmeVklAiEAxGgltPXASsQLcvCFK8FnpZpLaueOi6Nzg2SqE9o0tMg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwuiACRA9TVsSAnZWagAAs8sP/1RM+wdwCtuHKiOT2KGz\nQuAJRLUHH3JJGLwbxFYo7G8ZjDJtfjtntZtvSOA29+UjnvwnxsLEn7vV6ld9\nsIPn2OY+QwXL/o5gUFfgWv1UX+1AFJ/GzlkRFYyf+KB/OalrbgbVhVEICu6J\nYKZsjqTVjqhZY/XWJapy+tDvn+VKBjRmPrBJwWLP0nEcGM/4fH6dPXuoZstL\nq4TDioMh3RZ+Ni+N4fcdwB0nLj/sgIdCYu2uWPnIoKtKNuRNrpMQRUCzq8KR\nZB9M2z73824GCO0J2woD6u6wu7YL3dqcMuckCuN9ri+Rw7yCT7tWJBLX4un8\n8SZHESx5psNT8eJQjK9uOTkSCNutRlvlxw7FVwO1+nzPXQoZcP/Y46Hph9KS\nzcv4eMrMHX/Gw1COLbJvJIAvdkxJ65y5PNgGP9RWB2aWZxIGELW/7lxHV1ID\npjS94IZkW1cHp+UZig0kQ414BxxIbfDPl78f6jj1+1ZrRBwfIGOIflXYqc52\nbmVEG7QzOZH+rPjiqnSr2tfLUiZIlalC3S/FCBijD3Ur2+H+PvG56a00aQm8\ncNEp3sE86/zfZDyT8sTz9l709JhDA3/WdKzy9sBJb/BoLgC+L6p+GU+yTLPP\n4k4W6TFsecwYLczVpI0/YLffj43067u5L34bgR1oYwcKl+vOseMbWHKWDO0j\nziHe\r\n=bFLo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5eb067975d666745b56cc46898d34c0ba2a53758","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-5eb067-kxhayhbg_1640163456149_0.12503927242522384","host":"s3://npm-registry-packages"}},"3.3.0-feature-3bfedf-kxymjdyx":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-3bfedf-kxymjdyx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-3bfedf-kxymjdyx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4ea3c57b368c090685eeade1c544f08c2d31ae38","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-3bfedf-kxymjdyx.tgz","fileCount":153,"integrity":"sha512-NacWc84C/ndbvdlq1ymvcYjuZc8WhUBLPj25I7g4Z0FvoBuHCpjddfvP74Kl6JknP8KOK0LrURMvGufPKnWDhg==","signatures":[{"sig":"MEQCIF44QiE6XcjnKTItKKPy5Xr1IPO0FyfpvMbh/W04DUg9AiBxMoR9h8GFxPbWzpN6BF5Mp9jVkWlMmf2QwpvpVrKwAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0uPKCRA9TVsSAnZWagAA968QAJDAhCkdoAhOeivUUjnc\nYlCDiESJGLpd3XNjzW0afrby7eKasNHdqc6bXYVttb3kSKNR22OKFdDGZnBJ\nerSaUT4vR0I70tOdOazgES/ZUxamP4n43XYu7S0+gkS6vrF8MJ0ykuMycx26\n9NYKOlEm8r8NONm5AM3//sC+aWSgFPSA4jw/CuMImBwisE+AlDI7Lx8TsmeE\naDuXQwhqs7sFKeezvAKjEFh79MCM4BHfZHxxGqj74h2H2bq/tC1Q4L7A2t/R\nFJkaKJ2+p63Ct6y8DoEC3rp89N1YohnBYL2Ey0jmPnvwZdiVnPhtOONxTOPZ\nqBvsKR762mzxna63xmzryoZyKP5CZHOjOvRoILiootwOrVljH+kCDKPTtFxA\nn45f5E2WNCBCLv1l6vDwGuw1Sfge9MUOx/AIlDI59y3WWBacUFg44ItLw+ZF\n/ryDq0dD+414ZGs0U+uVBKMHOZ2fotHrgk2VnNiyz1f13r9hju1uuGub76JN\n7SgrYCxwZGsOk3cs5+E3EYEgw3J3co91diCqeB/UQt956H+m3rAJ8yNW29TA\nZw1HEoXkwbNWFNDR5/Upd12uGwyy7kAdTvLmdvELMt64TTLaahKhBHGOq8UG\nz7/QXqjrwm9AdG0gRWqFWz47lpBpK3aW1/7DcotSwDUxA91Fbi+5IXl3rvXE\nyFrO\r\n=7d4u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3bfedf15c8e6d765ab2c4f31517821c901a0d369","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-3bfedf-kxymjdyx_1641210826411_0.2037219154972778","host":"s3://npm-registry-packages"}},"3.3.0-feature-c79b05-ky02x9bz":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-c79b05-ky02x9bz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-c79b05-ky02x9bz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"db488643fb5b7c66483a8384ae4a85e1fcf3504a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-c79b05-ky02x9bz.tgz","fileCount":153,"integrity":"sha512-g3JMYz5WYLAYnQ1K2xz1o9FoAbUxt+/rK+7EW/RjLpU87+hw6tMM494TLWhfTg2mFHexKr+UjKVG7Lw4Qx7Tpw==","signatures":[{"sig":"MEUCIHYXW1/uQPFZXQs8Z5N3ZKNuPL7zP8jQgL7srYgoboInAiEA9p60dTvKLq41mg3FcceKPDt+1I6tRRfQLihMSia9i4M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1DuCCRA9TVsSAnZWagAALEEP/AwKpiXTD3cDUMb19STi\nGKMZQIiEDd/FfOazE1kEdEyQmZiQt4bjb9XTQhP7oGaaI9hNQxG3uk51R7xC\nijijW4e/vB7k/DHyWQoTZOEejoICy46buN3uQf/TFZTcO+UWAUeeyeYvZ1hS\nhf1dxDD5DDYfVCrPb2DrcNUT18nwyYsGTb/+b2ywUlIyWXoeKp2g5IXXmhDd\nnvj8Mx8fUOA4hkJp0VYRykl/pROKcTvLXGMlo5gcK9VvsN4qbQ9+3I3wA8dE\nOLnTt0p5KRLjfefscZkVWWi7QsYOuVz0HZUYrbD0JuHbhLgm4/8xjB/CZUiz\nyvp/rmU+LI5R7Ex9in/TW2J3HiVMpUKzNhswX+SFOPSVkbYMV5KQhNLVL4bU\nh9d/Zq6SkIHNLBGae7XCWmgcKXlwxmfa7+zdkU+yDbboqgsYZNDP9g2dNek3\n1tVAaXKVFDSUGBEbBvBp4aN+Dv2eLw11A/csdELAMSzINTaK9Fzsx+4+LuPk\naJkPcIvpRbnC0YhsrTw6pA84baipDyhmTnWSe3au0cE8exDwttY5pt1muIOS\nC2qbSB/g6zIOQaEGkYdT1gCbvDVXLyYyb+NXSO10U7TDfA8E+MQXHOVb8zY4\nc8ft8KpHlgWhNXGyp3y6qFkWe1yxkpgb8EbTxUlHAMqruspAZ9YExdUpxTYS\n59CU\r\n=w5bR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c79b059242d21f204c102c620c4b5ff3af4d206e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-c79b05-ky02x9bz_1641298818360_0.5535065175343259","host":"s3://npm-registry-packages"}},"3.3.0-feature-1a3c58-ky06wtjq":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-1a3c58-ky06wtjq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-1a3c58-ky06wtjq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"89e9731f031f1c8bfa78619dd1612e8677e36d9f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-1a3c58-ky06wtjq.tgz","fileCount":153,"integrity":"sha512-NvWjP+2azwmls02DqFRVnzM63Hoa+jogies0d04w7NtzXQJvazFLZtJq9Z0nIUcpHvlfJ4VrQmSh7g8Ajy9ymQ==","signatures":[{"sig":"MEYCIQC5eT9Y02lLd6Nt0HHgCIZgs4oyZaOJswhEC4tpQ0XZOwIhALBEdeCTvUcUfoRzLp3IksLqmlNZiowK+POuAPMiyxGJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1FWpCRA9TVsSAnZWagAA66MP+QCQqmCNojWj49z99EVe\nELM3jxN9PmTdsFiqnnafej7DJvCx0M6prE/PaCsJyq014xHtqmXjIzTNHllu\n0+DVUPxj+qZM7QfjZDkcN9DFM2IvOrOeTbXL7C6q9obAXjVT/i5Q+oTBoLR7\nHJ5/oRrEeDbN2OeJ+D0XweY3WK38FrL9Nv8bUpkRR8MtIvZWN5C9LfvXpZ3a\n/4S1DL8UVC1YV2lPaOxZ/Zjvh+yVn0pWSWn0eQZPfgPhv5Yy2XUCMaOZ2OnW\nSkZRXmPr+swbc5sU+anB0CAzTHncmDR7aJxAYHifdcs4InnJaHU9yN362/nG\nEbPB6xW+Fg/rZNGdsPQLQG2qqszw7m6V2qHLx0ViDSoYeKyeLd3Y2Ubo57yS\nF0aOAClqrQhwXRIieh2n7RP+azGcAwTzQLQO/tNabhJs1zwpvJPLtcYDppYQ\nYlCpqPbouDQgyDSVEQa2Bk3X9Aaj375idY3tbNCXibLqF+TjhK0+8x9h6jCs\ngKGDRM2YRenm+3eYdIGfGo1iaPzVuHmRxJEdsLMD4wr8KK7J//VjvxGxYTwd\nQABhebEFGe+f0ljJMXxyV1mRLHFmpvOGBzhAWC6Itbowyf5lgaYBE7jiVHlm\nRcJTbi5mUKSb/L5eUTjJLM7qPT6VwnOzU4ju5LLoIkZbbGGer0uvqqwc6b/k\ndFwV\r\n=Xt1i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1a3c5870018565b76b63b9a2ae15f1a31ec2c187","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-1a3c58-ky06wtjq_1641305512917_0.9640102033925453","host":"s3://npm-registry-packages"}},"3.3.0-feature-5b636e-ky09s1ns":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-5b636e-ky09s1ns","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-5b636e-ky09s1ns","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"738d86484627fce7a1ed566de5875f4a472df009","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-5b636e-ky09s1ns.tgz","fileCount":153,"integrity":"sha512-3OsDvjyI4CD/6/QERbNw1zrouWCg6tODOt3R8VQZTpZFP4bgAFqD2EA60JFzvVrWmI3DwXb8Ylz1FqlNATVA9w==","signatures":[{"sig":"MEUCIQCjb0W9ktTYhB9uE4soL7o0SWNjH4q1hUdSlz1RzBbctwIgIvAF1rHxOGhzy85aszupyHYQMmJ5VYZSODhjlk4g8Z8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":477558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1Gh3CRA9TVsSAnZWagAA/KoQAJDgA6PXDnmXRIwifBZd\n+hYOrcU+cSxqgyO1+EKft4KfnPDwKgPJI5C1351XAP46TKUjWPuwKaAZOoHW\n6aNah7fXzGdc0k2Jv6PQQM6bYgfJLSnlkRaqJUk52y3IWOmjnH3BE+aB2pvL\ncJjLzDRT9ZvsSX1CxIMqOml+t3GHzL9hTznF6IFmKd93PanizPOVC/Ao6g71\npaMsalxb9GAoGbt+uDvM58VEOskIfIOSUDl3eyoI2GJmcjHnvgdJ2ZwW/FQH\nIsKf1vVcQ7c9rXhovg25xTAArtM0Tz+f7ZbhkFnqcGmQSslHbUfLybA6CYix\nyYBAV72wqA5rNy2wrSF/p0XHZchaqx+HrhDhaNsUWJ7oTA/A5smsooMwf7xr\nNcD291d0HoYpY1rkq3XalzD3ixonNaKw9rA3FOjcGa+OyrqjdnNPLNPtxfw4\nncFys0ts0xjGl/jCbPfVFFTUFpyKnP2DRoGGTn/xHYv8LdwaBboQfU0V3Ayr\nAtc8jnNEk97r2nZJ4BIqQdX55oQ+yF/PCWNvf2+5AJZKyRXmyUsg2MhgYPve\n2l3fxGyVQBxqq4GhkuNF2jVO+99t+ba3CAtrfV5/ueaUTI/26wJy4gH9B7tv\nRM28r34ByVkk8uxQwei8TlZ6+X1QY1gd6khrkaSUYy6l6CK18A6hL5OwOBC7\nCDSB\r\n=w96V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5b636e93a22eaa6e930fbe4b3099bb228d3e0b57","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-5b636e-ky09s1ns_1641310327418_0.800665623659776","host":"s3://npm-registry-packages"}},"3.3.0-feature-0bba0c-ky1irvm1":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-0bba0c-ky1irvm1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-0bba0c-ky1irvm1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a5fd579e52b7a1bbd84a5121edd1b201c192ce53","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-0bba0c-ky1irvm1.tgz","fileCount":153,"integrity":"sha512-m7gb656QROyNYBbW/vgwJhWVraseI32711IuLf0V0DMg9G6deE/cVnskTiq6xioBzOwucJyG7DkiRp1X2C8Spg==","signatures":[{"sig":"MEUCIQCgs6sjfHhrcQ2uC2DFkXWNzqsy8Nh1A62KkmzG5YcM8gIgTVdMu7F2MZWZP8r42ueZNCw12StGUiu1A/sxgTLSjZk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1Y+tCRA9TVsSAnZWagAAw+kQAJzZZ0K2zK/JrF0b6mSr\nHBufBq71NMTob7XxuWi4R1uO0MJKBVshPJi3Zq3RXD7FlbB9QREAQTzKRT34\nKepC4iPJpnClTXmhU7Lrk3aVuMFUmR+frJtWBwOGBbl8PLtaEzIxQP4MzHee\nHFKmKAUEJ8lm+yEaJjnkExMYQ48MNXrTo7woph5Zd5ZztsypUghpFC+OZaeW\nETC5XOQWkBO8vjFGZiWRfadWNhT0m9v0r5foQNDk53wIwSD9vWO6byLUFU+A\nqarh+/+XcBHjy9UHCWFWfUTlGNFQO+iNK9E/YF/ex45lnoHZtYikunZ1MEzl\ng2XezgAs5iKoSPJbdBdz9kjSHelFMB57e1UvvsEKKAQOTtkroudWz9WR0M/z\nUn4WHy684Fnq+bVHLRgOxVBntl1+R2EcwKWQA9jeE0hNgWvVz0vUbnIs605U\n6XJlq9VF22oGFdhqntf6d9/DZwOV3gmftJqr7hEV0YADkmOAqzhACaGX1Io7\nVJVM/ov9ThyDiN3qijhhBSoljjCpLA9C6OaMk7IKXZYmTI7y2vpYNT8Ra44U\n2YHbZYK5pC9dhWJWIbzOO9mVVmqwKYEf2BFFFS6/aB8R5BoQg2mUZK34UfAB\nu5sBsGCn7YWFcNnVzxEruwyReSal7HVWf5cA/OTBy6Avv7LoNzuXyLcB+K14\nGgje\r\n=XTXz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0bba0ce4a166a4db87fb4fd76e9de45e97b0de02","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~payload_expression_for_call_activity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-0bba0c-ky1irvm1_1641385901294_0.2831326204622129","host":"s3://npm-registry-packages"}},"3.3.0-feature-636ff6-ky8hgn14":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-636ff6-ky8hgn14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-636ff6-ky8hgn14","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c51421ff1f85bd2923028789509d6758eb8d0c15","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-636ff6-ky8hgn14.tgz","fileCount":153,"integrity":"sha512-M8ZaOx06hC/hLqofPOmqfapJ7ZC9y44upK7s9d/k/JBjrBRdWbhCdqmno9PxV4/4aV/kkUgT3vIz1DF7LBmSLw==","signatures":[{"sig":"MEUCICDoKMMzRJrsqSPr61TdEe210xj+mwzmZJQ3S1NAUGBwAiEA4Y/f2KU32Jkr5+lY0c622lYYHgghHUEv0IFDf1P6HLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2/x0CRA9TVsSAnZWagAAL50P/iRC6xQn0quxTG4S3+6n\nNO4Z14qw6JxbfpMJfQ4oiZFqdDo1gQYR0P/5QMGWVLbpn8L3QuQq8mVszyjI\n2OupJZg6rIlzyKMQ3uNZFQNgqAm9iWE3QA2d8THBaKdpdddLzmqgbhe0Q3rv\nd6UI83K5itUQNm1c0805L6a1ZjXxNul/k+6NPcIMGFTScvBgwaNTWRVTFl7r\nWrU9eDlVuWN2NNmNLrA+db5TvXWNQiWMFkv402iPseEocO+2BBmvzvtVVPM1\nJF20NILsnxrQ+HdAot+H7tCaZaxCPSRhxooeiH/Ys0iKI/onFub2it8jPSsy\n4vYqJCQHsYxF0ojgJD4H/YVzLzJ6ImoObQ3SnTWvpznlbl+0KOc1KePNvIDN\nkHqPiqUyLVLUpJTExyj5Ww9+EpZwAmNm0No/OO8GJUkZDwQKvzftAhMNjLwN\nHOIYGcoXXi5R/6I8PRjbf0ZXPPTSpkzUdfNbD7zLfEnSZSxGu/VT2+Pkx+Pe\n9wnm+K44j0kccaCCSj+NcamL3J3Z8UwkOiLRiNVE+FpTWIRnWAfdG5xDYw/F\nVS2Q+0eK37vqRbkxXt0XnLTXbciJQoUAldN0NczPgHQJRuo+3qYl4CDjRBZk\nRA8dyeilxnH1VY0bFrRSimJYMWagnw8sZSNHp4+vCEARloTGZsur8fWOqeg1\n0s6/\r\n=WxRE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"636ff6fc2cfe0fb399ec6fd41d6497c5a82a397c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-636ff6-ky8hgn14_1641806963993_0.13925034442837303","host":"s3://npm-registry-packages"}},"3.3.0-feature-b85816-ky9rt6xv":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-b85816-ky9rt6xv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-b85816-ky9rt6xv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fb1b2a9475092806018a3c8f19ced4793024bbbd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-b85816-ky9rt6xv.tgz","fileCount":153,"integrity":"sha512-ss0wklvwbP5fBI5H8dzLCuFlkNa9/55Rlk+9cT9xPxaGqCGkUxzgfPgiXB2TggoBAWAgxC9ZznC4rp7xwWig8w==","signatures":[{"sig":"MEQCIH7ibFkmYujX6lDiH2+dHlLHv0cn6FSW7S9VPSHqqsdzAiAi9iWcfUc9pZTvWjes8lREbmgVZlz2r03TQcu+so3s/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3SyNCRA9TVsSAnZWagAA9/MP/0ENdqGc5LRhz7EApEv5\nOIHTmpAGV9t6H3ckrrtMp9h59/bA9wRVRcHQsbK4tKNbySkxwq3LsBmc2Gs9\nTTvKYRyu942ZxVoanxKUqlDa5E4fF9OGLrniD+ta0MbumPukLBRg9s+XpVNH\nO5FJPrJFLCpotlbZ8rgGQPXhbV+J31WN0pBPPufdUqG8g529ZeSuik9m/r4/\nWnL0OxGxwbnJ8YOdsI3pdpW/yw4iKG0HYWbBcipSP+vnP2qe9ejka4wau4gB\nftC4OUeA5lDZzyM2V/bujUYl2VZUzT+7le/M6+hwcEJTmARuSa/6BA6pbIom\n0U83UbEXLo4Z9rHac0hTvJZFmtYBU9mxBj9TrIw+V/OW3bxeiA2nsriAJMDg\n+as4SKi1W4WCLyr97jFMY82ShkZjiTjOyCmLNSUTy/88XPGFeiYItJCTP47x\ni2w9RqV8u58v56+muNGmqs//cH0ivzDEol8uirOttoG9LmxyIfsK22R60zG2\nuwCmmmGY8PL79mauYe54WY2WpsjLqs/XMChVzSBd1/fZb3wUmXhvqgvxdTnz\nYKBOiY/nAcqfE/Hd7ZNcwBewWg2GTF+bKWURtAb6j71kfvB515ZPk3uCn1Ho\n+4o+venIeRN3jF5ciYdPrxMHjiY9jevjkVSSveHrt6Wvulg81WTtQAL3rmFh\nYsWO\r\n=yAnq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b85816d86891e0dcd9ce622e0076b175f75eab7f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~payload_expression_for_call_activity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-b85816-ky9rt6xv_1641884813315_0.2762336906659313","host":"s3://npm-registry-packages"}},"3.3.0-feature-eeb1ec-kybg5ahe":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-eeb1ec-kybg5ahe","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-eeb1ec-kybg5ahe","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3fb4fed102093b8704053e10636971186416c869","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-eeb1ec-kybg5ahe.tgz","fileCount":153,"integrity":"sha512-eIFCRqQCzg72dmps6kzc0SdUxNrEdv+H3eWsQ/3QnXf5Nssl+/Z0dU3I8G2+yi9mUx/TmUvrOyYW2stavxl1XQ==","signatures":[{"sig":"MEUCIQCFDbsX7fzPb2Lmgg6BIOa7noDF8lr9SqOBnKm90DlAuQIgNhPIC2wA9nYXf8MttDG9PRK8bpnlT6FzmlTktM3hF8o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3rhrCRA9TVsSAnZWagAACXwP/i2GLzZcaQTNKaizIdCK\nd0p0tZLagTSRW43YB5bnpzMWp+8U9FcSNfBk7vvY+J+6yEssBa7rQNmRaeAO\n+jnKbg6yYjBl7JG/zQM3GjgOlO+MadH6NunbY4/Sj7gvlh0uY7hPsRGpFEQa\nCGRdJxE8hVnHWpBCa2oKU3marXnfh36iUXWW5iw6YhG63VODqPnRHPejlNIL\nQf3xd32uyvQ3V4dIF5g7BdZ0EuwWfjDVdHaQA/BDMiP2G++yrxv/ZNfSSFlf\n7JXvyPAhny6ZPVWYN0G0/0SsB69TWzKFiabr6F6osrDIpeWNQrR5Jt3SXtXB\nj5mUx5YHmg1xHxGJV1PDYQHMx2eEz1TYUwg/I09LAbu7dr3jGWKDa61+smYs\naXeAUhngi9IeMtkj8bhUprQRDw2eeKybJhY+bLY1efnG4+ngnMnvHYQP0HFZ\nJcxpSIErsG39eVc80rFJnpPmXSbPutcojrJ2uBUHLo15jVxRa2HSjSNcifYL\nJR69gsccOPX9kaOHZiS4YDzvIuzyQcmZ3hcfdk7JtO2VZzaZMK5w11p4yOQx\njdwls4IyOq9HmTN0bJcRuB918S8aH6M+XHj8Vd1LMZeB9ql4dZSVqTKkQP9y\nwhS2BDhqE4YDvgmbfDRy8Av35rmCHZd3WuHeEv8M2MJy00n/HDhov9ISQhOL\ny8/g\r\n=cglB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"eeb1ec22bf9d3754d88175693c2681742763b301","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~allow_reviver_func_for_deserializing_json"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-eeb1ec-kybg5ahe_1641986155283_0.5044909154475083","host":"s3://npm-registry-packages"}},"3.3.0-feature-542acc-kybgw0kf":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-542acc-kybgw0kf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-542acc-kybgw0kf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"125a2a15d051508cf03ad8276be5c5047fd9d3ac","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-542acc-kybgw0kf.tgz","fileCount":153,"integrity":"sha512-DqpVDxjKseDkTqFoSRvdGdmO6mN6eeqMKn9JwcjGOKIVh2XqdeuusbEZrVm/GBUVBj1KDJh6IIVFwyan5gXaMQ==","signatures":[{"sig":"MEYCIQDaHbEd6EB4BCeXMaJKroHQilQ0kSR0+OrHIELBldpbsQIhAMbN8jwHvzUbPswKaEB5PJwMrRBKVyi1YuruxFzgvy4e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3r1KCRA9TVsSAnZWagAAIDgP/0jc9a3/QyxMQETt7dCu\noGjuHVoKHQ3P7RRDRT+AgMQkAB8cJGB9R+UL759qEJ/DQYuy70x8U7tRnUar\nYvttPgJbUjIiZnWfkiMdwhu5kodiIG4pVswQYVuu1djELL2eZ9IUFZKpPjMG\nSjARTaFrSz4J/vIhOUuDRQ/ppaT/CYxJDlo8uLHLn0pwKK82/6gzEaJqfYHM\nEOlTrGKJJRPHDlr4kJFfKXN7Hp+u3ATQflFfHhj8k/rGi2peLv9f9Vw5xDwS\nBFW69AehuKwHDxYqjEe6B8TyI99LNmB06gjgRnSK3gJtcIy3XOMf17j9P8W6\nYY9HOjG0C2UjKy45NN/iol41IRVJ2n7R/sOCp/8l+1NIPgjn/UFUMQK49TAp\nsCjixgQxmY46Zjf2vUCvn2KS5ft4ByBr+FoK6xV45IAVEp7ukLSx5lWj4ShH\nUGwiyqLXeh80vsEx/jn2Ec0RolWvrFs/vpgORVogiZcBJoCrRJrghGUtJ2ia\nlFw9DHQ1W8zac1JH0aHnp2VPZsUOmclxGpXgve/FKgfIpxlT8D+xlpoCZfjQ\nOWzis/c35fhGkdMmt8ytgDhp4/RowfW3qd+ix0iYF4IbhBAijI0E41OgJ/UQ\nVl+Cjaf/h7XLNSp8Z3otsTpgM3yxLGaAfGfkhNy3spLvNbsSG2a1Fc4rz05l\n0A5K\r\n=Sy/l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"542acce6558e7fbe814e39b2b27bf518cdffab9d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~allow_reviver_func_for_deserializing_json"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-542acc-kybgw0kf_1641987402811_0.8814229020148716","host":"s3://npm-registry-packages"}},"3.3.0-feature-ddc842-kybjbajs":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-feature-ddc842-kybjbajs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-feature-ddc842-kybjbajs","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"04d20ffd9cfedec2811b9290bf3889f354f0b68b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-feature-ddc842-kybjbajs.tgz","fileCount":153,"integrity":"sha512-om7I9McbPJvQiu2IQDc/1TEON6h5CZAUUGE5+nwLOrdhADhLw4TOaWiil3waZiz+GbcA/P3n7YibufmF8r4m4w==","signatures":[{"sig":"MEUCIQDeDpFClxx5Kwz6c2XiKFta2/ayWVDVHeq7b/VI81++fwIgIHsjwjXUnKp+xSgufUm1pBJXlz+5MPf52y2wDjrZtdo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3s0tCRA9TVsSAnZWagAAQLsP/2DrtoTNKVnLxQ1OiaAL\nQvyVg1BDmsBOAfTh+op2mNTLsBn8L3JnqIgIRpFqyoyqJuePNrcDwfku0Hdu\n9yt+wPqihyZ0TUsHVKXbh1V0gEdZmNamZgrDdwRXaud2azltEZYXeTjbrVCi\nCYsCH3M2qKm/ePcR+Y6snRs547UHgMldUmvU2WQrqWqdV/7JsdcUqy6wWoEI\nW2P3TGZyxtBhCf/ujRgs5tzY/HF7XDUMAeIZXvkYF+bS0PnFnk7mpfxp/opG\nuA5OpjQyszYbNq2kg9kzqOl4+Aok/BQz9xFyAyywF7Ay8CBY7mK8G6mFS8eZ\ncu1JiEM42lARr9djd4YHiFh+4/ot2GlsaGWEhgtPnr/PIUX0Jd2AdH0ex7DS\nTYzFxVOTWuOC5uhg6VOrRUxH3zaEtauRHhsyUeNYzDGVdka8DTIgXrpcUDSq\nQUL26TWtodvuX9OHw/tLYGZl1HX6xRWYqINCsFOv8dI0w6k97OtKNXJ4umtz\nQk17MPHcY/FPhk0P3jqBSXREoNBNt7c/TlQtNYECLE0GXKrjHdAXnohiX6vl\nCD60mQR3ZWDHOuGNeiZHrP6kA+u39WF8IEDINqZ2iLZzs1xG6pZHZW8H7MHR\n9yhTXYj/LoLSgd4459OWzpHB6zihi1XnqAPtKSBRvjLpBU49nKFPWeNhaVM2\nqmyp\r\n=lkeg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ddc8429c402dc9dba35c9cc4e027b924227a3621","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.1","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~allow_reviver_func_for_deserializing_json"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-feature-ddc842-kybjbajs_1641991469685_0.5787866021171484","host":"s3://npm-registry-packages"}},"3.4.0-feature-ef822c-kybondbm":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-ef822c-kybondbm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-ef822c-kybondbm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"46136108308a2ea41c6119773595d852fee90c01","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-ef822c-kybondbm.tgz","fileCount":153,"integrity":"sha512-gKaG9Z4OCxIimXkRtT3y7BSII6a2czMJX86aZnzYKhLe96SsmvYfb8cQf6j+s2xf2HUTktRFoHNyfemg6OFHSQ==","signatures":[{"sig":"MEYCIQCqh2JqX2Mn4P8amczO6aiv0K8+Yruf2YuaM5b5AvJkhQIhAOYf6zfMnJjPt9gHvQneIZpNfY8L4D7elp8QvKf7WbP5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3vAyCRA9TVsSAnZWagAAuxAQAKNzKUhr7pZMSiqhQ5gX\nvkcDb1Vgp5GloGbzB/GKhrU1IQ89G7I6/WVTHQ0vh6APt46Smgq+WK0GWO0a\ni5nN8wpyCRt2lCjWCvYNGforWw9ex53UC1nr6fKLhCif4DtPOCwWNcMBNDUO\nhN4k3CM5L+qTXhdCQYoqo/xgvH252Bq/94kB6V/yBTTCgOGm1HpX2FU9JFry\nwVZh3ICggmz0bMDBgQLeHNMTOjV19t3G911XawsW4IiKn1eDLdFN8XE2e1Tf\nKsa8/R6+fe0jLo07PZEDc4tKxDeWNanKpvXWiiHj+YIzsQ+IfcsfuY2h1/Td\nG5GROp6O59DuZbWE3gxW5yySq29MeBJFHcH/6YuNObs/KtOKXGTMKy+gKFgg\neeMNyIXt8EGGbKnV6yzZAF7caPQuE1AN1geCgQbRPNV7XRRqFZaPXy2kupW/\nDNUK9OA7Povb2MfTdnQg7SW+mdpMhK7dAIpfmjFIHDOBd0BL+EDfioL0I14U\nAuzTK6soGU7wsr/Vp3Cj+nVICr77RRSYVHM4mOkNUq/pEIu4QA9vzzkE68/Q\nug+U+H4bBfwKqQya/2DFhggV3zgHib7hYFWIIrcnOhhp78Yq10Mbx80smpr1\nrTqRq4YM9YSSrJfSs92tp9nBAG5A8pKjrm+jV0xQTSP2zIHPlWmPmSoUhctW\n5MdO\r\n=S391\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ef822cd4e2fe4a56e78ed0bca6b5355725bb0b77","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-ef822c-kybondbm_1642000434740_0.009416541592592198","host":"s3://npm-registry-packages"}},"3.4.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"723efd66f387549bf7afd29937133bac8dcb2a55","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-KZSJ2oQkE8alBjUn7TLF8OQThWVEYl62TC4YOZGQ9udiLFXVLScHUNTk8fdUDh5R6g74gNuFFBW5ajt7qw1AEw==","signatures":[{"sig":"MEYCIQCk6/omcMZ5JgJSKbp7qIq44Cts8iCqP6+KsMtTcpDqBQIhAIGznN1pkQNbj4Wrk0r8b0waL0HnX13z7AoTAxlZMdIL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3vC6CRA9TVsSAnZWagAApRgP/3Gxfd1vlOxaxQDVun4j\nEuRwOxx5QP9pu3JSn3XIrGEIGddtG6AfRAi4lnh73ebJsqgeTEwJScf/1wRI\n2MxTPV0azXGMLhb0v7KwI/CQITMa4vFnoAnldbmRjSbDkWEcH9DuQi+0UDie\n9FbRNkmmb5o6TW0ivXbPKhFCL0hc7XzWZikQuKaSXQR1b2GfivX6muRY5d1/\nm1rSAKTiZRqILwP/ZwyS1R/LG0Bg0etbRK3CoKyIDIrwTUnxKj3h0bhgOAIr\nX354E5OsOYACaeZQR+jvc7EmUoIwI87F50HzOR3+j1PtdMtIhY+0WpTM58qG\nNg77+yIrQOkqJ8BZV/IRsR12kcb9DMmupVXck9vwpD8rBpo88utIzy8x0nqm\nliNYjIB2MhKPLSQ5oKIkMP1rTnLXclGJ8kMaiS1lPsMu2kOSDSr5uqM8nF42\nhFOQNHvg5sGxdpCuLl5xzc8OiZ3Kw7RxqAELDa+CYnvJyKscvv9BbchD/Fht\nR3LMe39Io1qwdQPpWvLJeIHDTuZma5GDhRt6LEgsdXXhOdCcLSNKHVnFWRAd\nHsHSFwGA/ssJAvGvsJT9ba4/EDyQaAes0dhgztCoWTNQ8sLPhGgxc7Bhyxt6\ntz6rHROnsXffKpQvcZNTFRz9lDWGNiO/k1kfd41voLErWXzFKZlSQ7S10zll\n8cxD\r\n=gw5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"300a44976555fee45e72b884bf3a9d5547995ee1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.1_1642000570414_0.3746258742653834","host":"s3://npm-registry-packages"}},"3.4.0-feature-0f7d6d-kybsjtr9":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-0f7d6d-kybsjtr9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-0f7d6d-kybsjtr9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"471437fb789c44cd0357bf81ac58edef1de2ad2e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-0f7d6d-kybsjtr9.tgz","fileCount":153,"integrity":"sha512-9/1GbwjZMOXLCPgLKyl6I9Glak9i3ZeO8yI8kLWIdnxZ02TjxVh5vgUKk1bkCgko/LtlNaGj/k7OUvYwKPtBpQ==","signatures":[{"sig":"MEUCIQDKFrZu+LXdbu9RniymvYmsh6BOpxxUxdnEBYoQEd+RuAIgW2Dhi7dXEPibhmSYOjP9o6lzvlTNHLSHGaMFWhPeIxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3wnHCRA9TVsSAnZWagAAqxsQAJlvBGwjzyg310yGNl54\n+GxvggEextuxI3wi4VbwpO+Kj7HXkeo+snOJWmHuW+rr3sVcx1A8wTVRlXqm\noNzShP8/RiE5AsDL0hbIweRkIuD+IGmAaNPYC7q25AYaQAkYwcw1Awp79Jcu\n1U9z+N11zihQH35kQbe63ToaWPzR4HfghO0Z1frVUkgS4YRqZleY8O4Ol+9D\nkIwFp5RAm7HSZ+h2UUBfZsusWUZ2yKVIw9esuI+WzClRS1IVPs9AgPygssxa\nmHUUtyJR3oyt8V8w6ey1WmNLvRRP6YZwcyM89xIutoIeL4TDbeqbTqHb2Mt1\nWDz1k63lvhM8XnACzZ/U3WHCgcOohDemMshO6qbz/M5BkCCcVSpSK6o7+WPN\ng+zP6CrTdmubNPbcUepvS6C3Br6ouHya2IziW+B1BiokfXuSXuB95m7jhTa/\n96T92mlt7nOSOWn+KZ9CA2fvdiIgDyf9LviEeIww/UdVWIivQAWPbsOLy5aB\nB46dQgEBeufPQN1Gtoh8sp+Rw8pIwx/jwHf0TQPNjWddiP6Z+QlodvW2146d\nb+QNnBaGL7L+WyGiGwMO7j1ctYZZC/An5LnG3nMPpqcH/5LrYsXZD4CXRDeT\n79v7cA7jSYAxtlrXGPBmTwq8JD3BqsF2HAa6JAm3PB+1qUnIDPVkVNfvqM8U\nSWk1\r\n=8mfU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0f7d6de639a2ccbb6e907667536e4384bbd698d0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-0f7d6d-kybsjtr9_1642006983825_0.012221630169848785","host":"s3://npm-registry-packages"}},"3.4.0-feature-aed2c0-kycrao3a":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-aed2c0-kycrao3a","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-aed2c0-kycrao3a","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8a8c4b6d7838ece3c831f76f8dab07437895ae87","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-aed2c0-kycrao3a.tgz","fileCount":153,"integrity":"sha512-nNldmaYzvuzltYb0RKp/Zf33MY2Aic+SxHDpmjkKjvn9dIQXVALZ2DOwaZWqSbQwu7NclivdD+G6MxpckYfNHA==","signatures":[{"sig":"MEUCIHT2/bDNJcTWxhsM8IqTqfNlC+4gqVKxXp1UAd4584TiAiEAobE52lnGHkQgkWh4SdCfKs0UE+J5ZsB+Kcp50yo8aWE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":477510,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3+3BCRA9TVsSAnZWagAAdloP/2/fKYqDIza7p3sIcoTc\nv8kCfOm6BN2BJjY5wnWjB/1MHIhvHcG/vvMUrK/K51mjXQywBl9Fdj248s8u\nVOmS/Z6TLS3tZpwkkbJ0xgrp11WNXJ58cLo1hWk1UW/hzLlPwkNOF5OJEg/d\np9SBZtdoGH5oNUC4f+QRrF6nxP3pEU4acqMjZUCHJTmewpgMd68OltHSZF+K\niGLcDwg5XUhTrin/MPJBkxqjDUcRGU3DZ/oDpX6CO+adRH2zaXfp+BVkJien\nJmWQ3L8y/G5aYdtgITyLdxo9m0yTwwMtUWk+8VD8otznH2HyhrwEGDEpi6SM\nQfglPzqvnJ/IOsmIgYrXmIcx8WKw1kVvaZh9IY6SEcZ7PWUr9sexMUjqTt7B\nlLTfUSnXw0lyqHCfPqvu4Lb0wtDsSs3+0CRy1A0AxMnt4YaAAhg07O2U6cUr\nafslYllWMjKxBmUKJac4nbxw5mT0cF9ltrvYtfzptxPISxYxw3maWwHw0sP3\nC+84ADyudBK8TVqtEMuT03+3yScSvtm7Z7SQgjEyRUm+RG/EJTDVOPGJgAly\nJkmOToChPrzp7OCi7OiADuzZHQlmkaK1x68/vKk5AhwVynMg1p6x6Ir4ZZes\nUP+yrjaun4Uzz2JOvgoXVJh9JfvG+QxLo52H+RTLbflVS4xrn3vyK8Um+bQ9\nPjZB\r\n=8Pam\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aed2c0e376f72274a37626ced33268595bde005d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-aed2c0-kycrao3a_1642065345239_0.6174556312208439","host":"s3://npm-registry-packages"}},"3.4.0-feature-918d65-kycro2i2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-918d65-kycro2i2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-918d65-kycro2i2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e3c91e5a8d9af9c069d8a248674dedad50f94336","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-918d65-kycro2i2.tgz","fileCount":153,"integrity":"sha512-QsH7hYGEXvm64dZAzcs0pVYJ+XfaVWOpAqRwt3c5Kqmm4jdPyNWH4h7jEgFquNwxCarEr93StUYACognmRW26A==","signatures":[{"sig":"MEYCIQCTBuRhR5p1Kljvbk7M/iocK3sqpgBy8DHT1CmdPa/G+AIhAJOmTeixLWjZRMOmHnsKOrw5Vrf5/Eg3Wse+pf7rMnDR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3/A2CRA9TVsSAnZWagAAhhMP/A8Tv6aDuy8I6MMIFgYu\nk5cutgFc8CasTdggwOpfnjpi+yKvnU0QzP3bslMcHKhyGbkueQaKxJCZS1rS\nrNQmVBnAK0PogMRQM1YDxxRxZlU02y/gvObby7Oytrmj4h1+T69HNZT3pzEt\nD6EWHmil8bTpypoo26u6yk3qo+XBtPEgfu7UEn/dW77B8KZBgc/TB8xGlr3L\ntDyHVKP8gI40Q11+kMxjJEb8QfZNiQXzPfZnqs82Ox27n3S454sTOhP2Eule\nnlMzWQcu6VrCXU2e3z8eMj6PDhoiO8styQz6wz7q5q7zsGCokwCXwFWmfiVJ\nsFJLVP8PgMGwJT7V7UNqkNdia6IMmXgeQCCxEBjFBOFKto7WriLl1URQjtif\nz2n038lkSBUWioXDZpb3d/y8v3OcA3zPUTjCNfhx2SNq9KWZO7WlB8Q04P6R\nDej/0MqLCHeRlYRzkjjb2PXLW1zbnpJaaxk4LIN+iGMdQpYWDO1YiJ5pydYD\nGCmRj8Z/xc+JEuR6SghnBhpRWsXBdhFRvuCZ0QNVTUt36YZbKKygf8g1szkB\ng66qxCVQf479oSKRQdYhVMgeJZse7+sZWIZB0y+PEGHJpgxVobMJCi90nVRX\nu2HAVeAvR6nD30PADHhk6mrfuTv2YX1Mwny9Rhc7DATfhH4PogSgBAtiEzty\ncmHs\r\n=LG9t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"918d65fc99766cd0d67948527732d4f41a9bbd9c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~payload_expression_for_call_activity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-918d65-kycro2i2_1642065974170_0.20363258007104945","host":"s3://npm-registry-packages"}},"3.3.0-betafix-ea90f0-kyd131b1":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-ea90f0-kyd131b1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-ea90f0-kyd131b1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6157212b845d96b682ae98c5206ddb5a2fdea03e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-ea90f0-kyd131b1.tgz","fileCount":153,"integrity":"sha512-Hm19wJWZwcI05FjrQTDyH4QI4AFpofxoONX0i0hRLn7X5GTj9SChqhUQvmYywodTr25HCgnhIJHZmENHT1on5Q==","signatures":[{"sig":"MEUCIQDY635cfdafTJLLDmWOKAgRgZsKisSDh8QCavnd5ErNMwIgEB/T66YP8ZW35L78xlAP26CUMUfdfNYUdp812hCMgTU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":475642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4C33CRA9TVsSAnZWagAAMV8P/0TrZLMqBefpP0ZJWjbf\nq4n5IfgclDKTVI+cDmCTJOdkwurBlkFvzbg/ftI6pkimjMKVwC5BVURXTh44\n1FAoDSOYFRAAdlLYR2eI86JfhwUXWo3cYXTPW3O60O83EYHEqlQj2rI4QE1j\nUKiTzr42M30RN1bHwZ1PHliHCKufRnij3NjAq3WysW4/6vmSsYylxsudW+ia\nzFQpuTYoDQrqYl44O6OY61SM3Q7N4VrB+P4XOAtKTh72sdZI6tmdmXqjmyhz\n1yRDckCe8mGKbEYRC0C6wbuQDHIjhSuaO5lXD9eB21/zYssYEt076FrVanPs\nOMo4/oN2xBJvnzZVI/UnFIdpuplJAP5VppvKvSQpVEfplleEKmCud3qj0iHL\nY3dPOfJ/Vo9eqeT8qVpBi0bIS4ia/YzYuUZE5Vc1ugbfRfD9CmcuiN4/aHCd\nh2+YfHZRCoFzUH849SggHLqRA43ldeLvRwhrT6ScF3IzK03qk+Xfm/QEAVHd\n/oWJeeMF9yy7QUrQfE9I0GoNFCuD1nCBYqxWAS+OA5AB5y6jbDCIfafto2ss\nAA+fJHhY1wMbUu2fzf8AN8VkLdEnGFDIWBE4vhOEylfdyMQM+p3e+yG69TPn\n/y0YzjzsvP+lRt1dzFBTmZD3CmZm7rSFu7vHk7EfSykJtbAzpRveYcRdkCMj\nZuI3\r\n=aPDT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ea90f070d3d67b5a452c7dae02e58930f3a1dfd1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"betafix~add_notifications_for_toggling_process_model_executable_flags"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-ea90f0-kyd131b1_1642081782877_0.3961197856059244","host":"s3://npm-registry-packages"}},"3.3.0-betafix-ee339e-kyd1lm72":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-ee339e-kyd1lm72","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-ee339e-kyd1lm72","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"33fb6487a01d93a4974ab9054dd7ac28b54dcdc0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-ee339e-kyd1lm72.tgz","fileCount":153,"integrity":"sha512-O1s4ZohjpqaRBEyqJuGaaOrXnmM3t25dFAJYXa4hUmlDtyVNDG0MS7y53aVHp4cqXZaTWbuZvmd7bSpSSNFkXw==","signatures":[{"sig":"MEQCIBdlB7jKBws0mWhIAlX82DpdvkM92mTex6hxFCTFokp0AiBKsxWNKEhL/ggjyFkHxthX8qgf9CzP0ecb+qf2A64Bwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4DFhCRA9TVsSAnZWagAAq5wP/0lOaB5fIGFvtk3m2IQX\nkpi0/0DtGHmZEKH7kv/U277I7aOzz4cmD1NDBcpkFKI878Dy0aTgp6oXipeS\nYNsdIvo88QPdW4Y/SbWoog7l1b2nHZgsLUjug3B6ADk2fdUzXHSb+xKmaBYk\nYO6LbOjxA6i6fyw/Ch9sUbI43h/R2TDEF79EvEQfYAlNbIpUpxBd6eE8boXN\noQYN+Ms91gqsbMdws0SjpFMshFwkTVaIy71KKyuPLgW2C1hRwUp71i3kW04D\nVbyiekvSiOQ7ASpIrX3/NamUt636Kk4njdmlXfevhF+3zLk5WwsleMkfyguN\njtTUIIpvV0vucyCPtFFH4s7/UpvQMDguj7Itrpoe5cq905eeDPzPG/LDd6Vx\nccSsgsW+SAD26bP35dHo4bhFgb8d48HJ6SJWyLSwiKOqbkhBqhcDxAlhf896\nSZqi9sNLi+oTcKbb0MkrT0S5DAj1WT40FmFSd/sAqj2o4VXr4ZfoBs/7ugTx\n79WO/duSuClAxHINnaVcegm8VM0AzJcBHFhGEWFZw53ASsM2mxp8K/zK7Us1\n6ML/MSors5d7WGP6c8ppALKChmhsu9SDETC7PIxKvA+MjckSJg0LgiCYUpMG\nVdDnjSytN4KudrX4cZjabnhmotNZwmvvtjcNvMe0jjlMh8YVKNdc+jO3Vzpw\nEMvk\r\n=axa9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ee339e15d429ad30bedc199e6bc5f2fb34298454","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"betafix~add_notifications_for_toggling_process_model_executable_flags"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-ee339e-kyd1lm72_1642082657434_0.8036051832694868","host":"s3://npm-registry-packages"}},"3.3.0-betafix-d8f8a0-kyd29nq3":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-d8f8a0-kyd29nq3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-d8f8a0-kyd29nq3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"af9cc962e48bcb6c757af375cf0c571c99172828","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-d8f8a0-kyd29nq3.tgz","fileCount":153,"integrity":"sha512-eeefrW3EuRicxm43LPdjUW9CZ5IFiQpRaQiuPK2xcx4nU67D6b0Dq/FiXmhshUBhG94K7SHsv6lvNGVVZ5SxxA==","signatures":[{"sig":"MEQCIG/EIYbpOPFQGggzF0TcrbbI1eD5fBNB9UKxMzusIHKuAiAH/YkB4uy8tsTogx+UtdziIVWCAkuKbAy72zQTGFHbyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4DXBCRA9TVsSAnZWagAAGMkP/2RSphO4z+xl5Iksr3hE\nPRNXRPlEU4uo3fAgY9BOycaop5zr5qIfX0zK8wRo1wd2rqoSRan/obfDgb4F\nzuaiLkBiunU0Kzr6InGwX2+Dv3itMfqQbu+E8kGI9hfB0C7RjuDNVsdTN4ea\npcq4eRE3oCsTFb2Qr9W9wuy/LJXWaMbBFb/XFNlx/8sq/rPVn15rtv89HeGX\ns66MY1+d/h5HEPufKEh2Ns+mSCis0evoZXA5lZcoTuCPkrCUc+S4tQBjXqXo\num3fdfQ+EvtiDZ9UI7H9HMr/V3hoObXLWOs6fNgnonEZ3wNtYJFD4B4UnqQT\nJgooPsOKcIftrOvRdZDY6MtnR74SX7Km68wpZpQ6PP68MOmbF/iPvyVtmkj6\neIMbR5N0NQi28HgKSFjRxFO1RoCfbWcAM2NSe3oHmhdM0shOyWUT3Ehdcadv\nIYEsbDUYyn368SXAvwo+L/vvzK8fyjT9SaJefMY08SQ9t8J3gj0YjmbCq7oj\nMwQQdc8TFpH1h+PyqVShODG4/NoIjcExSqajY7znlpV2T2uf3Fh0IbJKaTPD\njg0UJz63qmPu8WE6QVVmx+CUnMI++jkc/jJz6lph3M9jltCpS7JP9F7McGRX\nBHLc5VYOMRjSk4noRiazQQHM8v3XegoBAdqEvn2cQS3L7U2DulADYL3tDJwo\nB8l5\r\n=b/OV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d8f8a00c0445010c26dd222059d59060792cdfbc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"betafix~add_notifications_for_toggling_process_model_executable_flags"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-d8f8a0-kyd29nq3_1642083777356_0.6271140306350256","host":"s3://npm-registry-packages"}},"3.3.0-betafix-1a0d5e-kyd3ufg5":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-1a0d5e-kyd3ufg5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-1a0d5e-kyd3ufg5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e0cebe2ac5fab051cb3feebb2db96e6f3be6814a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-1a0d5e-kyd3ufg5.tgz","fileCount":153,"integrity":"sha512-fhs6Al7C2xME5SNRsbhQstB6lRy3EDL2McgMhPhWrI4ULDjINEbDhjcly9bp7eA4nbb8OUTclZZIcFHsg3ZWiQ==","signatures":[{"sig":"MEYCIQDZc4OFRGg6ZR1LD2Lz0RVOp+0yA8gO2tOtDZoTD07nBAIhAIYxfqMOcRSKMbthv5Ismh9ydMCH5eX3OTdjtejSo9en","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4EAZCRA9TVsSAnZWagAAlVAP/3RcWhef35KKedfSHNRO\n/1O27Y019FDc2Ur6rtKv5HjvL1wQVuyCidXB+2UO+ETcVO3UdWc8IObqhTu1\n43BoQarcS3/GM9SllJssq226iMD+n8nT7Gyb+TRdBMoIu5EtoMYBV+MaGycE\nN1tn4CylgNAQBNDpR53Yv0HiasGbYbH2aQd8vKDohirRigNFOO5qX1Rttw2f\nBI5ISKHKPpQC81y+8OkTjz0TEPd/nzCfsIdsiM7iWzez24Zr82DxVRgP5w7b\no1zWwLzvtRYwi6+krmi3Z0CDBwy0/enRwS0mQ5qTWcXgFI/TycFS48MKuUek\nLn4ltEALcheiopBG2GZc3Nmw6ByC3ywi1UoJj61YF288uethg26TlebRr5t+\nlY4iGi+fhBWvRqVuAlb7+PL6W3EuKEb+R/pHRWuXEyJWR7MqyHfLtZfUulv+\nah2kg158KZh2tca20GR6MKfMRbedPCcFEVJWBw3N4xQW1+7SIBBssHHL8QCS\nLdb4765G1hym2KhgQr+y6O+h7DV2l6viHO5dK3gsEiUDpjrb11YKtNEziKLU\nrsuT3EYPzZbIwmxsskGlcScao9KRkr7x5ILAAyOcWmOjODeccTkAr2ZsII7W\ni88nmtXk+mlatqPwftgKoFAuNzplG8BlSadyxy15puVrprurUT3gM/KHZQdi\nSIFT\r\n=F7M9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1a0d5e27a248d4bed0223341af9f0433f3adc6e1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"betafix~add_notifications_for_toggling_process_model_executable_flags"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-1a0d5e-kyd3ufg5_1642086424823_0.8955678459285517","host":"s3://npm-registry-packages"}},"3.4.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d0619a8bd41e976fd02186a652d218e602323f4f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.2.tgz","fileCount":153,"integrity":"sha512-OW/IVbxysjI/l8ztQMzMCAd3moIDIQxZQLIaK9THTtLEQ+gslqq6GBTs24vVJE4145O0bv6uDdJs2lrKSwWiaA==","signatures":[{"sig":"MEUCIBFFyF8lag9dtkuMm41zr88wpDdWof9FibltLCQWyh67AiEAvAZlH9J4VMQWRFZBGmyezkey4oWp9ZNgti5VQ4TQ70Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4W0LCRA9TVsSAnZWagAAswAQAJIUrKwVt052nZmUVEcO\nAV5cRl34S3X+XBcD7MenR3sTBQzzSeBafWSmPfHNCcDU2YcTBwFshdg5bcxK\nU56XatHHPk4gOY38hqt0FbSD+tJwWhz0CTc+hm6oKx09MX/4TUhy8V3u92o8\nym12vt+XNVj7HZePrcQYt9dfmMm5b/jc9EDzGm9nQkx6XkYNmKtPJuOe91vu\ndw5jhwbKbL8Kc7D9YG4A+B1E3of3LIkFox0trfCy6ogGULm7eExaWb8voVaR\nspK1LVJffnhQL4FMK2sHzY3xX3NHeA5Krol5hneJHxWFtupeFtPPO+QawIYq\nJdDqBA3AjzrrUqfMMLPbdywZMQqWYP/s5mFWukae/e1a7AfUl/0eDwMzQAAf\nA7JmIKNKI7qKzpttdYz6Kksc4rYcpVyAe9HCEZ7r3wxY3LNU3y3zcSu+3NMU\nv/L1Cg98z1jADCEXcBn94KaQ9wEGeE+/f6s+nSPEkiM24DukCQ4j1kl5ynUA\nE0qYPmxYIB4q9w8soW6XgflLfBZcIAoTRsJUQZ5wGUmlkM5sV54pBYKaeZ1o\ns8XdCfWyprYiACqvnu9bAuvkaEm+Ymo99LlNbgdl4p8NgYoh4B4V/P030RA8\nn1OX1D5YLJMrsQT2ByIoP8MK9ZL2MaZ9RXjSGbHNoTznOXyGMxUyiMq6AAq0\nFLj/\r\n=9a/I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"885d441f03efeff7f4646598edd74bdbaf65fed4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.2_1642163467431_0.5009456813578073","host":"s3://npm-registry-packages"}},"3.3.0-betafix-a5ca5e-kyeehfbf":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-betafix-a5ca5e-kyeehfbf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-betafix-a5ca5e-kyeehfbf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"93a850132f60ccd6d15c05850ed4370fbd45b9f5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-betafix-a5ca5e-kyeehfbf.tgz","fileCount":153,"integrity":"sha512-zq0G3qUQg9dQVGxLoDaWO4gailohihrH6oHPs90HEC8qDKdORqSIfqc/kY2PToz4E1ZMtneK8x0VqlH11rodqQ==","signatures":[{"sig":"MEUCIQDBDOeTQcdVugdMUB5+D4eaZkIHvMBGrtWyjEAT5LI72QIgCeqGnODChLIAVVVagz6170eueplqlI6eMAvL9cYU3lw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4XIYCRA9TVsSAnZWagAAoLAQAJHMo2AfMDaI3qqq9zgQ\nCSFSwG1Lbe4pZzsOgTQ1bpNvg6jxUm3CeeHSAm04rVwcxsLPqp/t5ag+LEBr\nN+rNkDOwBZUg3w1bFFNDOB4wH1UdEY/sRuu4uzzdOU4BhiSi5IBvxD94MPI4\n+P2TCsXoecTXYNUAINwNegPY6wtwEsvekSF1b+DtpsPr30ycaDrmRsvIXxNT\niKXdUAdcyl0vi3hZotUXX7ZEKh9o7Ob14a0A9+wTAiKo47HKeYb/shxlsJfB\ncm2UYDc4G3m4ErsnaYL2fHuDdVy/vLAaXGYNOEeJC5/jJGGtFEMNEejge3E7\ntmoQHEZhMFqJ8tRDnSxJYzE7RjEkJtDrfcYQ+MuXBvhh5HAN/AWR+roAZZ7q\ncxiRghsTagSu2OFoswDtv0F9Nd871FxSRVREuETgIS8dAfHlx/B6y8xH+8IR\no6UsEhze/LWJlrkwJo85KpzWXnWW77UlOA4Z5Flm2ts04gHeg/9av1VMxR70\nVeb3GFIU+2rB2Do/oflHqH40sUSFXFFlUi+50aFyRtM+C/w6rShCr5i8L28j\nXX7ukWW7TZCkb19htf2L1d7ISkzLDd+fm6JecvDq+4a7O8Xva+L6E+6dm4qd\nP2rFkvBZqAJnSTOdfpQGY4TPfx/Vjc+SfovHhPR5GqibP9BUefvvLybRA3lT\npRi0\r\n=rWZa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a5ca5e6733515d79f786d92b2f7c15e08c64ff91","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-betafix-a5ca5e-kyeehfbf_1642164759989_0.5117090642482589","host":"s3://npm-registry-packages"}},"3.3.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0adfea5efa539e0eca7cac7b8909eb413451ad7b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0-beta.5.tgz","fileCount":153,"integrity":"sha512-GM0Uc42wNX8kodMROaOx+IKXg2teXqGz0JEMyhsqpofq2HZT+i5ZvOzT/GTzXd3N+LO0e7ezmQPBXK7ektISRw==","signatures":[{"sig":"MEUCIEydWRQquAdqilJ002sbnpIpeVzP8i0XFiR9SHYUv39OAiEA7ctoLIYkBvJ25SwqXgZUuoS55eKYUZLbCpzphV/Ga9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4XQuCRA9TVsSAnZWagAASDwP/2KQDs6Xb+YU/VxXNRa3\nHcS9QFSmcjdicriCzZs+PtUYKfzDjPcwMtW1BYt4sSuwwo50lJMbe58hjLfm\nAQBZBJItA1HIneUwlD6cKg/dBwqUcLfis7PdjYZi2eEG+SwwdE0qYdGyaYgx\nakXlth1PvQ7Aoj2W1hJo2JQ+8bvx5UWGV5lJYYu+xgtnsKvgNgU6HO3jijlF\nQFPfAfYE1lHf8Septd4dxEAedmF5bwlJI7FSVBx+As2zK7kzuh+xxmnz/53i\nPPlM9+Igwka3Ki93ou9pD1QoRv45CfMi43dxeKNl4lkN5NXoGsc5j2qViseb\npujQ3cCBjDU205C7cI76ig+GfUk2r9NT39lrJKMsbaLLJcQN4ktWSVqOKi+x\nWCiluWaJITD7IrFvma8/RcM0EfLKHymFH8vVWIm0YM3qqnODbeevsjt12ZVo\nCdxzolQxJWtchF0D718YMvru/ZQJFwO79JkHgNsL9gwyYpUMIw10KOSFFslq\n7/K0n9V0HOJ49aFJzlNDovti2XAr0ge4WUvHMoy93sCvbMM95vKR6nMLAu/M\nQIei/sF8JUKmL5Is0MSKcmEIintnQeSDLdU8gU94b1kIEwoGQeN6DBI0VsOw\nn0ISO9VRzhDwyG9nSstLPD92bem8Prve5dDhNwUAEOoQUu167nGeJUXAbNqS\nQfuv\r\n=eZPm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b7ae3455371dee63b2b72b92d115cb4fb841065a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0-beta.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0-beta.5_1642165294554_0.7585820862221433","host":"s3://npm-registry-packages"}},"3.4.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2a561794f1c54207bc8b1879e8670c23b9d3c0f2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.3.tgz","fileCount":153,"integrity":"sha512-DiLTrJ+0AV4dNvKPi7za6wIDuWfBqoigbQi1r9Ws9sMUQ1Ca6PQt5LfIK3f4FR42J5me1c/gXHAFo1GXdaGWlg==","signatures":[{"sig":"MEUCIEaeLUquQvSYxBJWiMd8DUTTp5wH7T0A/1IPAvCFO6mgAiEA2n2q18/ywyuwZ0zqsxLZAiSWq/CxYJEZXwUfUIV/Gws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4XURCRA9TVsSAnZWagAAqFMP/3v+ejQUc4qVl0+H4frQ\nGSKRev7dw9TN8tDFYu/5KR+8UXmbJc/GDUqiBhCEgYYum7XvKj/EF69YAYIG\nT40Y+pYd0NxwAPGOWclULMfLC/O0LOpSQYBZ7oV65fgz9r1UgMkDhoGpKzu3\nTNor8bCuSp/5r1acqs5yUwqi+MDY8/JAmOm3ajRrJN9asU1+pEWNpNgonBwI\nFF0LGAuOBhp2mxQnm9VzWsWDp28BWo5d5To7BWBY/ZO+a/5v/85+UkMx52Nm\nrsalItigZKTW7Sn/rXG30tuE5s0d8D27fFwHtXYRCs03lXzkSkl0n/tZeTls\nrt5ivTWzdsDDa0DMyqKjMPJj/u4PkYUmlK97GA9imRTwQY5q7XTa0tKcexDh\n5rQSxgzcg14XNReSFZGvtS9ynObUYVdelAneSUl33V+GDu4AYmVrClovj/pp\nWBg8IYsREeRluHTZuV9E5T4zOjjblxS/ueklY0Mo7TtjEjVyNzGvOuU2kidm\ny6cwPPg9o1fL6SzvcXGx6vM9eGwJfofXiQ31JnzRjwqoodzeNRRNNazNS2oA\njkHzl1P63zQ8fCGS1RLVKjrVr3nRFJuW3ufq9DHEVJrPhvmeq/xdXsKvnWEk\ne/enlt6y7J28OXdx+H5Te0xRAho/AcHVfR3bw+2S8uXrfjk6RhNoEOzYJ0Ee\nh6s2\r\n=bU/C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4e67ba4d81cfcf3c81ada0f1253b54200d562af0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.3_1642165521558_0.9631854128862056","host":"s3://npm-registry-packages"}},"3.4.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6bdc1614a6c01b0f8082e30f9a3601c821e5785e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.4.tgz","fileCount":153,"integrity":"sha512-HHQexMNIz1vpjsbS0KdpauS5oSbGNM/MV9BVwgf6dKTe0xSTaNspK1JAtMz8Rzaxc7CyVJvh2EHxibgfTC4aRQ==","signatures":[{"sig":"MEUCIQDWxTaV9jvt13Vw2KrQAMbgB6fWAZP/h9WzFwcmX6qBVgIgLAbUmHJQwc1bLxwDPZovWuoaS4OVLdGIl4SZvew9ZL0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4YXOCRA9TVsSAnZWagAAYuYP+QEpXuf0suBE2WGKVR3Q\n83wy/cMbWcN6QMhSNjwp2GJuOml7CQW5A2t7Akiq0jmdWE2f+r61oavZ1vw2\nX1/KzASjcuB29qhWjZHZ2o0M+ZttuMTElqFcHCqJczJpfX5YCrkbEdKTHHp4\nva20AEuedOT5yCxKyYzADajAdqAd+HhbrJccKr+Xa6F140uNJBuJbMjWIseu\nbz/vBhOpX9fVWWNJ6DxfW4jLYVlF5f0NmyFdDu3vfmBzruDymo6fzrN5uMvJ\n8qKWSEnAKIjKzUZcK1BMXkDlkUzxcEDfNgk0hDzwLEf1SOwPBC9rUaXptbtR\nUbBKwXZSD4F7bL/GRypkigMbssU/5oj8KoqEupMZx+uthhcmsNInGQ9DpCVo\nnJhNJQt0RLxi8DEs+WPNUliz9HG0qmAynszZ3QKNNZVHkxnb5mIXfJNCRQ9o\nWGudC0xrcs9w31byr1KWVXso20UCZpRdwG5N1ct/5wJYZG4g8xFAKZ4V1Ntv\n4ySlP5JQVXeUVJ91LMB9oiv/4h6Z3/YVSjAN4n9H65eTb3fnpEMN864JOHe2\nAA79YxFpUFXwKCHDL3PWPcxdGOvJzAli8cfN5UGlCq2aV4z4wNclphoLEeN+\n2mKrXken5EH+W+cAgExbj6JilqvcWvVSht+WB7jH08BQ8XHtI9fERKTgtGBR\nv/bk\r\n=YCwI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d7c056ee4aefb67858be4067bb52af8078d9a8fa","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.4_1642169806130_0.9393455728636539","host":"s3://npm-registry-packages"}},"3.4.0-feature-5fa596-kyehtzkk":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-5fa596-kyehtzkk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-5fa596-kyehtzkk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e487addef0e5792e8448c8a68e0a4d2f4b4ec1d6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-5fa596-kyehtzkk.tgz","fileCount":153,"integrity":"sha512-hAso3FoEwiMquAlNmpLRkhfKnvlSepuutz8XOSs8UMVjKoouathZ08R4DvxhlxlhsqbyLLJ/I3ksIh3d2gRpdQ==","signatures":[{"sig":"MEQCID2CFML4IIVibp991YVOBBWuj5SIt9TuOQk5bDYwYyaSAiA0qljKP6xcbSaQtnNAmGNpru2iU8PoBWERF1en/uSRcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4YgNCRA9TVsSAnZWagAAkcUP/Rx1Caj3rEMkopMCg1Uz\nsnbcELEqHK3rJw9w+b9Ku+VFRfCXX4DSTGvQgqjmp+nQX/r8n9z0ZuJYmpyp\nuz3ssu9n3tKhNrldsFsGB6y6d4SjO5BWhxfmbzN/e3zlRNjSDM8Wgng+Z54S\nab9qOxSIMpECSifWOFlRqP1vAos/rwfr6ye6dAYB73evg6jVDVYM9usQs5bE\nf1bLfSDg3RmGEbMStRs2aObsibN43i+JJ5R50hAkc6zNbusTbOBoWc2C7olm\nxVuuRUlzmeIOTwRM6U9med9dN/2BJs81eHiSafQ2Lts58pllFUcVCDZnTqD7\nHLZIqPCXWxR1RWGhDluSwj9/6T/dqIVBuqf5RUyTCm6DMZY4a9dlPP7nTAe4\nIakAAHGJkSQLT72LNyPIBiFGTDFy2px9MWth1eysnTXDEFVeRjiCXmh/65iq\nZJVHjXaa3i6VuPGoFbWFw1A6Eb1NRHKYoMqOlSUwe1p5Ha9SbOtr28ekrmyN\n+ErtqxssltmsQvjYgToYvQOXoZj7nI7BNROUxffYJzkhgd6eAG+vMaVhgIqc\nX0cMM073sJwJvtvvMLfcRVwCbPLUtFm7WdxUgQzUlcUT7I29uK7olCjccq5A\nbDRZp8pIDRpI2spOLDM34lwbIwWdVtj0s4EIh6PCMQ4Hyl0XOqoIrYW7cra8\n97IM\r\n=wfcI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5fa596cad6f96f331deec4ec3c9fb6cd7c09a280","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-5fa596-kyehtzkk_1642170381044_0.02381531412774529","host":"s3://npm-registry-packages"}},"3.4.0-feature-f1f7e1-kyehzwy2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-f1f7e1-kyehzwy2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-f1f7e1-kyehzwy2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6774dfe145d70b9316b579aa6a0e10d894a8a3ab","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-f1f7e1-kyehzwy2.tgz","fileCount":153,"integrity":"sha512-aSOHQLerNp4b1G+17tlk+QL5YvAYLNEZIsxf5eKoEHSN4mea3LRuP9vqyzCoExNWRQXOWPpRXgcWBbfsAXn4xQ==","signatures":[{"sig":"MEQCIGXpDDvfZhyBdAq394UsS0gzNZu2Bhzx6+zdbJxnptN7AiBGEedj2/xUu2u11pVMy/g48QsAXZh1e8P6r8/uNZcR5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":480134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4YkhCRA9TVsSAnZWagAAusEP/1TOD5207qU4UDg7FtB1\ngrN4gUHjunwGCkU5qDzc5c5vcfUUkYDscSSQUatt+SAXxroKwaIh4RbS+788\nJW97vYg5PBYdWBY5iwHaLGAkikeHJkTUgN3RbKh+/JIqSC5+DuJ1DYJc8gEp\nvB826KoFs76Sji3njTrgAjYLl0v7NRwOXms0qOlhlKaNYEExDjDnCLapxfor\nuU+iQETwewxKxiY5Q1FqNlIZpw4O7mNDLIUwO1JdrQaT5iFkRIT+TMV6ePZu\n4hwjeJDSPUWNuMPH6+pLVdqrisYdRi8tiudElZI+a57RaKPd1UdP1N66PZEW\n2vxVxpF3P6OZM03zKl7LQa7lAdKBG4X+GRpkhaLZDk4Uuet6n1zJUYe9snBu\nDHAbTLilNwCxEKGdweTv6X1ntByVUtpSM84d+rLjqTTM1WJn6atGULwYm3SZ\njq/EMiGe1FBaVYXZ6V0sIBphkBx4KzXQDeVRKQ8zCeD3B6CgtqIRHLd/5S3m\nKThwmM6p3HejozE9fWf8gnMoCdw8loF4EjHmXSwt5JES6Cqix40Phbma4lKZ\ndSkkOr7shK7jHXbJWRdU5MzknPUCKZlo1iv/IfK6498NUdevYRqku5m5ZIEB\nd6kT/KywLYt1g2THpQXDSkwDE19RZ98U4UJQuZUtXffcT3YdEYXG+PnzNLwM\nEAKy\r\n=FEP4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f1f7e1d1fa9f4551a8e00c4d872d03b11648ac07","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-f1f7e1-kyehzwy2_1642170657169_0.7528043796336481","host":"s3://npm-registry-packages"}},"3.4.0-feature-0d8c97-kyei2zd8":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-0d8c97-kyei2zd8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-0d8c97-kyei2zd8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5fba53ebcedc7540ec349136f4728074b18d1631","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-0d8c97-kyei2zd8.tgz","fileCount":153,"integrity":"sha512-r+HNaG5HyzftmJBB1L5M7Ag6QOoQGXP2LYRLf7esLkU6YusjdXDhXGH8t2bnDAz1ay5f1TcZcmToAD/NmircPA==","signatures":[{"sig":"MEQCID/xvlT//UkUwgCluzCFuD7u7dfWltdpUnf+GdNz5cCrAiAq3GhM3z9hs3DL6c8Q2ccdSYoDya8vmVO+9QGbwahAoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4Ym0CRA9TVsSAnZWagAAgqEQAIZLR/TgUfc4wCrUGdRj\nkxOyJ504U02qNm751S3cFNypbXUOn8H0I105Cy64HfKVmb4SPLbKqpaQpETD\n6lOVH6aRf/DO/DWdSgcg/BmfQb5VeCVBZCi4rHaofn0+pGhoR2lR0M5r5+og\nqWJ53DSER7GLbeoTxEXdHlCXBRFoEEwNyVDGidG8B2E4jsSWeVh5g8dAt4BZ\nYVoOvcWmGyE9slGfCNjTgK/52GHWKq0uDyRUtxrBWAg0XG+u/AhRh8HOLJqS\nrR9Ecvb8x2HMExwB8EfXxwKm9m5UqAZ1sqG5I2gBskAryXd5cJYeWoZ+8kKP\nedgSA2tmttgL5NX7MgzHOd2mLHH8wGZAV9qH7Uh2LDOgW/o7WeM6xAI7rHzo\nGaytpp7aei6oNZStlajfxYhMFP7M6bIqA6l/icisozeTGXnbwT4IFpsenvIu\njYhCIAW3cWc+vyK8bCn6lfL0ATBNUYOtMmxtVCgXzPVdvZ3oVGb/mBoeHBvc\n3lUmMsXBIyQ4TaMjvpZwf4JkH/Cw2TsSDAUKPcXOBona3KUiw1q3XdM6yCGs\nuQhvqp6t40CwWzFFozYXrcmgN8z5NOqpCdBHaLHisJ3V002JsPtRdYQMs0A+\nF1Wzl2lgJ5uG2KRnC82BcpUOnBw5c5YqaDgrDJBlKxsAOQejdk91aeGsnJcv\nOL18\r\n=MC4j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0d8c975404cf422f9d6e66a4f70cdc1cbbea7f25","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~payload_expression_for_call_activity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-0d8c97-kyei2zd8_1642170804522_0.6880590027251408","host":"s3://npm-registry-packages"}},"3.4.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7f30bb1cccc215e7ef50f59ed6bc3e49dc3f84ae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.5.tgz","fileCount":153,"integrity":"sha512-nJxCfwCm5j1PknMcU0EHwAxkAWYg+VNPOQEQXJ4ue2KyBq0B5oYlV4gRnO1QUI1ywAF+lSpXPQVVEAiNPA4GwQ==","signatures":[{"sig":"MEYCIQC/f3FcfqCTvER9TIgp4zoZ/JY8kHg4a2KvjKIJFe1iUAIhAJEnxTyGmdfdA5WS9ygfobIkFSn/tK4mTfi4YhsSY/Y+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4Y8WCRA9TVsSAnZWagAAbK4P/124caj4Km9EFNJdhOVE\nF+ErvYuYaPb0caZ7l5oZskq0p3Nj944vyuaWDgI8AoRS99yNzmxsLc0cDn/r\n89glkkr949qV/otySEvdGZWVHNkMk0wTfP+7W2jPS3/kFaseCuP5CQhraIk/\nyZ6x9hZmeiNEP6Fc8MYrLlgpUXuIa4UBlEfBnhw2KcANrdyM5UNPu18NWMGp\nkBRq/wbWyUBvIU99bUFmIvysRxQdUdVl9FAWwBiRLfrqSZHZ19dsxMKlUhuJ\ni/0QuaKBzQb7nIiDPQ2eVT+ZVw9TZQSRieT2i1KChlhPuOJc2NV5gJSgfh4I\n7fLJPpmAjBNsbHRbYCLQ/QM/GuOJMtVf9FH4kwKPbVMl4AgAXJYi9tEv+xnD\nac5GEs1yKJ2GAYuT0F7Rjeqn0EqsDBOhsMBp81l7paiaRdkg4z1zprgu/Pte\nCLRbvlRSygM8MsDcgw8NQQjMpF1havZ7Eay9crYk5Frf5pZHZtccfcoRqLjF\ngVLsbogG72Wj/L2T+/DcLR94mu7fu7m0ZnLFK4rbbDnWcXqr41/r5IukUC3b\nGtf2zq0EEwE56jhNvFZIrbhsKqfsfqKs2kCC3wVdo76losojC7hSGMxLGb5r\naHYLApSlQQNl3GE1/ZL27d77U6+QnWXJLbMdBZdM67+N2M+58G1xBeoJo3dc\nyIQq\r\n=WPIV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c10b30f39096ddbd6b365ab690e15c64a6f64bc2","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.5_1642172182532_0.97576366377978","host":"s3://npm-registry-packages"}},"3.4.0-feature-20a65d-kyej46pv":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-20a65d-kyej46pv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-20a65d-kyej46pv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f56c7d48dc3d04668855d70f4ef0ccea3202b2ba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-20a65d-kyej46pv.tgz","fileCount":153,"integrity":"sha512-oNHzuJcO8ixb8USvvnl0k2XaAKyIYch/RsTeQa+Rz2ZeoX1OiNolrq7ib4hcNH96fxOeNXS1QS1Des2/7i+C9w==","signatures":[{"sig":"MEQCIC4tC0KVz0dTuDu2IoF4Ht5DWa7K0t2CI15pGtwoHxh6AiAIGyuW4bp5H3wpvfi5LtD0LbQVb3yOR98Xe82DKhGa8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZB3CRA9TVsSAnZWagAAXBYP/j2oMsHVGYloZ6Od6iua\nTmaOfraSukELqBgCK2pn2sD3PzXsIBEqnSW4+I7sUUPAXRxxTFncqG7UoUgV\n4CWBhk20FJgeI5SdaqoiHS81Mq3wvkKzRDqn6qDOaBHTMjeyhKhClAdXmL36\ngxjHUpbxMj4QUR8mInVygW8scnwrvJ6K7NZ/KdYsBZtGJxikQEKZmC6Idy5R\nu/OUJsCHzjIudp/U9L1hbuu6wpPbpc2K3F7K0VkvR6bfqVd9bHq4vnc5bngz\n4Ygy8ROs0E8iCVNVCwgCbAhQRlJtxifuGF7T4P9CUXN9jFZscDaj0p426wNx\n4k37HFGj44aS76ijjqCJSePFIr7oZtAwKrLtuMaXljE625gu158Dgds+v1cT\ngfNsBI/L7PGbLaXkDoCm9ZdZ0Ua33h28bo4cwi/ukdiFR/8Id2tCGIMMi/jK\nHS0yR2vABIu+lzVNHl2YQBvbTFN+lfV0tj5E9YcOVZOXIw0hYq/evC68NjFm\n+t48FNIqvaBMfMrGyrUZXV5XuMkVPJP3itj+G0/iKzDqJybS0e4W5ET1r5JB\n7fZD5D8VJ7O/XZzXfGyC2hZI/0nGohf/c1BSmREKLpT8wJewPczAekmSAPvJ\n1aFzPIjFJoZ6KDP0wroUm5ScKt+RPXRjN/7LqYAL+XyMoBLBwEpfewZM/12Z\ndiKq\r\n=3bvw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"20a65dfb4f5ba2117b1ce3760ab8a9a579c8032e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-20a65d-kyej46pv_1642172535587_0.6532295999399813","host":"s3://npm-registry-packages"}},"3.4.0-feature-ca3d9e-kyej66v5":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-ca3d9e-kyej66v5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-ca3d9e-kyej66v5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"eb4b404d6a045259a40e0a131a1fa15de67eb875","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-ca3d9e-kyej66v5.tgz","fileCount":153,"integrity":"sha512-f5abxUYjtDKrXiTWlr1UEgxDAdoy1m+Pd1ibwjU/muKxc+KN+DckEZQg/wvhq0yXAspPrHgeAZ5unkxL3IHsVQ==","signatures":[{"sig":"MEUCIAPSFXvJhh6POfhPpeS7Ft81l9f+U+gF791rcav+9KQeAiEAsY/eAmuks2fl+zP5Rhlp9xrlZ8g5X/0V2BVqNo/Q/Ak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":480134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZDVCRA9TVsSAnZWagAA/3IQAJ321NaCt+OmPRNpvcYL\nrC+7i/EyGugzeu7V3kjLgaqRMWk8hDuU3H0oA5sf1NXWxBSrmq0ZSb2ZiSju\n56xfSwyWa8F8JhQ+MabZ5imUSGxTi58Oq+5UHi3KKWUuNywZbeKykzl9pqaX\n7m5+HMD2/wgdUdo5fFo3iWeaNfAJPcdqY4UyBI4uGgg6W1WCTd6a6m0a7o45\nO8OYdzBlYWgTiFuefsTihCBnDppjibe9i21XRPYBRwjNYFFq//zZsHtiF9os\nEXKRJrqLSWOh0sedvhhZx6SL7g4fFkr/pYIInuyqAhJ9HCiLBcsy2bcghBv+\nHTs/ufEQtlC6gLNaqy/cWOjh+IAFR+os2KmuY/Z7cLXj33HDCrk2mSbMQtNJ\nBDJm+iuFnFnsQ7NLtMmWY2458jtsCqTGc2tgk/xLjyEw4MAnwva/EO0Ol6xG\nk056fJ0bK05gTgHNzlq5vpTHS4BfCAD4AttxDwKJmdybd/BwCdxGY2Wg6ijO\nA1BDxfrd62iZoVvRRrbyFfmc81ax/iYz1pBkEkxdxmQWkVMmA/oTmo1mmbRR\n7HNiXwJzw5nSc9eHbGSxyUJm+utWPNy6yji8xsHDG5BtJ1DKCHkD806ieNi8\nM0t38MIA+J8cCgoNBz8tDnDK/yqg5nHkQfWKYSVBw3ezvUG/WiCtrflXAfwY\nVvHO\r\n=ixgJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ca3d9e532eacd67d15914e508be6fe594456dd1f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-ca3d9e-kyej66v5_1642172628881_0.23846796926523584","host":"s3://npm-registry-packages"}},"3.4.0-feature-de919a-kyej7tfg":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-de919a-kyej7tfg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-de919a-kyej7tfg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f7d8333a53c6e207a713a302883ce1d50f0f612e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-de919a-kyej7tfg.tgz","fileCount":153,"integrity":"sha512-yUJwtbfZz+nXeMQvdk13CksS6VfMImPzx3aD50Mt4l5m3tmBin5KFwdIujYm3MQz2kGkhdpj3Z4AsXlpIBIm5A==","signatures":[{"sig":"MEUCIQD+omJtu7VWmS5F0b5+ExJJMVTSik5e8OVTHSbB78+qYwIgXhs4EEBXTK1whpZeGdUXVKB1c+XK1GTtmxMkGANojDU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZEmCRA9TVsSAnZWagAAdFEP/iiIMlaXPnlyXgeVKeEQ\nKws4x6odkrxpS5bZ/qZxgBlXY/k2Gi/TKFb0foHEE/4DpC1mNECE7sZ5qK0X\nStP4iiOogODYV6L43Qom+LeLvkmLgZdbklxUmGHLqoJjARxkMxUcVwtaP69I\nuWy+OByfte8fMPGXi/zMkuJuWPWUOfAM8Debe+M5gxMZcAACIAP7A3jaI8OE\nb9nvyTyXkbp5+XRCPL7iS3acd1sb88wvPwg2rvpZtRrxHEvWHfnzgoivhqpV\n4zLNaLcUBd9AoaHfEv+7YZriFc74AsRm2DWlpqfbQ8eB3dJY7qmPt18XYeXz\nZnKBXrEmQbteVrdrdb0k3pVuBJgR5uUzSLNTAwlBpobXYM+FWsy6dcNB1Yj4\nzMrp0QWYBRYRaFIavRmgacRyZZAu4pr0J+nTX+/zABwGB/GJQhtTuMMu+ZQN\njepw6eCPs8m/daIWjtt4P4iESnKQiDQRybP9meEauKqBAUCgQVlq00NSIJjZ\n2+VxvpnimXlBLrWO2RTKt+1bVbaa/gQTKSWYwWy9GtrObIlwlaWpWTP1U/H0\nbqZWZNdgp+CLR3vkgIXbUnf+7tEl4HYQadecnkjs06HeUUT7zGGJPc8jidhj\nbBDi1n99a37o4s5IrB+2U3f209kvbDW8sik6bxolR4JM/h7hLZ8zCDpal7e8\nN/p9\r\n=nAGT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"de919a8923f13da734e7e214415a0dfc59707a36","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~payload_expression_for_call_activity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-de919a-kyej7tfg_1642172710120_0.8444003589090912","host":"s3://npm-registry-packages"}},"3.4.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5f2c3c8adea774b6a8e89d65fadf15c6bd3db9a9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.6.tgz","fileCount":153,"integrity":"sha512-/p2jIJlOjJXNz4FW5UqDMTBsOEVLT8lTgnwki4yWFmaxXAkVRJn209+wSUCl7khLG8+y927gXPt8T5yNeanSnw==","signatures":[{"sig":"MEUCIFlNCId9CZuwGaIhz4rOVds6c/4eYiLgG24a1J2xmIb2AiEAoTvCVeXNCASXBTiKNI/exvJ66XBglVvUzlF4O1g2WYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":456630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZjpCRA9TVsSAnZWagAAqdAP/Az4xgRrsOP5ErJBSn8m\nXcUVMpL7RPkjAcF8HOiJhuDrEypvBkD62cHjcY6ZuaYk9QGUaYEFoYbZmT86\nRJJK5mxoILnmqA7Q4zg2ZWeIQOx851vkg+ZZ2mR24/kiy17jkJc+/FSEgRn1\nH24Nw7UKmbpgjLQEXEHWgBMK2FxDvWE8csnJe2M7nBXjISPbp/n3FXMpLAXz\nX94Bl39uLluqum4lzrun6IvvKjSOEyqV6/OU+/Ob+OCkguL26N5XVbYDGKHj\n+Iy1SrmSNBNNK4GEjz7GtZLUKrfwJCNyDeABoJKY/im3ZgFTXpRO8KX6rMXf\nnJjwmZLsKrWiiFzSO4fH8xhrX7VMQTa5Za9YFrWYTuiR3a6mwkFkujO5wIsD\n+wsVOT+cf2y+KAtDpn91Iolx7DOZrn+LvtgDES7VucjkubET/f+gKz5HPTAU\nz00elScN5Jw0DGOJ0X2cKraMj9rYnG8aRIq2GkALDesgV4+trXKLpgZy0FTi\niSrrZ9Bl86hUqtCe0SIi0OO7u3kW3EOoGjb65FwWgGWE7dE56IRllHqjfK+A\n5B9854PGzFo2rDI6+Yb8j+Yd3piwtGmQ3I2AR0z9CxdYG+uv32pb8hkRVG80\nOWm4EqwbZ2a10TIkHWhoBNPTDUeYFuc42mdbXIXzplkPr/eOmPj/NHDLE641\ngZmA\r\n=S/Yh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fc612f0fa14ae39dcc8f951a8ae1acadd0206bd5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.6_1642174697729_0.4993907507545916","host":"s3://npm-registry-packages"}},"3.4.0-feature-0276df-kyekub2v":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-0276df-kyekub2v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-0276df-kyekub2v","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ee2af00e64a6f8d2154f8327061d4589572c49ec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-0276df-kyekub2v.tgz","fileCount":153,"integrity":"sha512-rCrtDjb0TtCH6pe1oBBHcUW8VGixddl5IO31sbTZAb978p+0EN2jjyi1W/B7XPzC1XLMwvMUv821EFhK4/xEmw==","signatures":[{"sig":"MEUCIQC6gSbt9bmttBV82C2TFM2meWUg5kdRROrGC/nPvnDQ2gIgSoloXswCFAMN5MbWSUo3bxH207QV3RZa9pfYGZ09ZlQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZvKCRA9TVsSAnZWagAAU/kP+gMIOl4i9oowLxCojhJP\nNM28Kct2yRxPUYQzWS3AJdW0voecpldVr9wKKH1rQqMPS8bkCNjSIAvEophh\nJDqLzh+gZI8OMEMoxnIeh5sgBBY/XhVLrr+Wxv8SFrPvP/47DzBIC+0mHw7X\nN8ONnW2v4vY7XSt6zgZEHkGZDSOwzBRvfIaZdEgQqaYv+tAPDcmLC1+HljSs\nDav9kZYGBS0GuIUlquOtkVn/vOea1zorOyLC9+j7sMoB7VFZsx5fyni44E0a\nKfzMPpaDOoanBdAk7MHORD7fzZ+Bdj9lKbq72sXkdTsmeLB3y3HetYXthM2m\n1FiVpaoXHydtHFO9OcFUfkadBEgucxuT15WJvqHBLrHwVbw7+2bDvzraHFra\ntBzQn1NWqG29rgb3kmYBS+rmNHaQ0rb5SBwsM2PmcLlNvYXMpO4SxDabvNDK\njEKN2E7GfzYW/n9h2ox21ZpHYlEHCYx+lZ46S4aa4E9Cjx7CKURK0mGwKgTf\nSCI3mtUF5r048grd9pJQt09XN3lfjNxA1+mdPWvan69q+YaazeeWnSCpU96M\n5rkuLJKM8JYhrfTJATs5BaYq4RIqquL/vjWu39K77fkp0LrXoGc5jpzg/R2m\nTvVRqnU2rwiu+QJsDqqcIKV5lRkoVHI8cFw9ohiLubR7pbHg37SzJhkKXqIJ\nuYOe\r\n=Jbw0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0276dfe1b77be8e1521ec9b5ec32bdc5b3dab420","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-0276df-kyekub2v_1642175434579_0.4948876493371386","host":"s3://npm-registry-packages"}},"3.4.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7c5411c39cdce85b81aa8d77868f3f470b2f3d0d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.7.tgz","fileCount":153,"integrity":"sha512-qSb/UxP8N9iakS8dCRvaYvVyXxmmyOn3/mci/jNXvHn3rO1eZy1rpZ5wTsnP5MIr4z68cOZ3sExrguuB3kR4Lw==","signatures":[{"sig":"MEYCIQDasFpZY3gsdxWNwHLL9zviH8XO94THerazi6g+i4lULAIhANzD7SZ1ZtAlnb28pLc0Bk9Z0HkxqVMqK0rWi5Nuamzq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4ZxZCRA9TVsSAnZWagAABcwP/2MAYubdXGtOpZAbnVvZ\no1dXYJjgxKttA9YRRUuP7Vp2Rblxhpjwy/wGSCpWFO34hIFVsdqAAvpajmPL\nNQt+0/9addmjW7tKIweGRw3ucZ6QU/xG2fzRB5g080fhDFlnf37l8qbIi1Rc\n2GGLEJwdM9tQ8mTzhvH/loGeIXNnUYCJKBsdqWGG1ptTTDeHfXUdgM0vUDiK\nlPMJv1AaMfjFXza0vmXheEvhsMn0487zYj0T0LXsz02LwjifEZ/zZloBfjKI\ncS5gWPVetFPUnxxrZjItnxZoEYAmznmlCMDzzB0RkXT65g+/MU7bDcXvVbcY\n5meknPXwkzlb7xgyZ1JchVv4J7+YCnsHNr4KGhien+Gv7TfPeLJBWY4Td3OS\n+6MJOmX5VpsHz49oUpgRWSE9jQ/TZkNFhSgIVED1m72ckw0QIXghxoxvVJH7\n25yoxDyqq1FCiv1EPvmbzS/LvYFOO4VrvhLKxppLHomDCsVJzKjQj2qJqkYl\nVD9O5TgNyACrgjN+ITAWkEDnJjqoNShseMzIcu41w0cId2WaWIAynliPUKWQ\n8dEqmjtH2v4e4DsD7E8xDGyZCAUS5yGwTcLmaWwswOH641xIFYlDgBl2gz2h\nC2yoCF3Ea/zSK43C7PiHZpqFcexG1RbwHVcTxrMaGVS4D8yd57/d+aIb2eNj\nlnbg\r\n=tMzK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d128b227ea83973047960f8399ad7f8e78132a1d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.7_1642175577684_0.07846662597090193","host":"s3://npm-registry-packages"}},"3.4.0-feature-3712e2-kyekzbzk":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-3712e2-kyekzbzk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-3712e2-kyekzbzk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a8d90781626b7efdc19c2b140517896b8485325c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-3712e2-kyekzbzk.tgz","fileCount":153,"integrity":"sha512-oyO+QRMocmT/AspnHRASXF2mcBNZKWleZhB1pr0dAQLzB3VizWFUmghvA/NuoznX7b8WiGARkWOqocibj8OcTA==","signatures":[{"sig":"MEYCIQCCBFGDs58SQsv+Fu4AOP2xyzKQwmAf+9BKtW858JjjXAIhAJkEUi8S4UND5OY68DMgMAFLJw0NcXCPrrzPA1+l9LJK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4Zy5CRA9TVsSAnZWagAAmMgP/1Y9TRUoqDGyMdARtRVK\n8c7ItbY38xWOME88rrR8/WUR5iYNpCcFEw/BKLM20ifz4E3clPIF4j0QCLDb\nCvx8d8vA1KEOHXQTFvHit7tfc/Y4BRDaaE9NXAa4/YVt9BdiRhz1oHW++XJF\nt01tT4IctEzemFICdGHAqpDnGh6ZzbBcVvHG65syAUffeokpa6WcA9OH8upG\ngwWVKayX3uujrs0ajREjycERZEM19hng19ZrgwsIovel9fI9ACExSIcJBWdJ\nVByFON4HCpnZ6dmIvstBjPkfE8UOQK9Hl5RLZLStd5Vazig23XRTo8Dv7CQi\nvOA2UBUHXnXimDiMSan9cXWQb4VpMQz072fdhwk2rGlzZnnRCnUTpXvZVoH8\nmKwTjgFJZFSjW5jwpoUwYKlX+ABlpcviN0FF37Ok4R1SsrHXu7yolcTfqpau\nINl3uu6brHr9+nHt7gtfiOA8yywIOOeF1y+8mZZUAAlT9OXabX3ZflBFK87t\npBteBwCHah7IvHAUfDtRU2lMy9b8bwdMdfYq9PE93SEEeL0tbN91JcCVlnrO\nfXcQ7JE4zptTAwTe7shByIXatYPEnHL/g7IFfpfDR9bSgI7ZcY0Rq6AmDH4f\nVVGaA2vGeirNVAtIFQWJp7ERht0Ok4dxdqPGfoVoBs3ES+mQZ0zTCiXYYotd\nEjcK\r\n=1kdx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3712e2c5b0e653efa8ded15a2ac8023ee0f14a32","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-3712e2-kyekzbzk_1642175673256_0.3007639019891577","host":"s3://npm-registry-packages"}},"3.4.0-feature-77f4d1-kyel1bbi":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-77f4d1-kyel1bbi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-77f4d1-kyel1bbi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"32c20865220ca4f065cb3da13accec8b2c62243a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-77f4d1-kyel1bbi.tgz","fileCount":153,"integrity":"sha512-ElPFOgCieUAa8cCcPvNHeggnFu6FGEo+3VhSVRsDLQyAoSkUSTPUyaiUt7YyXNyFt3kY2cY46XHz8FS8OxsoKQ==","signatures":[{"sig":"MEYCIQCpgBAyN1uoWfh4Vll7zezFDjeCx0vxoDncwfoEwI7PAgIhAMqRtYFhceEj2ajC/oc888I80+SfOjCixOIYNZ50O6qW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4Z0UCRA9TVsSAnZWagAAk5MP/1SelWsECvTdDA+zKutX\nNfYNIlqgU4eTBFCTkk5IJ5IWOg1CQkXxOh1IvluTugjA3gqFemoxP1snrC5k\njIuttETmmVA5UeUnEZWMf0pKThJ8A/ycA8gJtGcOQDXrdRlDxKze2fJDvM6k\nIlW7TxAk7fLWMgFGcJO07/XzsRPzrD9l6a1lnHGAJr8cl29joAJ/V+s2MjDR\nLNJuDP05F0cXWXKJGWqCmhvYb45G9OEA1sQhaNGxoR8a2xQpglXD7MxbZjHz\nO46n4zCPn/79tvkst2LTAJzrcZlE7jc0PgFpr3pWLhD+5xRFXYVp82MOerzd\nECUxSmpBOIGi4WfBTRLw/MrTyUf2X9J4okwh7w+pQhpw47k9U1Iy6314rIq5\nG8lZwqNgfH4h56NafDqNxfCcQKuwzT/6gvEmCOg1VnNRxqY3XkNqiPkFRtRS\n74FtTrtd9dY/eh9AYNdHYHUiGaO7Ys2d1U5hjhTHjoWTeNNhApbMaUGUcSu/\nfK2Q8PbmZLeRcm59D8s9slyyFeZnpCxZBQLilG3Q15IB+PHo5DLMVUpMwX5Q\nInvYLBjvPk/UZ0I5l0DknRrjOVJekeVuaJsLgGVjvDbp7N7MI/eFQhEGcNcN\neQ+/tg/+O7ggnWrpXKPmAi0SJ1nb6H1HY6SAsXW/gQy+oCSddD6bEBzSCiq6\nw/4e\r\n=wIFJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"77f4d1325dc0deb63bd02e3a97c6719dcfb23a6f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-77f4d1-kyel1bbi_1642175764397_0.8847920194793628","host":"s3://npm-registry-packages"}},"3.4.0-feature-d76964-kyel2bdh":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-d76964-kyel2bdh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-d76964-kyel2bdh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"36fe1aa9959fe80dc521c62b0042ba6507cff36c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-d76964-kyel2bdh.tgz","fileCount":153,"integrity":"sha512-3BzZ5n70IxMIK/W47Jrfw3mBbu+ikAN4A4rdZ6ZXGX1zHc94TrhTBqdAW6TFBEwqr8F2jikonH98CiZTPzToSw==","signatures":[{"sig":"MEYCIQCQGfjCbgBvoWC06fzbiq+GYQLYnDUnP6zCKrOmEAFbTwIhALL9kvCJ3/29dd+RWrYuNetozT9keRP5W9ALEUTVYvUu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4Z0/CRA9TVsSAnZWagAAGckQAKQ+AerqWrbNeoo6B4Oi\nV/OqbLVtzU5cjgHFDacvYSaGcpGtfzWGhs9edXEYn6mzSwhPamCGT8/5WMSY\n2iMJvSgPpc02pWLPhwwUpersLk4NSqZE4EAhER0Y7CBoxoHirPnQo+TGPRQN\nsfIsK0hinQUHlArBZZoS7jWwnb4r/e/BQ8kwfD8iPSIedm8PjubCuVqtqhhB\nSeloH4vRgHs2m8rX4ZZq4tiWDCyX0B5LFmlcYfXG3gZ78SsT9DswqmFtWmWi\nOK8rB/dtMeSLIb7kzFnqaHxWtIJrxxp6Za4sFx0W5PNX3Uc1zhR2NLPr+oiE\nBPUhvQiOj+OdS4zfUPO8DhxmsjdscbxCJ7O+Y3bou1s5G53cCrQH4hM6qH2B\nL9tOKfGCqe2JwzapjxugsA9Bcx/rlkQYbf7IJ8BVwAOMm1KozAH/dBW8n4hc\nm63PQvNUUxxNPP1np+rJ69WLCpi4vLDFWmIp5oYmGtkbyDXlLRki9Zchhip7\ncOTJrHhKKZqF3LkCMVXsgn66ez4CHUXpXQO7YuZGd3DxgBTVB8Ynnto8nvi0\nmScBm9/OOLuiEDdBl0WmzAQvG+P6Yx+Sa3P52MjJKBUIFtv2oEXOOuWhdnqB\nLJqumaTarbSZiLbb84tNmDZkqNshgsBB3+GE4Ly9aY70BLYfTMgjv7jP0K7N\nPIjX\r\n=OYUw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d76964889ea2d9d8407cd235ea264972289e8088","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~payload_expression_for_call_activity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-d76964-kyel2bdh_1642175807776_0.10242275176639826","host":"s3://npm-registry-packages"}},"3.4.0-feature-6a5555-kyjy1p6v":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-6a5555-kyjy1p6v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-6a5555-kyjy1p6v","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"daa1fc8681b876169278e9741676639bcddcf8b3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-6a5555-kyjy1p6v.tgz","fileCount":153,"integrity":"sha512-E+pHoJnxZZCWgh2lk+j2EygprcQAl0Qlpdb6nq2tykHSeAz/76A7gftEN9ywCffgB+aq+dfIKFws4Dq28xReDw==","signatures":[{"sig":"MEUCIE96mWY1H9bI3q/2tcfXTsizSQldb4AfL4kM9Bkkt7BPAiEA1BsCCC16vknk+9ooX6lhbRVd4WLJ6tGEk3Cx1W4yKPI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5o9vCRA9TVsSAnZWagAAivgP/AtXn3l0ItccvxtzLIgN\nuJwsY+RpDD07HPlS7YaOOpyLgSWFO/oc8JdCKYQ46md5ugsXQmBk5zpa3b+Q\nLHgc1xwFSA8QBmHWb68xGVWbqyUYx7Mj/pxUFOcRN9WUGmsoOb646LRWDXgE\nKuguk1AvWPqOIwJLPI8mzSMt1yWTOA7+dYixglagKpFHvr6wPHNO7KWaMkN+\npcekNxiMibi5jesNM2VCPN0YlBhYDl+w7QC9M0MMGX65Ez40eUtI/2vWiUba\nzx2mH2prTiu0nQIJR3gqA9lwWoTpcZtdKysbAjjaplA0JcRm8/1vmLdiYciW\nBl91ljgppswWBiN1ZZB8OShYQlzcMJoAa2N1nY+YL2+sRbqx4EulHRmHcR2H\nrVskNBo+nxKBvag7SJBt2NeiorGGQ6WnDXpFOHQn7AhToVXenyqZYd6JiDb2\nS+4tva14gBKb0y30BEKWTc9+gANOhSUg5jYjZlKoGJCi/Rm+y3Cu9/hNtB5R\nz0S/a1qa4nqDLgwxli/5zxD2FfhS/mXuh1auCM/CtqrS+HKEAVcgcGrQAtJh\nWZf4iOo0B1TiDNO4hl76xuOL6Aycxm0ee540wQgfleqkQ3MlNmtmHiGd5eAx\nC7ivRMAxJ6oh4g8BlR/uEK/elx7XWOzTtvMPdRLj2Um/zJZB4OMOU8ZfVeIv\nHO9K\r\n=ZuNt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6a5555481db5d700be2fe3e9178b45bc660c3857","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-6a5555-kyjy1p6v_1642499951303_0.7706680515638582","host":"s3://npm-registry-packages"}},"3.4.0-feature-2ba072-kylm055e":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-2ba072-kylm055e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-2ba072-kylm055e","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b912e1b05f73209f9233e05dc7f88fbb45aad752","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-2ba072-kylm055e.tgz","fileCount":153,"integrity":"sha512-bRAFTSMq7gt0yC1dQfrcJGo/+a0G8gq9N01GYwIYxtOaxMukkMhhAv3zu6TZyINGUw8ieN8rRQiuMeeNMRlGoA==","signatures":[{"sig":"MEUCIAb2dQuz+myGOrgatTiH2gkafCsgc9u0MVSJY+6jZ4kRAiEAuSkGqZpyyzEWj/N3R2gBAmXAJc5cX/6QCpXKopvdBVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6BjNCRA9TVsSAnZWagAAUOAP/jHimsasZ2HBq3Q21KV3\nqbxTFjR1jZ1egeB7ptsNQmiXhtudawOBntai96fxursFeGtAqoyGNXkkMNrN\nMp1TTqiVyRHT3QbQHudaNa3U9fsiB4NwPvN6+3eyZwe/1tnXBebhMit5rwLk\nsSsz3LMhzuHIFy8yw4dWGJUqukdFi8VlW3RjWcFr2wH7wHj6QVLv2WsJPORO\nzEzaJCB+mIrKDvF8bpg60B3sz7wqQcj6TR1uwBSafIZ773JTH5Dvxvg1yUVN\n+xmNikk5UDMRW4on3pxx+WAxNJq2fJ0n2KHUkdIgKujKYXboCUvVt0ft616D\n1m+975aAqn/PbFXV2rGao80LXn5eKRbxLCjb79HBQehgiAuBPUcSKj0T5rJu\ndQ0pS2DDgOF371vP+ZwEwQjn6gaLbz/hiiSZyzoUn71Lk8uwmbZSmIR6qWhE\nSx7KJ0yve/wa+x7mjizqFpkriOd6WHS6XYHNf9oSN3qT2Zzaz0Zp4J4+2kVf\nBW/G2Vm6zGYAGf9PWsVdlT7bcclxsEfp6hHWVBX+nMHIRLU0PCcmbJwQATkf\nN7MTpJsMm7QrDk/JUsad0JF32sJlegvIRP3J4gezr4K0G4L1KUqhKhJgvDb2\nBHzTSD5Mj01z2C+kUfg22aDXGtsLw9XvatqbpTNZMikkSnNxYh9mKxTfYhYZ\n9CKu\r\n=QatK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2ba072192eb98c9448efa38301b694e2d4157678","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-2ba072-kylm055e_1642600653115_0.9154535237764068","host":"s3://npm-registry-packages"}},"3.4.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"78e0bf3a2cc2747b3290fc80405b10f12d8958cd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.8.tgz","fileCount":153,"integrity":"sha512-Lngw40U88xpqvbfbxfIaduQrzH7a0hTrC9mWLv7xow1uxJhIClqa+SIRyMYRBbwffyStIWOHzsK0PfitxBiDLw==","signatures":[{"sig":"MEQCIEXCRQnBXFg210Ji2o21mu1moqGGWFNIiDs/uk+rw7waAiAQPbJlGXxWM+zDJvZnx32+/XolXCP6ud4qa/VDeIrowA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6BkzCRA9TVsSAnZWagAA2/QP/iVgUZ2QMGXEaWJyKtXg\nIB+tnNdsyroN0ZKcIhk+yRC1upC5lsKgioQLdogJQ8trQ2ou2NCNiB8UEHhx\nbHcGYHgJROgSqNF/ur2gN7h+gdpnjSQoR2+bWZkgamwUrwTDM8Mp7TgOWWw7\ncwRO/CDUMZkzI1E7KrvFANKAc89Qzh8H9zUZAJUT6HKuXT/GJYWsVrZNP9La\nGWFYlUagMW/l2FDa0kkPcnSXpoQrjhrQa2CpUCROdVCShg8viCi8xOM4R7dp\nlr4vORiDSccSWdITXovMCEpmq/0DwsOspC1jq84+sj/lCZY5PjLLCOEqg1Ds\nvooH9PMX4acSE42G2louxMYKzospFPKnyHPR1FiwcKn7Mh6sAshbpJqm/M+J\nV+t+GV+gWDpZmqoHrN8b/iU6B9bVaudxTGlubDZFMrb7mxJFTP7C1SMJWJlx\nLFdPG1K4S2kLYqJKulU5pE5MaQDm9go6EgEnhdkhLO3uVp+DeCI2dso2UH5a\ntumra8IpGuo5k0VxCylcFiPi9VFAasAxIn3TQCV+ekfvMUHrt05XJNHxoFfo\n+P3ZF34EjCdDy78VCryoy8fmL6sS8Tz9gnDWEv3cR0yrxS0iFOF/5I2w9hKq\nXeJuBSUEl/R1wGyxF5i2o/AXVqQxyVYQWORqFtIxHtjl4DctFvULfmZ8feKl\nRBHe\r\n=SC6T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6d1ecf53734d00525a7127df9e8a44929ab1e9d4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.8_1642600754949_0.27980743703285516","host":"s3://npm-registry-packages"}},"3.4.0-feature-a3a926-kylm6g0u":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-a3a926-kylm6g0u","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-a3a926-kylm6g0u","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e673de948193d3716246bcab146c4e4a32701ae3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-a3a926-kylm6g0u.tgz","fileCount":153,"integrity":"sha512-qRB7TAZxtC1BDek1emkRwEne9x8xlMHLLnAP9OQbih8rbU6FkX+8drSCrvHrnICpZ79OClu5jxjiqKG/vg9m5A==","signatures":[{"sig":"MEUCIEKGAxS90Vu1QMV2dl0vx/GAzp2UXpST4wI9kgIJG9B7AiEA7kw9EWeCorxRFvSPL4CWav09fTF4N0JvL3Iv8n3vkQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6BnyCRA9TVsSAnZWagAAfNQP/2iO+iVNSOrqKyUYxr7Q\nUiCeqSyJtBsKwnLruX2OTRBl0GijrzI4idadjKoOMzk7iWNsh/QU5/Rl8KyQ\ntjZtzLAwEQF7FozZI0rkz58XQNEh4+fAarg30syJ4CdA3WP0/KRn+zndGbO3\nBXYdfjUrxrTbOduGZuWi9oZLPXcrlzPfvg+8+rednh3yYHADD7OlyyGwEA+S\nGuJEPINenuufno5cU4DhiPemfX61Mfw7zKwgj7IwT4Tq2hk6SLILuqvrI3fk\nQy2hBfLcwZaUnykmyAtK5vbJ45ItwbL9SJzUOgai/cIyYs8NKyIH1MtM3CR9\nG3mjmzLp9s34y8SwXCSqUv0j0goXMVTpoGt0HDSTGEx//YXB/Ctj9tvV8vwK\n42lVMnDn+2CgTTEZ2GKh6Wil1RvQYFCWhKuPTwqhIoXXCX7H+sYphLd8xj13\nLFHh2XTwPDZrJPoMBkDXmKj5VFBV5wj3MNST0pGHtPf+ZDYLiKxA9qU+bU0r\n2Gu1lECf3g9jXlE1sArDdagjsCgyhSAVe0oOmUv7DzNmD2VuhbPrNdoaSX3t\nuwsTuK7pYYhKG/KTZ/mrXn4mONxxOjyrXuXMk4b00YM4PECg+g187Uc8LwMB\nJMBSbXeqQWYU5i/ElRDLb2Qp5IJKGaji7dKqKaOBb4MD4JmkuyJDqQ8j8Xe4\nglvy\r\n=ZhjI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a3a926dacbc2464e3f4006595307086580b80ed5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~extend_flow_node_instance_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-a3a926-kylm6g0u_1642600946650_0.0747871556171058","host":"s3://npm-registry-packages"}},"3.4.0-feature-1d149c-kylm7zl3":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-1d149c-kylm7zl3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-1d149c-kylm7zl3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b63db49f3687872525befcde665c15d8e4062f75","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-1d149c-kylm7zl3.tgz","fileCount":153,"integrity":"sha512-STaYbi8Rf79o/WGTgcNVgKZMfDGL2Kwt0p4KpTmpvDtmKwfTFbcjhZkvZaGo0zD795OKgOto9zQH53DC28OGrQ==","signatures":[{"sig":"MEQCIF7sJFRDOwkBM2BiDYFT4MtyxWX/w7gPHizvi5PilZq5AiBTgGoWepvLfm/EM1zra9wq+vjv6UcoHpQyJ3i4RvlXFg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6Bo7CRA9TVsSAnZWagAA6KIP/R3odcka4AmG7J61BZ4S\n/G+SK6LsCHbVNpT0M/hRYjV3oS4DQeKBDlsx6+w9xyG15TpHVfdOCoNYjd2O\nreNvJKKjoFzELPn0ozoPLcV0GCR+seG80v07qJkZJrK6KVFiJFdJE/woFJ7A\nPgK+LG2ivfDEyJUZuELLhUZKoPt8PS2obglEbZoxXkSzvl/3vqrpcaYbPLtS\n5hlRiWYt7fJ8Dms7znGtKj+GJ2axCsldSqj1EduQnsF2718223rrLloJXLYT\nmM53yr9QYVzJPqhhrA4tjyKiC9UzRCZnfasEPWuwTS+UyUwMDwOeDnHCkLLa\nhxXth9yTbAL+3coFq3Y8G/NMfAAXrlCI8jXjGxqHjyqIPZRRY3Jnw73R+QK8\no2KswuZroKGEngbDVkOzSbXn/ZKweu0kNkArEgRxJGR/wGUqdFA1y2BZdFDF\nct9D14FmHiMa+w2pxcPGhXInVBHvcHaU9QrU7on6btTXadB6xy26h3r36xI8\nZSemX0W1D/Gquww4TzTc1ophtUjRR7seQTQxsv1eDTO0JQeWI4rNTydWWmUV\n2RuLGUPtrw6HevSW+HzsYPyPVgIMKZBD0oKlw+MDoIn7Z3s6gw9qxpMaA3cx\nFewxWasNUMyoWyGVmy6Fj67L9pO8uqs1AhzLjV8vB2a5z0Eayr2phFovLcox\nBZ37\r\n=/qoM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1d149c8abc2a5a13ee1a1a5b6c8c4686e6ba9de7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-1d149c-kylm7zl3_1642601019165_0.33768350610681397","host":"s3://npm-registry-packages"}},"3.4.0-feature-174f7e-kyms90wb":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-174f7e-kyms90wb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-174f7e-kyms90wb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9d2f98a6d342489fd5eee6232e928b640ce3acbb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-174f7e-kyms90wb.tgz","fileCount":153,"integrity":"sha512-GlpGDc1cerZYOtRslU83ERdJMtUGYeGjkrhgmEbORwmOBZVcD/II39Vq3QjHXPuDk5CNc5WfteTjVVzkxLSGHw==","signatures":[{"sig":"MEUCIE4yFZgm4YDdZidtOoz6B2GCB7CCaqk84tAed+C+vYRxAiEAwZNmbHeAM8YyIS3KXVcHBSoDk1v6tr/iEAtm9xF/6is=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6S38CRA9TVsSAnZWagAASEQQAIToyAVFkbGihdi0ZBuK\ny9w/smOxVy5eV+N/26qhctb+JjBCik3r3iPv1P2b1NXv1IWSqmiW2xRpG56w\nuF2a/OJxn/MVmeX80NuVk8JUcTQ0ZiatOwTQSSQqgcxwbql3I0m0YwbpaW4Z\nQ0qQlhczH6+V6SKpKfcg4JlWQpi3S9eTXbXvaBkR8LlFoBz0VQ6sFEVIy8/P\nbZrbNEcG1Gtj5V3mnDg9ZlhgRE9JbtkmFpMzJMknEcX0Yz6lUBW+7LCwN7Yp\nt78J45NUnLsPwsDcq3bQ+mffYZUDP7aSZQBJuG9t6rsk6e/WMdpGMIFl5cXr\nkNJywC4AAY4VVWrcdNvdQidsEAnVMyS+hPzKeNdfp3CQvPrbJFNrUdHKdFDn\nR/mODv6G0Hs23ZRe13kVO8cfiA1BRY+zPz/Hxv9f1pXhiZh8LZd9vwVlo9Ix\nYMKhpbS16z7Kk/XSy/o+FxapKM7ph9THzSH+u+YLsfnCs7gWfGNtuKjAlgri\nRD9FUWAz2iz+q1+NqR7SAU5JK8hdlVGnxUvLiInT7pGXXBa7SiJiHFfImBxu\n+R7e+3Ly7w1JrQcACGgIIDwDY3KnsI1I5ZZhMkl+UBV/4cZv6WxAu4yihVlW\nlPZayP73+hQc5Vz69FD7xU5RxJVgY4ilqqYwetwfMZCawNMoTNZdwjISvbwj\nNNxb\r\n=5puj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"174f7ed2f3f4ca3fe0fbd074d9c0e2f54468482a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-174f7e-kyms90wb_1642671612279_0.7327020056281679","host":"s3://npm-registry-packages"}},"3.4.0-feature-fb380f-kymzwz2u":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-fb380f-kymzwz2u","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-fb380f-kymzwz2u","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7976aa3623a59b14b2410ae6ff437eea34cc37b5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-fb380f-kymzwz2u.tgz","fileCount":153,"integrity":"sha512-a+IuvNNctEaw4j0LF+blXxfWSl1MRZxjwjedOnl82rvdgWoRrrOW574EQ3kDZR8qLxtUkA1BonEl3h65xIrEog==","signatures":[{"sig":"MEUCIHzlo0UL3hysNgryEMFeTwfaBm0pyjEjGG/ZzOYBFHIpAiEAr8nNtIjVQk7ttp2JtfLZ0w9UYQ4KGYb/aW4buaTQPHQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6WBFCRA9TVsSAnZWagAAzT0P/0leMMu5u7brRz+geHmy\nxatdNq74QexPljBUQ/s2bM9I+sbsBKvICgjD77BYozyRKcdIi2sbNC0J3osx\nTSoXFs4vTyDtai5ZGgG6D/cB8QGca6GwfZOAiBtFNDTV4A2pS2j8bBd21pWS\nE1AjgcFN657AjGw1P7z6jmGqQEVyHL/JpiuPR8OcVi5A65e3hWqkKWnHC/bB\nCDih0n3TUVKz6R0n8zrSkN1QxaGI8rkokUBFQo7jYsaxXYN5CarT1a8IgXEX\n5bUZI6m8g8Vi0R28qQu5iCno9KOk5SxGNs8rhfUeb6dO6P5y42hQNqwV/JKU\nj7a0xfqVKyQkMAPVLPeM6kB2hW7n3pQTUJf1HLL8ZEcLD+X2aj5xwy0y6/MQ\noon5JDy4dxM5Fhr+q07G3yvf7lHj9Yp6Q8huu8RWIDNE20VSgi9mB/WZVxdf\ny0TdvGMDf1CkAoR9iGcLADRr67+XcamnjBezMLxWOvTFSDQGb/ZcznuR4pL0\nR/w+V08Y+nMBpnJKnvHjcaS3G/9fhUYVAr+b/oCjeMIvGaaj0jX6bpaX0mEY\nVD3uhjs1NIKlBjBNJGOpNDSEXlMyjJfVvtVyRXLXwqQy5s6NaVpTSfksIkF5\nNUEntdOT9ji0/HpUK2Hd87wP0mrKD3LPChyU/ZOUohJsJ6zLB02CwqluW6nK\n3nJH\r\n=VaaE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb380ff13ca4b5da56a238af5ac7c5b23e278e4c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-fb380f-kymzwz2u_1642684485758_0.8102834338906268","host":"s3://npm-registry-packages"}},"3.4.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ea76d62b49f2a6f8e4402860b8929ad6b8736070","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.9.tgz","fileCount":153,"integrity":"sha512-hYkIZHsiZs9y8IG2cnLWKYmPH3+OFuG3wecWcSgzlTYG2zx7e4RqtWY39Y30jyU1SqZ8VlTzRjplrpLPimmnvg==","signatures":[{"sig":"MEUCIQDjg7hnEGjQxLEdLykml+R4v5F0kqzAVp5/XmlWFf6dpwIgKeZ3Z0ToqqfL/a/8jq2SM8hhStjGbqBCRUQFM1qaKUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6WBkCRA9TVsSAnZWagAAR1wP/2dA/RiFFBhiGYhDEpx7\nTZ29vzVx/bOBslDX1yee5PxsUw+OPSog28PLdy9OhCCiWV2MhneDxAKnFRsd\nHP+2Yg5wdp27K4NYBy6KxNf4cjQr6fqmrxJaIEetCGlL50Wd0R2njTzhf0M0\nC02C+5lsFCA2J2PzQU9Is2ycMS5c6GTlUgpfuj1W3eYmQMuso9MaYrw+tSDJ\nkuCTv9kI58/YapkoS1Po/2ZWzGMOgEGISBX/e/idgMA+b1x7jBs3KJ0pwwdw\n3R7ZDEHOohrWm+vAAMCmqYRNiLpQKdXNhHLtTFI5ubvG483fyyA2clDAxi/v\nU+u+CV7hPBDE0tYC/bAJ9Un+HodxyFNqNYz4ciFBsVYa3TSRABSuh0SCsEyn\njGMouEyyPRZmMXONosH8etGXX+8v2mS0rAl7b98/awvWtZwqXvbrWWbFOzbr\nmMs24IWIfR0l4tjXZOQGm8Q/lvjeCW9RYHd2tSyN4E3GLEMiXbftz1HuTCX3\noirFzc7o/aXcQ5HP03E9+zPiGzuVjBVgVmzCVC3laTsifSsyRRAPcw6ehnAg\n6E8/kTAqj9uPB9X4p0c4q6qyhgWMBAKISYSAKsCHuqCt3SM6Flt72WwlgvSj\nnd6Alu0nu4AkEMS9w9RKSGAVSwlUJ1Z+j6k+0jbm0LEsQqF7FYfMPapCBRFx\nyRSO\r\n=Fb2k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3259d8bdcadb1ea0e1d05b9cf8a2a8e3486c3417","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.9_1642684516594_0.6985479220643631","host":"s3://npm-registry-packages"}},"3.4.0-feature-3cf69f-kyn0260t":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-3cf69f-kyn0260t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-3cf69f-kyn0260t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"794207e6592ec41cdc4c7b3b509358153a4d3b84","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-3cf69f-kyn0260t.tgz","fileCount":153,"integrity":"sha512-cSOKM0TQ4O6T1a5eisFNanW2s5IzyRJKPMO03lfjeGI8HO7KhArTRMXmxGyPHVSqGfPNOfLrjYSdhJ6Z0jS+CA==","signatures":[{"sig":"MEQCIH/olzv4MHRRhcaWOLgELH8UL7WQVEZoh7CSMkZsBmWCAiA1DmvM3xKFuYd5sdAuG/D0AWXAa1dbG58mTfTBsvPUvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458272,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6WE8CRA9TVsSAnZWagAAlZ4P/3p/GFsaZleI8hkIBHSl\n4AcK7x7Cq0dlHBKK+kSocb0wV6dl6xZ3Ctvj9TV+/AxQnnMPabSZAUCpXp6h\n7JFR6Fc2ESzznBTURhVeN6/HeEFoXJHgMWhWBoPJViHSnAR/SpVs//o+XhXM\np2T5U9uaF8yKfmS52CDfpjMyMH18Rh1DsGMPY8wD9LGlGd3uxifNuUMyPM4h\n5baRb6znhrqUC3ZV8Go+7tvaBtZXiV14eJodo/HG2GGDZKY55HVRhlskDVK9\n22xIdsBb+HeTgmA8U8BHxKvYrqPq8BQNv6fCU/gkWuts/SIJdyWWuTNDaFwg\nPL/OXOQtYpjk9N/2GYHYoEbzCi2nvYAFsmMe0CbmwElMBljG/WjIk228OmyC\nqjTEHvHunpz19eyYBvrX0JL29Wtz1XER5Bfcm9TasVWS5A+5GgYVddbtcrv4\nLvtJQMYHr7OIBq+HSVdyzWKkxeFzqoQRBgAtcYxqTv59hEIEdjWkgRRbUuwY\nLiOY8qrwV7X4nftv6FdbulWGh/e2wK/4tKUhES2ZC8ATYCRVws7x0aWmN2Os\nVViklbLPPZvhVpbYthpioiDIJoCHJUZfycQY81/cHmrxac+wqHhXakCF84KH\np55D/YjuQh9zoVPBros57wxJODSp/PN1ePFDMSudKHbmdJ+o2gK9keAIqgch\nqXqq\r\n=LKl8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3cf69f44704879bbd9cba8be4d123f6577836213","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_event_data_to_flow_node_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-3cf69f-kyn0260t_1642684732287_0.6905515803486582","host":"s3://npm-registry-packages"}},"3.4.0-feature-e5e078-kyo6bisf":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-e5e078-kyo6bisf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-e5e078-kyo6bisf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"86578aaedd6fd37f5b97c8a3276ad015a1cfa487","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-e5e078-kyo6bisf.tgz","fileCount":153,"integrity":"sha512-dIZQyfrDwAelw7pQJCD5/huWP16nGuxchgBzlOKz5SwMQls5RTIwe2Bej+1A1sEocVnsudUhqeJch4ia5emGaQ==","signatures":[{"sig":"MEQCIGmxS2Xf6KZDfZCzp8rdexvNbhoVDTvc7emE8pG11lHTAiAy7nK85AkxYhjUx4ampreXktLjcklc2Ma040JzZFEvdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6nZ2CRA9TVsSAnZWagAArvwP/20qPYxz5uTpKJoT5FwU\nn0+aOZG7vZJrCX9AJqutrTh20QbyxoTBxwwJZh0zicZYYk2m3zX2RY79Co4h\nMVC3X7+iO+UA8h2IjH393HgCc/4QTLA3xPL5MOJuTcUiQpMrfTFvKgPD4ZG3\nESKTRLmF/Lp/LBL1KsaiqDyPDNRrrvm5iPXYSuKvIXJjV28lGAAL5p8BW/ps\ncuCBfmClL9l02XkSYngJWu2cumwj4joKkU5bKsYY42Io/4MBmSPhg4KUL8s9\n0CpIrVfG15n5bptSDhgQuEdzJ88hfHBndqIInb7QEMvBRT/V5NOx6rmrUBmO\n5uR/nRHrBVde35ri+e+2hkdgVeAuaMZqp2Lchi9YcZyOFrmFN8LocSR6Y3A2\nSM96cbN/Q9q0iIkjC6WvYGG3z6SbOn3h6cpazllHGBzRfZ2ruN60mTYQV1pW\nPxmvNtKxJWRbLYeBTK5ATcBD2ZrI1Wraw6TSZXrjJtz3fumRzldtGu0jyeQz\nxT7ixdnxLBPJjKBv+r95cMywOFkejg/58a3IPizyiKFzBD0EjJz2ur+tCnpN\njw/tU6cELjgYaQuyo+IeFypN1N8dimD9zL0shJYxgw3zo48gIvsgqgR2QIc9\nM5kuONLzVg+KB8e0UKNCM4SgYSvNTyKCB0/b3/VnD+58XDDpgnopH2A3jZhk\nOcpU\r\n=Vxgp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e5e07899fe3fc6a34db2398da660806958e3bd3c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-e5e078-kyo6bisf_1642755702634_0.363196292443666","host":"s3://npm-registry-packages"}},"3.4.0-feature-1ca315-kyo6jara":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-1ca315-kyo6jara","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-1ca315-kyo6jara","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2b1afaec569d9e3bba3fb299e04e224425cc4acc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-1ca315-kyo6jara.tgz","fileCount":153,"integrity":"sha512-Bzin2Z8U0UaZOGrMOWCkj9MAb1WSO/SEUDO6i30FxW+3gs0gxfK19bM7OlLUlfciKX7b+SdtwTl0gw7kQlaUoQ==","signatures":[{"sig":"MEQCICpVJ9bn882b/06pK/cYm5xTNGzye4fsr4FTwz0h/cuyAiAJnOBLx/+NFtvcQ5Yeb4nbfn9pYti6rLG1PBeI1zHZKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6nfrCRA9TVsSAnZWagAAhRIQAKUfng0zflWHVelpSrZv\n3H7DTtu7ilXG/TPveXNNW7EUJcV/8pbAmq0K38s9dx+pu0X4GtqOYJp+bhIZ\nvlIAWESUYclKw0JGM5/TR/3s5GCIqQ08rGmfPBjSEOgQwrUzaWRGNNsQD6c1\nZz+7oUG+21bosujNSpd6gJE/tIcSNJ/nlv4jf4CqtAg9GFFBnzA1qrLVN/Nz\nCOk0hv9wYinQYVZO0iSgDSPWSQDvafUrusQ49B5O2COKUFtTG5SMuSvLe315\n38oXTGqqI+O9xrTuvsdb2eInwtrg/XDRqLXfY9k2cdkgTMgWyHK0zxmK0bJT\nc7p76KImdr640U0wefuVZYrgqtgrECw6Lorb5MK9E5xNNB3wpo/VBKvUrowN\nBvrA42yp9hKTb60U/jiz71uuPtFtjWs58fDVmUFC7NEYIOARWKpXd4JJU5UO\nC46qwxRLF9Sb1b9dP6570S86xp7GVQVTsW0LybGoVGCu0BeVtjTmPVi7z4Az\nmzSbMyeo+UMaYEss4b5RZANV8BkYKEdjk8vGoQoII/i1kLdbkfH8DAXS7668\nLIl6U3/lPQIz52MOWf2/yIKciDFwwe+ZJ8r+K70q23Q67H7AqCgxqMI85zv3\n0pLQSOGDlTudkIPcS5UEe07Tdo06dkG+V/J/Eq49dhht1+zFPeWl6C5fQfp7\nZMal\r\n=IuI1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1ca315c24ac8bc122298d9a15a39645e0422d7fe","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-1ca315-kyo6jara_1642756074822_0.17617286171906543","host":"s3://npm-registry-packages"}},"3.4.0-feature-db4b7c-kyo9wlai":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-db4b7c-kyo9wlai","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-db4b7c-kyo9wlai","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74d2ccbe14f34670fbfb01caed5464904686d50c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-db4b7c-kyo9wlai.tgz","fileCount":153,"integrity":"sha512-G1nrkd1vn3LfymLPSFTlLfGnjhWnnnOuhuB/EJOowbZGF0iQrP32aRAazaF0g4Qti63OSCoULBrl/xUb6MjavQ==","signatures":[{"sig":"MEUCIAmF2ix1GUe6jY0pzT6lrfoT0YXQ5NbbGj4ZyUiYowRRAiEAjzMgCYRAr9vCQ03yZqQTT+maneq4eQd2QQPLlLWP+po=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6o4CCRA9TVsSAnZWagAAaB0QAIDBD9r3NkH7Xzsql5Lf\nzVzmOSVvpH6rSdlVVVkvGUdsW89h6VQri1dsP09+kikf82/6bxeGM9vBA6s/\n0NMCasIyQ1Yz+MSEBY6wf1Vayus8l0otIL+0CMeot/HsxZKps9hlAOtSPrMm\nl0vqYLlUzBBaMD/CGxD+ykJ7W918LEeHMAK+MW8Uh2cdKNB+FusGgY4Ul/ph\niQovn+Gkm5WyFBbA4RaIc7CDA1tD97w8tr7sCT+GLaVvIsZGpVExVNboM7TX\ngQC1UJVh0IJM/INMqBxRrd1Uy+9beVaV6k8kL/rKjuB3+sgwqLXZQBqFexYz\nMtuUeOzxCnv3Gkx7dxRT1B5hbmpKdbK/DlTjtysJppLe3L6Mx/nWIk6e/Cpj\nwn2WqEyT/HwIR87lqWduYPSam1HTyL0J5ci7eV+srdkufig1fAgVZOD5yct+\nLJGifypkIYBLxTWWeAHRPKTC6QDq1z21eIrT6MyzoV7WhqN2EormdjyHP48C\ng8zpjESQGBjqZpZnalxwkHV1rHzg1ttR0hWex7ZjHV/5aMQ0NikqXr/zgBin\naVHzKlKVNL6lrxXsGqKF2Y+wp77YpsDAWDHfUzLjKf9CayuuGZdclVHtPWpL\n9efBKyHDonCuOfob8r5QkLfQLlajIHHnoaWhaMCxXdvSbAS11zcqq+rOk8dl\nRsjx\r\n=aPI8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"db4b7c1ff9a396e317ede2b89fc103c5fcdba1be","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-db4b7c-kyo9wlai_1642761730340_0.9927350665781489","host":"s3://npm-registry-packages"}},"3.4.0-feature-7bed99-kyob0lq5":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-7bed99-kyob0lq5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-7bed99-kyob0lq5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"14a6fd6ba8bde5463d14c44b43620aabfc64808f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-7bed99-kyob0lq5.tgz","fileCount":153,"integrity":"sha512-Kr7hUXgNT1fBvg7FfCAToHl7qBncdS8/D9HWgvVFPvG8L53FTqmI1pDJ/spj91W7uUg28RDJCskifTem7NNHqQ==","signatures":[{"sig":"MEYCIQDQFoHjOEJI6uAV0IA5Mtsxb+U9RMhAjqalFRxikG22bQIhAP5p6L1SK//vGgeUo4bmiSdsk9KZfqq/pFEpX3PR5PYt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6pVKCRA9TVsSAnZWagAAiyMQAJL+ti/z6hkJvmHMHbcJ\niv1BkpiC4auTPkvWAjBfIl7Hlqm866iXzBV+TzR+SZsbkua5uqsvTrXufOLd\nFAbDS5nme8MQXmBhLCp/o+dDRRWCFCv3T/YJc9FnhnnmICjt31waXQehkYW9\nk9xzQbjBqkNyC9cay1w1S7ANPipo39Qk5RLY5kAFquf4grPMmfaQg4ZYN6oo\nsY+l6VFE+WbMle2Yi2y+ji98H/RH/jPoPOj+o/2/4pc9F/IRScczMsEC3Qi8\nJ3vDSCZBycjOt7I+1VDpBwhSGD7P3Gced3C9042h9k1TBD5Ullyom9gfwH3W\nj5YLpTombKMEdw1mhh2i5bCVnsegl3s0h7yUJriaNxQn74pqe+DbCVntalNC\ngXQX3zsVo04iOiTJoGvIZVfRq7bOLMpgohBr+2O+NjUBHQLlYFFluWO7jkC8\nQMVQ8yWIul3TdABELrgSGT8jy9YxoBJt/FLSaT4LO5Bl0TdvtQFzPCHUC3Yz\nr/274a1GV4olTvQbtUZsub+YAJMcS9/YlWknuU91HtHOO7E70YgWVOTahuRc\nQzmMQnq1t7lPjuvidUc1UTxuflQfjkYNq7ixkQFF4OM4GQxSQhVnXWS9x+7G\n4+aSXM6yXkmnsaOKRgmL7x6qV8VPu3J7MEQFs7y6tR1OPGFbrTaoYfpeiWhc\n3w/0\r\n=sfWb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7bed99d198d9fdd3414b5fdd764ef530aff89005","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-7bed99-kyob0lq5_1642763593812_0.0632061288346939","host":"s3://npm-registry-packages"}},"3.4.0-feature-6758a5-kyoitxb5":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-6758a5-kyoitxb5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-6758a5-kyoitxb5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0bb37e6d8557b748c5226d27a56ea68e74222209","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-6758a5-kyoitxb5.tgz","fileCount":153,"integrity":"sha512-EmZDe47ScyLK48bPvK/W2PyS1vRkg3ZyaR8AwyLtv19qlLZxE3r4kj3C516Osty+CMm+9V1ofvvmfu4btyPWDA==","signatures":[{"sig":"MEQCIBKFE2o5H1JE5OZk/dBh96T4R5LOasXqcVHV22xGAmLRAiBuIS05wkHIJB/Bd4sdFo/3GshSqhLg9NHgtcvILDejOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6siSCRA9TVsSAnZWagAAJFUP/3t8Eo8Ou0Q58HY97QCX\nDvPMK1lF66VWrvWlQqkqq4Q4xcRoUsRh5ETL55VfFDJhf4WpkKpJMcG/3Hp6\nsqGM+9cyvDpeFm0lYhBpQEZgZs/nAJGnW/q8UtK4yKAeauD9k5I3cFuG1zO6\no0twUI4nHChvYxuGu8Hrw7fm0Bhi+rV1oyIvLpi5Bs0jO7QoxGxvtxHpcHFF\nRb6SHSXDCGV2u1+7b67tH0LfqoUrB5V7jNvvArI3PKin1+sQPa97ZVtf730y\n2zXGvZtRV7L1YHJYb91DfBp34QvXBO3O9TZMmJOpOW0RXNv2vbr+mX/+d+Ji\ndmD5ZfVixlsmRFczmXr3MAi5kZYFJHATsLKmQFW0NIChnZpFJAqOHQv0imR2\nfANPHDQyKi74rgZ3NjI6Sz6g6R93pTLuleyXuNC8GUVqOZviWlCm7B4F3c2F\nzPqig8PMe08LCcpJ89mYppr9HBW9MUimYQZHs+utNdZkkKj8KWwlaU2O9T/0\nhAFsnB5I6v/Z+T37I51VPGKSu9KV+XMh9zHaqJWq/zWUoxa6XD5d6pXUhT/9\nFfJOX3DSRkqHecXwAjQmteMiVlppoHg5R/C0JTjOSqmFvizLtXKPiYh190kB\nhN/dTI3KSgpH1xsn4wfkh2q9DN3wFMoNC3BV5ERSFlgF/yQDjV3lyB045Nt8\n2ZHY\r\n=0p+5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6758a5588a139f41b8707607668bc1aa959d7d4b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_endpoint_for_deleting_process_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-6758a5-kyoitxb5_1642776722720_0.5708645707163336","host":"s3://npm-registry-packages"}},"3.4.0-feature-82b8b7-kysfso4a":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-82b8b7-kysfso4a","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-82b8b7-kysfso4a","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5bab023a4752fb3511f8fe5c16d348c53fee973d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-82b8b7-kysfso4a.tgz","fileCount":153,"integrity":"sha512-yXji0+QnpSsMT0i0DYEVCzon0IWM4JQxWrZqr4MJqvVF7xdbcIrxE9pxNP+HJgKZFRF24A/HJs8dSPIIzJHAqQ==","signatures":[{"sig":"MEQCIGUDBEo6UwLNIb1XXMjM3JIYwbDocdwim/UD3sqytBVXAiBrecLp784o5teT9xVeN64SK4XsTgiLODPlIqi/dnlMwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7mV1CRA9TVsSAnZWagAApuIP/j2HwtZNcfsZ+WXZo1/s\njpjt2d4/Irfn7qpJayCUorWB8lKuDASxQt/wpA7lmp6Gmg9jMygTEdscA1Uo\nRY9zN5+BEo7gYSET7hZRNn5f8lp1zLmZLgsL7lFi+gOJ+5KDohgaU3f0eiPs\nrrDCTHsK6qH1fWv6Dg8qkj7mHp3i0KHHn8mqg5crp+SyhSu7/o3gFwVL/3VK\neKaTFv4BcxGbBcfUAo0Trt6GjYqne2A6wSVMNtbv99VHlgAHnuFuTFnE88jU\ndOirvF4fv7e9IibM3j6jpXZj3j9vFojFsvqH2FLho5uBXNaO6XAe+/m+roj2\nwiZBdul9w/5FwzrIvvKeEFr8585Nq2ausOsADOniLHyWaWmXs7yYxlxFfNIu\nLnRTC++g0pcpWYZp8zp0Eh663kEa3qmKc8onWeYG/HjViZdYNHDbuHU2lJIp\nsXhKTkzAHMM9uZJGQ9DaMIfXMZi7b9nd2qgax/fejqV8dDIh1OAKovPuG4uc\n25tCsK7a+4N3HZ9simwKN0+LyxEYAEfZiq/TAZDCY3s5VHFqvEjhuMQTOiMR\nmfsBCqw8P0rlGaJS0O4rN6dTiE1Vh8xMb03LFxjJJ0pYFXxxg/cXmw1fMOz4\n7fr1aZ5O0aCaZbiXYyw/S0YnwONbjniUMd84D9PVZCLyMzNmCziS6+JbB9gh\ngpHU\r\n=2y61\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"82b8b75e327ca8b994a33feb585867c0900cc10f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_endpoint_for_deleting_process_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-82b8b7-kysfso4a_1643013493434_0.08444305003256791","host":"s3://npm-registry-packages"}},"3.4.0-feature-d6f757-kyu4xzjy":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-d6f757-kyu4xzjy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-d6f757-kyu4xzjy","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f0ba89cbf8eef9af5c98d7cecb9560c0c53224ab","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-d6f757-kyu4xzjy.tgz","fileCount":153,"integrity":"sha512-EtEmQGJEhYJ25dhdf2VBP8A3SQJEYnRa0oAkNZaQ3KFB6YTtw02EdaLxbUGm5BOeP9tqCl+KkVt5tErYkBmfSw==","signatures":[{"sig":"MEUCIEQRljltXoP+jvO+2dTjCKxeT0eXz+9ZJRaGg8vt+CvuAiEA0/wZuImBQrxcfpZJvSQ9jg1r4rYt2d1Y/K6JRHQpw+U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":459064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7/adCRA9TVsSAnZWagAA3T8P/iFn6xgvZLp6L4JwmSIH\nq63bKCUe43wg0JJIVNW3frIPVbqYb6XFnVq3XKlcl1uE0p/xU5d0wuEvFFoP\nktPoCMwM/ogUJAlKihQLtTNAqd76CJlWmZ3OywuCSALn6/cwki93EoSTGt66\n9INUXyulLxKgbRmOWGv7BCR4liaHZX3SZ+zJes9lLuBnMhM3IdvMhBLIGEhd\n2aw9doCx+7bzNwZNIJHSrVrM6gLM/TqclhLMuQ3gunQOrRm9liGJkDDkRGDL\nykwgQg0OZRRteqHO7Skx8siehDqNMv17jZeDB2qVZQ3nQo/EdQTuHLTmLfWf\nD0J5sqKk2lyncpn4w5Y50vwSXlFA3/HcI38GijkSqkLp4I+gqi2xfD7YUZ14\n/E9+A8kaYobEsI5Toe97cRQXWXlIWDJldr5aAHU1wO877oWDNiV14S0RjV6t\nlBqMAcflz8JGHciTYybMyllmoJBkrH/UYxRA8keei8l0WoX71cql1a88y9Un\nokVNBhztxdv+pHzEWr/+2A/yLH19Z0qb/Qc3NFdRwxAEr+Y7AwkjAWdvCCcg\nWmfqZQhpgT2NVPfdhNUUdO5DSeERGydQClsMssvb8aDo5p+0kP7LwNCI6v+u\nsVLdPZIi4bIz00zcjvpc3fLSmnwXa00PQjNnTEALphkhic1cl1tv3L9mdCc5\nqpm/\r\n=T5sF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d6f7577c0d2908346c6a2dd210d8a536e3789562","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-d6f757-kyu4xzjy_1643116189310_0.08442148597211596","host":"s3://npm-registry-packages"}},"3.4.0-feature-2e83a5-kyu68p4t":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-2e83a5-kyu68p4t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-2e83a5-kyu68p4t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1f308a490a562d094f7b04adcea398706fe4db71","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-2e83a5-kyu68p4t.tgz","fileCount":153,"integrity":"sha512-WFNv3xWH0Nh0zMagmjyvk22rpOSzmJH0Dvx0cwIV/5uDU+JLKY7YcpxhhrU8g/U4p/O2TuIjVzXJCwJ0lqfbJA==","signatures":[{"sig":"MEQCIG/XybK+IIDi1LgmKU72C2naB0LVD9I5bQa01Ud3MxWkAiA21sDpCkVQuHND04As6awykkEhxTDiBhrg4ztx7GlSrQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7/8iCRA9TVsSAnZWagAARasP/1e03MnUPdoTPgUhmjy/\nKnuWhsHi37svtHP140bckFFewmOBQjRRJVPaG4GXBhpfUDk3EPBWL/fKtvUy\nKcsDzhq7r8N7UU3xbfLPWIZMAq1Ia+LFWEmsnoEs3XH3QaIXIFmWu2vWZuMU\nRMc6AdOh3TazaNIWWJ0ukLLnpUQ0djBeshypyltMSVwFeZP+Vm5hwfvsDv5f\nx8mvkFpKtn2utbWv9A1LbhMApz/rr1ucS5sMuT29gAg5Q+wFyRofFnCC8JGL\nCINdl0wA1cGLYfeS6ZAU3Tr39hSoI8PGAbNVOJ1hRMr8UoFl2J4MGNCUiZeq\nqS9TFR7lrBZTGek/VtVbOKuOnGeVkqaRurUSlE0wFe4qh9SqobFY9DChusVv\n/wcyrOAMMCKBqaQA/nwLI6JShBz1R3naLjwVgqV9u+5M1fOef6yh1VEe5Va0\nS9um/vhZLmBY+zxTslnOCdKZRQRaKxTW4zLVAp0aIB5fG0i+hQTXxieKUD4e\n1sur7goo/fJd8/wxPU4nNG4XB82aydcblGpznuM3ZPJC0s/iGqA+rTctf2X+\nNPUyxKMuombo9MGmwY4eF39cQHzefoiFw/n4q4Ds8zSM2zT9a9DV3Tf3hjK3\nAnPYirpGnKo/IGaMMqtaQ+y79JufVmkXATQcOaBH4ybaAOTgEw2CfYY2NVd8\nCZy1\r\n=l1ek\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2e83a5a5c35bf35f796e74ca56467d241bc4cfcf","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_endpoint_for_deleting_process_instances"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-2e83a5-kyu68p4t_1643118370548_0.03707068726508833","host":"s3://npm-registry-packages"}},"3.4.0-feature-387f29-kyuc9bjk":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-387f29-kyuc9bjk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-387f29-kyuc9bjk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"97a1f465b6fc952038a3ae5f63049bc0fb7c3851","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-387f29-kyuc9bjk.tgz","fileCount":153,"integrity":"sha512-W9bH+0FZt57F7zaKR+5B+6/R2LI7DA3Cd89AdMfq+hjPmGarIYGPM5Eb+Y5nbZfJpVEmoXISJoMoAgNWPrnCOw==","signatures":[{"sig":"MEUCIGJaZ9Bf0NF9opW02HLoNqAYh4UqRA4RIY+PYpRwI/r0AiEAvmOy4wkek6piWEUmYTP2pkSe1pUxsmetT545zeJgYzA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8CacCRA9TVsSAnZWagAAmLMP+wUwbGh3dzk84oHciW9V\nIfMa4nUyOdMvxKDk/MAAwpTRjMOMlIZfWwiam7uHvvGeA2VAZl6CuR26ZVQk\ng5WQtjN5dzejQJYbr47+U8wKQ6w9O8aE2r4Tpxtf1hjx6BoupX2bc1hZ5t0Z\nP6zGapssefeHOhjR7MrX9i2gRdfyrR4WFl8VIby+KeBWPKKJ+BXaOYb4yfNs\n9iyxWlHRUHCNvAZ5o5BW52WOqBy6YXpg7A7siMboTX2+9g66nU5ldJSXH7aR\nO0zCaFHtRjJA2EBAfw6FpQLX0u83kqLBbVyg69qS1+ZY1d/VWPu0PNB/cJDF\nGqJHOjM27/NhW8bFMJfurHVjM1vX4eE4zc/ljxbR9Dmee4XfzNKX6hlwPEFD\ntFbVF/mZWsI2NPeHdrg/lGhHfOyB+8YxpHQfguScRXNUsJ6jPDKz2c9EwaCb\nN0wTmiTK+QtokrMj7SEveyEdzjPRN+cmdIxkT4BUGD0NIq9a61Dseitu9N28\n2hOxbn5udXMF0gAjVd+UNcFUOBXnozw97fcDyxpj0kF/N6YjaqKCCWf3mzbn\ndLf1wnDruxunBSK1ipdfhywo9COwJmei2YR02TBU0RK3/Oi8y+sWP7lqTOND\nQQX+QXLp0p66Osc9X1Rb34QvXVcLj1nzBpiUgH848D59qFo87JkTAIzON9p+\np9PG\r\n=6jxi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"387f290e6c63c7f83e210ec4bb3802408651318b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.2","cross-fetch":"3.1.5","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-387f29-kyuc9bjk_1643128476811_0.9468437682627378","host":"s3://npm-registry-packages"}},"3.4.0-feature-944580-kyucjcja":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-944580-kyucjcja","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-944580-kyucjcja","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"408f58f4bdcec8cfef1fc26d49b802f6a97b747c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-944580-kyucjcja.tgz","fileCount":153,"integrity":"sha512-h27r4hn7Xbrka3bWAfQzXA63Z8bLyOusz5A87Vfg7Ms7pZoxqOFIkw7nJm+5UfLZCXYWtKiIc3mZf9auVWvgcg==","signatures":[{"sig":"MEUCICBhmn8diPTf5rdET8ra2xNoe4B0EC8nUvDtTRwVk4VIAiEAjTRxnmHwHrJSrCXGslI2zepD45XqbjnUzd9VXtPgIwY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8ChvCRA9TVsSAnZWagAARUAP/1dY7wbDWVqrmEwYH4hd\ngI7eNlrIrdTsc0+2BisjCU15Q1C8siJar0VWhVxcBbLDvdQ7swe1rN5zNNEy\nBvLOPo/tdF4lzoybWzUsZbzAsBv3oWjq7+TkNUVRcXKCc9U/8vfKIeB8mMOM\nsXhTnTiiSxHYoCowRZ8Lyk7wq7gHggDwEjV9/4Q5C7/HKdFAAFrLGx1+PwrE\n8F6gxvbpAKeZJGvBQNek3lCEZNW5+DAhGdPuuENX2CKMKDrxdbWL1D6DEBv2\n9DLgwDXlyCaKzRutYh4EtO+2v2cqdA34/gA1CjCsDhYt7hDIOEeO8ZANt0B5\ntUGI0MRsb+4JuRvO/9sHgIu3Ta6mIF82Onjpmw32YIVD0wASHckXDEfbJjA0\nYg4FBkZKZmKkBbqsH5tXLYE+qa7YUVWqTvqD1BBb24524i2mEG5Yb2bEnNFC\nECeRhIZKZ1/y8ODxoLA/Ig0OEJ46xU1RDbuiX6KcmfNy9ADbmICobxV0xGgQ\nn8r0wo1Xas1mQbillvzOacT6VVJ4R6gwxBy+G0Ca2HrdGy7/92/AEaH8gnOV\nDp180QOOCKvxhF7QDmHLMCg75FtPWpuZHjlOOIihci7/gC1RwXcVE70Hcpsq\nBmMMtaGyG1UO/AxWNX0ffs7GlPjqHx8skcwlffDpuHIJx650CI8ppR40aMFT\nuQYo\r\n=lCTG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9445806dbbcb5c9db86ab5b4fd6cfaf48cf0f6c6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-944580-kyucjcja_1643128943179_0.355952396475","host":"s3://npm-registry-packages"}},"3.4.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.10","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ef03d965469a356ee78d7c079d90f01da888a785","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.10.tgz","fileCount":153,"integrity":"sha512-nCVH94j+zxdwUVEt7gZqohIgeWcNvaWlAQz/quxCndFn5rTp5RKwisN4C2rL5LTFvbPwWWMGuYWCwjfjini3RA==","signatures":[{"sig":"MEUCIAsBlxVacaZJgCtQ37z8GysNbLvzy3LKmjrcyJiEkE+wAiEAiHkp8gCsvB+WJ5JO7FduD3gTG3QBykniBeu2cl8HiNk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8Ck5CRA9TVsSAnZWagAAW8wQAIeV03yUgrZOyk+YtvcH\n+2raCp9+eQpSkfsG/+gDwaYmNFMscAi51B+C4bPJLD6XhmbNOzERXsR1r9SL\nCbm41j+aI+T2ATGAyDN4d+Bg00m5dUhLffXagixOW7/6YSRBFN8OuZfFRFDJ\nRwHsCJrWBYDc6AuJjHzCZYxAHY1zZ03aGlYfphnuTuFy/GHc1iEtnRFnlp5x\njyyGkXUvQ3KuunWmpZdvUCVBMsbEsR28zo28uLa9iw+dl3LC5RpOUJXDstaZ\nZedchNmLGSNMLAcvV5KNCFpV7raatwmXx7XoZ8f86byRx2miXnXjZ0MDcIrr\nje/tujUbRkzBZtwWK7xgTfQfAT3sDBdQsPjioj8kvCtEt1rGtWcuYLQuywOE\nZ2ueYowvBk0kfMxFZRFi3ytKHlUP5I90BINw234x9d9ohOIsMhgVi8oiw7O6\nDMXH73TFb2ccI+UmG0SwmN4cBQVhRZbg9BMwaPTQK9RatkloLcUqEsvJopWj\nSWFRliky3Dy+x+ENbOQJmhQOcGJ0d9KEpcNy2lR904OX8vLpmzYtVuSs4YaO\nbHYxcg6ozcrH6FSUcOYLG1ZnNYnAN6ay/FcdvqJKwh2R8z8xzi8U6UgFPzor\nD745W2JLrZBPORU++9O1E64YhRSrFr+WYu+m1SpGwZ4HZ48W8AltmFFzHmtC\n5R+l\r\n=87/U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ab5419d81688422fb12bc6cf9be631c12ae1085c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.10_1643129144886_0.5039465175393765","host":"s3://npm-registry-packages"}},"3.4.0-feature-2dd7d8-kyvm0j57":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-2dd7d8-kyvm0j57","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-2dd7d8-kyvm0j57","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"97f09d2c5a682b836ea9761c8291b4e5cd47bf6f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-2dd7d8-kyvm0j57.tgz","fileCount":153,"integrity":"sha512-LKx5UdSh9mZQdGjax2UdvN7NAPzPV/VEqWPrRL+0joE3KzVgk0O2UrOHxE9Lxq1eSl6FLOzSLan0te1hE4k6GA==","signatures":[{"sig":"MEQCICJnpPoPlN+9AYynHC3sJ7onPQSx/JtX+U5/AIj9e8A6AiABCPNd1xCmCcYMebd2KkNq1thbetYTQhkx6vSXGyzcIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8VLRCRA9TVsSAnZWagAAVqAP/R8RWnOxfVUgTj0v5gy3\nV4bigr9n5VhvwsQSCALJBU+oa6xst/RXr5t2L4VN7N7toJ6Qv4539JlOwCqK\nNasOdJ4Z1By79uU+4SjXEv03THqoV1msAkdCK6Ro7Z56PSQuIqUMByBTISgx\ne6ezTZwohBv78ljK/bOckkXNAC3vRYtFynszuPuFa2m2janPdg8JFzHRMjyi\nOQtEE1uPZTjtvYTomuN72s4ME81mUY4eO0RlZx7dZUkxVNzXYZmAsVmD83pR\np7BvpyHTgjmh1tRGhJrrBTQ23FZ6kH2O4iAdjSzN8R1Gu76EmUvMKAcBoShk\n7MMr7Lv7FKgeNLqRZ3hub+p82qONtABTaOBnJEtjMsYccPU4Jjf8DKHSMnDk\nt7VTDdkYnkXPAtZR5eSCPTAfpAXaYTe3a4q6HbeOmFDPjJ1xGU6RpwzqSs/m\nT0K9sK/kdSMIt1iX2xvPeEVyLqRPpANfuiuxyvEKQkd5txUAKSsk/jwPvL+m\ncAkVlkhMCf4DWIaCDbkoRebsSVKeFYtsAtmpuWQ8ZNUKE22k8Ry6ORsetuRT\nYB19E3FdixFkzJ0lcLEcLC77vjSlwdPjP8EKBXqXXW8Y5Frh0yBKoMijLoo1\n7BVZCrnGEhANuxYz3MayS8nzWXq3Cxh6pya+YQT9HKAuji462hw0rHBdx99V\nrTmC\r\n=weon\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2dd7d8606b81505626b64807fafad0f61a30aad8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-2dd7d8-kyvm0j57_1643205328811_0.13412647690779989","host":"s3://npm-registry-packages"}},"3.4.0-feature-c956b1-kyvm6ie9":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-c956b1-kyvm6ie9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-c956b1-kyvm6ie9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e29fd49cbd26d576283239bc80180e98d9d76ef7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-c956b1-kyvm6ie9.tgz","fileCount":153,"integrity":"sha512-VBvRPOt1UEH/AaTaRLhsVtvm6S8QXyzysJYiAqsiGTJ962bXHXQJ9TwIg/uhjcgdT8rtJcPpNTm+qa8W8BB+EQ==","signatures":[{"sig":"MEUCICnqeOncecaTIS1Cw4fdtw4liDv532eWEk3xPRYhqQrPAiEAvMpDdrlI1wQs2u7H/c+rkBekAl9ZvTKOPn2ljvqMBrk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8VPpCRA9TVsSAnZWagAA76cP/Rj86+Wz850DAENnCRVh\ntnQfiIBp4TbanSFrGlGPIIezNZContOCgg8vFBh+jJB9rJrAUZXnrwRVRLFl\nj7kM1tg107epdO0TqqJvl00HZ1Pv47Y6RNuMfQ8JSYfVuorsUqQFq+CNHO2g\nn7ZYjzBSkzERBbXg87QV2hQxI98+XvVvmOfLQ3qFUIgrLQC9s7MfcA4yZMdQ\nfCQALwJMI8Fky5OB26N5LsEFki1WtsHw091EuclHuvVx82yXW0w+27ZBaKpm\nyE+kWoayskGEGXBZl73l7QauwUaD8X4lX9xxa3nG7bPMhm1J5KMf8387aIo1\nNZlpwjqwQ4kZlZHDX7QowqQB/v/m8bGe6oRJFOFJ6AAysNSqaFUOWEes7GgQ\nnjcYW6nHz/tbGdF60XrmW982zqvVJS4MC20nJPJi6w9SvQJ7JURMlIM5WG+b\nCr+hdh6UBRf7hOqGG3FUYpam3g0IKOBPw/4HAOzXhz6C+zXV+LdyjQi1bdaE\nKvEYpzcX0FKhDF7zS8RTUpAAiuN318XcbDK59nR5T2Vp/Oovz2dQ5yzCqQgn\n+ZkeUZbi05vp+akn5rc3+BsilA7CQceZG+oS4evlNKUxRVuZ5iI300Fsp9Rq\npC+PJlcsYXgF1BDceUD1pNd5q9mpsvcnMdLypLeaMy20C0wa3v+5KuoXdcAA\nnfDP\r\n=efVa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c956b1c658ebf59b2f3fcfb3595e1d9f376dc123","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-c956b1-kyvm6ie9_1643205609349_0.5394597273967174","host":"s3://npm-registry-packages"}},"3.4.0-feature-6379e8-kyvm94hc":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-6379e8-kyvm94hc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-6379e8-kyvm94hc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0907920f06cf61b5170000de3b3b43d49cb476c1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-6379e8-kyvm94hc.tgz","fileCount":153,"integrity":"sha512-eV/EXiE3Htjux73GbizETnxno9ZGx73q7f/OKVhIJ2uDlHh3eI8b6q24LM9+x0qK/MOC8zvGFTKuBYifDsZ/DQ==","signatures":[{"sig":"MEYCIQDLR0BGVnR/zNKcubmoD5WMEO9GL8fvRhJ3+AvMipi4pQIhANaqpgMkCNWbeXlC/6sYQwHRMFuO4mflQvinySd7fsDd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8VRiCRA9TVsSAnZWagAA4K4P/i0z6oS9gaQ/i9HfZAj2\ne9+0za7ahSMdqBuHaNAjSjA+t1r52Nku02rV/Yqx5FLWRfEyc4HpDlc09C+E\ndTjV1HKznWomSonh0crfpxp2pK7xCGTE8MZ3oMqbTL2GPRWvqspj01cui31D\nF5B2Z6jZcsCWaKSPqOc4DXbVUQIp43fjq5KXaioE8AZrAL5Pn6UyiKpCtpUm\nVE47SNyDWL+0SP8YCtkm0GB6NvJau/7C9lxgn/5jzhwRRP+L9kyJvB++/7fg\nDjPr5AIMu3kqAAL7BkkcrrCXcjbOg8zJdBeDlRhcCC/hltYOC2O31YcCnI7g\nXzqxCbIQ+hhCVJvP57sTMuUe3DMlUkb75iqz3rc9oAY0x5oJGfwSETPnn1P6\nR0hSieNiGFwT6en3TumPIHunpdlboiuGio+gewvOuJobhjpaJ3wELSgBFb4v\nUks75LdrmEIPsZ+JrSklIt7OAaG6m8qwiKKMifQHVOYCRu8iZhJMZ+DlGZKF\nSvOiIvWwK5B4q3tjwqA99KvH+frU8aTcWlfZuNqWQZr1dKnEw6rs7f6bYFCl\n5ChUbh1p9wPgzxDasG1y4gpuooeijWsrA8ryPHDZcOP8wdSaWGRTEEVY2Yis\nImWgbnH09V7nhM54v/2Ennvoi5MWdqkYO+y9rVHsa9OLBraAshEQ1wpDfIFR\nEUXk\r\n=LaY4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6379e8ce005980f6edb70a84bcb284d2d731efce","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-6379e8-kyvm94hc_1643205730414_0.35394655844638834","host":"s3://npm-registry-packages"}},"3.3.0":{"name":"@atlas-engine/atlas_engine_client","version":"3.3.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.3.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1cfc603c0e1d7f991c09445af08b8f3249261b79","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.3.0.tgz","fileCount":153,"integrity":"sha512-3XZtGvV5USQGLpgE5E9K4ctXbPX4cJxD6/GyfGTk2ubNLt8t05cf7ZSSvtPoNuY0VFxPAXXMuixLSj1Nx86lPw==","signatures":[{"sig":"MEQCIEGR5enWCYXetTLgaj04tAnRKC/masfUF82T006ResXKAiA1TT2Ld7Dl1MbSw2vUMdiyDv+ct+3Jj1a6SFlT9UvbQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+oUuCRA9TVsSAnZWagAAj7gP/RQz8Gx8QfnNGuUwX99T\nXn3CzVnD/g3q+rDjU4m6dROOFNCTdGs3atAR60f7hPhWC1fYE1MksynJmOjb\nvs5HLdgdxlgXOjYGnzJ07qq9opisaAfhUyPbVlXr1/YV5MnKWKKIqLyIJFQk\nrM1YxIvCc/THhQhSNIpR87ypgn5fBAmNPH2ubwQ4JVxrIUbj8kF+iYgYQvs6\nOjJKWZkSTRNAi0Aw/+RegXf+cYdMssDdY9u3d65rnVV4rOve/eNaXEbmsnMJ\nTuX7ImMde90Wx/SLI0viWJYg8D9+5bt6+lAo4j6JrQ+KoxWAOG+PmwzIecSL\nFHlrf7WJPeQxpCz4+zk0uj1nsSGEetRnD1P4bfR1p9+e8mdtHTTdRuWbTWXB\n5y75RKlOziB/6FmP92FEBEYIKypjjrRHYH2KJ8vduDI1GfoFaL69o1avtB6u\nh+TvYgG4/wkJdbz6JfkCEL5mVAJzwyWJDoC+HPq+8IO0Ty1h6nM/h6XHNscL\neQm1ixprItr/oW254PBgj7btTJ0V/hNAHG9szFUchEsjAS8QGlekYglpq4Df\nwC5lDL7NZT36RNy3EvNodzdR0ZNohGMwmv9YxmNOGhXR6X/OAqf6Eg83cj0Z\nl5il+2iJZ6s7xZoV4lxs2ZAmdapi/KbsIPrVpwNSaYIte2ZHoihEP0B6GnGY\n0hpx\r\n=t4ih\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"ae4b5a7c76d01856d2e48b71e12984da5ca57f73","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","express":"4.17.1","cross-fetch":"3.1.4","@types/express":"^4.17.13","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.3.0_1643808046686_0.07270773368248307","host":"s3://npm-registry-packages"}},"3.4.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.11","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fc6e1384df52837bf0431ae2b672447ebc342f35","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.11.tgz","fileCount":153,"integrity":"sha512-8Nfp/21vjuaAU8UQb+wvmh1JB67nvcK6kfYq/BNqUe6tMNDI1LJTCewdU4yoZ8QjpBQlG0hJGQsTqXwgzVO94w==","signatures":[{"sig":"MEUCIHM4p7C82as9nNOrgZ8oGpmARMM+bVAA9YVdaVFWq2CfAiEAwe02/OlqJ3lrBacYGu2WjNz3V8K+nVIMC92GkN7GoPo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+obrCRA9TVsSAnZWagAAnlQP/Rw/IIIKJwJtr9pwhXhv\n8sU9su41Z77Ikaq6fhn0wU1Z6mJuf/Pr60dhZXYhEnzKs7BnmG1m2zk3jo47\nlQ7rIUolxfDmPCPPzw/zUlAiaHBVILcaF2hnU2IwNkcAOTs8lv1TroAWJYZs\n/VP74oykOVyHuP5Zj3G7xFnLV4OcMJZT3UzdG4gntaELigwHtpPmr3cqp8cS\n4cXM/vJqcnIM4wKTlTp31Y9SLy6NcQS0AyaOvvzH8Ha847+TqAN8pgGHIrk4\nx/5cwIKxMKukqJj2jI1QqAeQXl+ixldMkUKlVmeQkO3NiZE7Ms1gLKHvqOYx\n4r3MZsYf2vdYKom0OISMRqGaJpl90b0ieduDXQQK3eptIOM9Ho/WblXDOACM\n5ZAdgUylRDGgDkUQGAgynBsc5KjcJQhwqjTDt/9ogcHNGBll204xmcjDjDrB\nol7PiRjzQcYD9NlBH7UWE/nSt2V0e6wvlj8XUcxBmK17+O5X5VKyyB5zoxnQ\nmHGdraeTIGcYIwEhEtMKvyhVYAVNn65LZZ+FyLEipTWOvGXGiX/QvIYN4nkg\ndcvelOqermZDBkbwYiwehsjbHDUErRgxeYYU5uX/H9bl/2/TcrFg0MVEgnLf\n0pfHlE5/ABoAVkZcfGIC2YTbuA4Mc2l4WrL+JB1PqHWZtkwuHvzujGR4UbPP\ntgkW\r\n=Fcin\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e015660a0e326df8ad102bc4c3bb39d17ef33386","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.11_1643808491067_0.42184678541643383","host":"s3://npm-registry-packages"}},"3.4.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ba8dad9816cff55fd139e57996edcbd80226609d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-beta.1.tgz","fileCount":153,"integrity":"sha512-EDop1oPuaKhf6pww0BmOq4aBt0WVF6f4OYJBX1RsxIxhcOQLlefhBZxvAtDap2AlSaevJnybxZIEeOrCa86ATA==","signatures":[{"sig":"MEQCIFrp4KljIZfSOCph4VUARuMG5+fq/XQ/H2haDf6WBJJEAiBQ+hXQXPooJ0vjHeL28xVo1Z+F2WWlmZGEFILeH3ZwPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+odACRA9TVsSAnZWagAAaOoP/REW/HpRSLad5kycd7f5\n4k3jRIuAjcn8Wn9o3et5nQIU9Pa8XBn8iDjLewY6Cb1dMFL1KC+A4ClimEUE\nFwPNpeYq5X80daYeNI/oapSEZaL8y03VBmifQiInVJMkz6a1h0P8qJQ1o/k0\n7sJZ3DbOgWqh+7NKdsl8ppNAFowxmw04+vyvydgkA+zXlNNswp0DxuupOZgm\nzEAlb7ELrGwpPQKWCnT0tYfqpY2z0iw2yLWGEeDeUFcF/TZ/qIvLv/sT9cPp\nUN4mprmM+dOZvik/6IVxdDWsXzGKDgYwbL74zup8ezhgaYi5J1EH1Q2XxsbU\n8M5MpjpqPXB3CRWUGZN84chbPI/XY6zaSCiCzprbIESeatZj3gLnWvHIT8W1\nkL5vbg3OvQ+HRARjl7DFHhA64HgnZc8K9cofuOxAehyUEnxt8/hqtYhNBa+Z\nvrApmPnEnOdVWHtBMa9XkIS+EAm1sXKbblRyxt8P5XdvPHwnh2leVChbLtPg\nKOeXSxnMZDe4ldixmIr8CuIFrk8YyhBsBpIa75XjTfwPao1NexC9rgkZPY21\nj384eYzpnbAhXBpb9/Tgsmvwsy4e4VjiT25ZT2N1iBFNuasaXR4ljJmQ0Oyo\ncOeEscz2hyn3NMir4UmUDYXGuJUGaujFqcXPsGMITwxplyT+Y+lKhdoYJaa+\nZutI\r\n=sYb3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"90a69f18cf3a07a6732a875915bb34bd0a757b00","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-beta.1_1643808576776_0.45515202119019493","host":"s3://npm-registry-packages"}},"3.4.0-feature-e49a62-kz5ljwgl":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-e49a62-kz5ljwgl","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-e49a62-kz5ljwgl","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"288072998e0fb1e59dc8980332c7142111ff0195","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-e49a62-kz5ljwgl.tgz","fileCount":153,"integrity":"sha512-sl3MVU/1Avy80v8seZsOpXgYNz0/NbvzQ8nuquv0whUhJew7/sxTbWqExpWcvUWyxkke5unwky4kaFSeFK8sRA==","signatures":[{"sig":"MEYCIQDW4iy1CcaWTvXk9Y59QLR+xkag0SmKVXznPkiPBZFzUwIhAOT2tXLzzOaLi7+XUhDQYQ+W7RE2Bu87+LsTWT8RkJ/k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+om/CRA9TVsSAnZWagAAlcgP/2rxdphJ39RFDEsaVwVx\nGBxSO+NVkFmaFOdXmp3tW4yHM6QFTotd/p++2E96oLF/Hn1TGpdfQsyldV4Z\n0gbhI0yYyfh4TOdFFZ2kqvOlHmdJ3/z10kZXIaqowp2kRB4HTro2ker7V8oQ\nx5CPE1xCbUtq5vjXxX5nFKXWt7LMRqntqGpwp8/ddCO58L/bLHMH61wJchpA\n31H1Za01KP46QWmcCzLnhGx3eKnIx4w+w1Aj8EC2zNpbq2a89ENDkRFv2gGp\noJF+c9n0kk7IRdNKhXDrFgpe56IAMBtiEIIx2ch8NrwLDC4Qkb2JqIb/hMlP\nQOA7YyVFxl+Ey/eWn9ptpIwkY45QRQLz58cupIAMcWpCVQZdniEBpKNL8eWY\n++EIo9iltedV3Jkzn0HavXOXTE/FRt4hKqgNW8+4FYbKnLDhE7VbSixoGVxP\n+fwsARJe/HuRKV4yhKLanS9wqzjqHLNdPsqwiRNbFEhEmRhy8eF05ZoWEahz\noxd94+lo/cL1YcDRA1q9nM3vQuYhBbp+VztkP6DMrJnGKWiW8CdPU1hK/e7m\nxGrE+cSv9e5+RZaiHU4mCkny3gC6Qw0m5U1+LGv2viGObOoZCHHpzE+zC3rX\nXipT9u8sJ4dEw8higrvYmW7awlGmsVsdDzMfRxV7T8l7rs8Lss376y2FEZ21\nfrPV\r\n=uZ8c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e49a62cf41ede8f5827c4d80f5b57eeec79fccbc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-e49a62-kz5ljwgl_1643809215303_0.27357981117486885","host":"s3://npm-registry-packages"}},"3.4.0-feature-aec683-kzdvf7we":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-aec683-kzdvf7we","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-aec683-kzdvf7we","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ce3ffa49c12520ece88049ee8e06949e8df163be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-aec683-kzdvf7we.tgz","fileCount":153,"integrity":"sha512-eovF7qrMe3SFNDOx+fxtRExzZm20pChgi+ux6d3g059SoagDO4uZzHejxUowazFq8XhyycGujZ2YaD2A1fEMIQ==","signatures":[{"sig":"MEQCIAohzMiR2CIUhS6S72JCAfgMJlOTuKL9D5qCSbinVk3NAiBrgUGm4+I31PX/gWFMtXd53SwoVaL3E4xCtsHDMYhgew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAiwSCRA9TVsSAnZWagAAusMP/inHPE5+ACnxHOBMb8zN\nCvP44oZwJk/wV0DQ4OIvGJC/KhdzRxDLzcRLWy2Nb84oBix4mAu2jN68fqy5\nROVYz/grpuqB1yg33fG/pnbJt61CbT3r9q8VlkBTxnpIaKUR7JW3jUal7mox\nzE7AJXKjAbeEcthi0o9KiFbmIRIKokIfkNa7x8GOFxQjOt/FUWjd4+KpRZ8v\n8rxyE1god77UVyDA/Wlu4YM8aH2hZgC9PLln5EP6+nsmCQvzaW4ICQgJiEw8\n0GrPPMrrWsFwXX6t+BgPrGzmRGug84zrudguKOVnllKZ8N+KwMLSlfNr+hcJ\nE10mvozZlZgnM6dz4+T0pFaVK4djzvY1a5ZTOlgT4d+2o0pjF7jHVdPwxjg5\nkwp70VFr9d2tf+ZK2wC7jngzgV1nGe/chnfbWrhapEB3y+BeRRnKv/pcUg2z\nds+p+J5Y5IC00uBfCQteAUHYtL1PXr/68OiE+hcs6P0AQULRas3SAS0rVqRB\n+QLArVNDHyaANV1g4PGTiaZNO7gWkO/aCyBa40PugWVlRH7cjEFjxl4wCunZ\njIo8Jp4Wa6+GSz+8Bn1JRJfkxfqX3ke8q2WZIsfYOzNg/SNxNmi2f6zi2ggN\nlcU8b5xQ9hLHOl9rFa6c3b03ztBxyOJl3gmc4KhSnz1uKAix+Qw8a9p2Tphi\nid5Q\r\n=kwHs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aec683ffe85a9dddf0f3d02b2db8c6b73ea2222f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~allow_to_get_process_instances_without_xml"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-aec683-kzdvf7we_1644309522594_0.06916398956375014","host":"s3://npm-registry-packages"}},"3.4.0-feature-6e248f-kzfbnisw":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-6e248f-kzfbnisw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-6e248f-kzfbnisw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7d90d5a59828b962057a1d1ea869dbb7482757ec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-6e248f-kzfbnisw.tgz","fileCount":153,"integrity":"sha512-02HzwbflCqBm3JBVw3AFDU6jhaPnkiYJtDH5nc8u60alMd5wqPko1Bpmm/4qL4sww5MTkZgJMhr5IFdGzK2tqA==","signatures":[{"sig":"MEUCIBwi3bRwC5CxKj7wYf9QIXIc81WiExwyUwDRM+LMQM5/AiEA2iW1Wju9l+//vZFGNI0CQ/ETJLj00t4SOdZlIM5rmOo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA4LECRA9TVsSAnZWagAAH6wP/RrDt236vfPLHFwcDvUR\nNvFFxjObJdJfeHcgh+uN4TwHLilo9JG3O08NrCpBgTY0QD2iimpNcDdvd40t\nIVKpN73AWeroVnbYTIZBJd/0uN4+GTAfUBNNfzkofPHEZ/rSnQOjFd+JmvFA\nrFJTgU9369GimmY9ktzoOmqMc2YXFMuxxsJ2gr+VDHjXwSjm877MNasC9oBA\n938noKazydLdtlecOdTsJ2vtqb6UpkOzHaBGY+YEatLlnupx5R1lW56XG21h\n7J90vuS/fnWmlM0G5gjX4+Iewgj0Ly/+U1W2sDjyCvoMKZt+bVlU6Qwgz1gi\nEmvbWwrPP4om8ie4e1xAg29hjQRLHMxZj7nGoiXhinvuVjqBK9TZLAY1caGF\nICG48Us+lQ74P6dqxF98MxoDvr0AxRZLvIEu1f8xzps436mxLJKM8dJhOmgM\nozmXkuNsClI2sxGx9VNJwccA+kVxwoeEkoi/R4MRzAVCsqoqTrw3n52/6lWP\n8kNOwWigIP415PDzTdAFSDI1eUl0QXpRo0dKlaWr/O+14g/CbZC0tsqomUHN\nui6b2uEj92r2JjFtbrc84T8mMnK16106rIbrhWeFoZwSojB9uSoD8Rcs5pJh\nXifGLuKWA2KIn/iAssGZsxNBsnGrerCirVsae0J+wemg4iSpLEZ94je+t/E3\neIx1\r\n=e10F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6e248f16d286a5ba5795239f3fde6e039c95d059","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~revert_flow_node_instance_extensions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-6e248f-kzfbnisw_1644397252542_0.8736385882865854","host":"s3://npm-registry-packages"}},"3.4.0-feature-a49609-kzfeh9zn":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-a49609-kzfeh9zn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-a49609-kzfeh9zn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"22138e9495d6b1ac873aa4fd3c41a0052683654d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-a49609-kzfeh9zn.tgz","fileCount":153,"integrity":"sha512-WM48GnBIoO6cGpc7kAX3fCKGHklJJvWbp7elP9PRv0Io6DKiGG8uJEqM8dWlhI53xBvdsZl/rQd/MM/8dLGWxA==","signatures":[{"sig":"MEUCIQDFzY3BMzTN4O+EPLhV1HnqIGYenjxv1oDvmh0WIbz0PAIgFAyFEW917kWufondeZbFDqnRnm6yb5rB3wkSG1KCM/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA5VNCRA9TVsSAnZWagAATwIP/RQE8b4BKgzDgV+8S7BG\nTsbLUQQ5y6yWRE02foo61FFc8gB/ef+xcxvZ++mj5w/gcYV1/n1gkvf6aaFI\nxBRv7JxPQdHU5K+2Z4ymjSp9x+a06wcqculTD1UhHDPLwrc+3PhSPNC/8rj9\nkqr3pnYgekRrh8YE+V0UNj3BAHwUtABmQnJRUN2LLHKqq+vaN0sSmEEqSZkW\nVHapuWz9ujxd2PXhYHhXBHpI/2ShGj855kQweTkq+J/4s7Z5wQMAWavcCTOJ\nGECnkEjQ+9eOpN+7zBA+re1MXzWfgfWRMNZ/Ip2AIMy+eztVas5sy4yedpSo\nXqEL6IKtz3Czi+2SD2dD9WV/TVawbM9ECBRlizUM7AdZ0aQYqoeRXKoaPwHK\nwTfGfS5J9CN/KZ1YExXTVA343mYVCmw6yJ3Afqqvokd0MH3NjMzoUbWW54pE\nnRlcCltcY65hngkwVjede0CvU1o2o2YXxKW1lzQhVIUyQb9Vd/9+23shVFkS\nMyaqv1EZQHaYh/HpyNNLZhwKq7bNS0/RSe62SXj7Oogk/GlP+JxMXfftHbQV\n8jQh0sSlaveAok+W6UnVqf3IYUNW3TAF/QEFMt7UHxCJqmuX5+ShAsnr39IP\n/hEhlWJGRfIH+qkQSAlV14Ri7XZiIoxFZgCgIHQjeCReKTG1/qXNs9j5/buY\nrFP+\r\n=uwjv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a4960993643e621013dd37a0e66fde2562896cb7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-a49609-kzfeh9zn_1644401997058_0.8966505228765367","host":"s3://npm-registry-packages"}},"3.4.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.12","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"21b8437e20d9f8bd7699d7c40abc46f93c463aca","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.12.tgz","fileCount":153,"integrity":"sha512-3mPRK9hHBce6JY1zZzJPCcfrQH0/Ui2t5LqbEjojKNuyrUEKfjhDdZmgc2B9r01pWmgmVR3vnVAYXigKEU/jqw==","signatures":[{"sig":"MEUCIDPk8V8TlI2IeDm/VLTbAMLo0kX+tphlT0Q0T/Spx6mHAiEArYrqZDKHeaJy8nMz/oFI9RUlf+cgpCBaz8mKiRjNjVw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA5XCCRA9TVsSAnZWagAA0S4QAJSJDd/lmpqqzg9gcYXz\nLTHy4Mt/YfVg2/0YK0a+cFyoT5FH2KE+Fg+vn+ygM9SW8uGWxdFWiKfOwj1N\nINOdOH7Ai46itf/nQeG6T6HEJaYf9raB3gdIbiV68IiJiHn4+qInBQGXUVKz\n4KFshEORPGIwGtgYvhu1bJdZj9fH0UwsoKAY5rIoBQGdFDk1LU+KbMnM+Vfk\n/2Gr4moYdbUE5TtiQ/YSs5yVO+PTQ9VIjJimeTMqkxSKFJHhQ8zD0qjJCzlp\nWAv8AipX8TgvN6SPyYyuX/2KvcFPeO99BtQcuaxTHnTrs2U09J/yluPSPTNq\n9ewg2CzAdtkZFMO18G6/AUSC0oXUcD59zMqmgiJYLI/wR6EBul5k3dom558G\nG62ROss92rhe6ZUOdfjafL5LN/qaSbDf3JRDGjj/8qYyIHI04GRmFNXnaIQx\nRJIGXLkKtqbLe3TtL35dfecrEc/CJbHULoaE6dBworaCSSVVaeXiqZ0LBP30\nyTXdmk6cYhBzBIDgK1xyrdw+lF7VCzfGRaV/Q2txr27pJVXWNGJzt4NAECCh\nG8A6bRFWzBNgHKzz1SJbQH67DJHv9UuTgOZqQZ0CblrEA9SZHUsyFA5ZwPek\nKCAMSrIERks8zwTfupC+9VWX6dyHAcHrTOxz/oXupn2JoNVgPwmZIC/Ct8yj\nYV61\r\n=2oJR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"23138c121740588e61daacc710bc390a88ca84cd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.12_1644402114237_0.48494745738842293","host":"s3://npm-registry-packages"}},"3.4.0-feature-3cee38-kzfepzwd":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-3cee38-kzfepzwd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-3cee38-kzfepzwd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"75fefcb1fd6d7e0247596daa00f97c21cfa555cf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-3cee38-kzfepzwd.tgz","fileCount":153,"integrity":"sha512-dwz8ZiBI2orfccrhDNkZG9RvXonJDmUJ8BAkGaTjZf/CxBbGexh0FaaxqO5Tqwjrb6KQg6patQOl4UB898EXkw==","signatures":[{"sig":"MEYCIQDJ62mcCrVV19Rb6GhH/b7pUG7F4z7+hQWOPlqtQByOfAIhAMS5avgJkX30Qr49/i+g5+gaR5NXNDTqKpH3kMJ+X5Hq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA5buCRA9TVsSAnZWagAAK0sQAJECK8Gcg1VOyNY4CoRm\n7EvQsK4tP9FtfyY7T9TUCffOnQ+zSqc86bWzC2TPRWmRIVXUIu8EbvvEikps\nBxTQLQtjBR83u9i7auMykTL+u+17JUb3K8szsBPWpd4XmZOjNvAvIhIxxijw\nzERIPZbWQqJdmnZJ22hLjqh0sY/nPv17FDUJCzFKMOVWhk/bTY6fZ/fJwXtl\nxPzKBGgHYkTWSLkhQbmjHdZccsNPk8RKw8TOcTeRq279KaJbBjY2HYPjEJd+\nybtVmSuGlHcBTE7NZq+eJ9NNwvYA4MOQrSohyvenY59k4QipWDEteFmvSjJt\nWdI/vP728dNawdVGEGDexBIjwk8lqmOZ+PBU4Rl308pk0oVOAWQZOdbCq251\n9bFIQFxxyVyrj4LPea4zzNnn41x7VTutLp8m8LNVcgeWqdBkHbM/jfvMtoij\nlsJtD4YxE47+R//fsiVsdQr7Mkpl0G0u1N1N95wJ70I3z/wGYYy/JQcHQyIX\na450OIdWJjJ59I4BNem/VOvtGCfdGV6x5dEN+0E8ee6KJ38YatPWHWxAno3Z\nKayXIkDtymqIYgM9mxoK3ESmS9npPqryYytJhpWtgnnMKiXO+Gz4exwlfKI0\nOzk6aRZRvrfufFQelRCOXEhLTh1pbPWkliQINMp2wKYHxJ0XE2HhjuFOEuQF\n1pXX\r\n=xRvg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3cee38adadd158b6b166cfec5a9ca65af85656ce","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-3cee38-kzfepzwd_1644402414532_0.969324068274861","host":"s3://npm-registry-packages"}},"3.4.0-feature-f245e2-kzfeqww2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-f245e2-kzfeqww2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-f245e2-kzfeqww2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"45498975a28840bb05db1f36cb11ec09ad3319f5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-f245e2-kzfeqww2.tgz","fileCount":153,"integrity":"sha512-6fm4msxepCdcZWYSOq3+C4PkC8piz4rrcZvQZ3iDmL5gBAOD50uZzyVkCgRbpjermf7yTOu6NbXJeuwLItMUyg==","signatures":[{"sig":"MEYCIQCEtlnuiXjjOsj2QzUdt3v6FwgsK4a/3IpOP7Ihjezw1gIhAJWorECMG8ZjlibuLXhPE6QHsscuxs1+0PIUoRrCKCxg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA5cRCRA9TVsSAnZWagAA5joQAI+qYjQsJiwt+fi5Hgq8\n+C8d7M62/yywCe23sCQ2Dd8zubkvPWMU0sHDhy5ugBisVfY0fd1wfI4errBd\n/ybguCAhqaOZnVdW+9wm3Y4gII3m70TfRTtRN1uMYVwap6Tv/GbhglCqc40d\nyivs+CKfBnvdmdzpegCYoC8tjFiEbJhtpZXF/d6sVhCzKdVOSnrXXhVIPFPZ\naHfi/sMQgrYXfkB4M5cj06WTQW43OVKC3aHjt1vo82yDDal5vukOrvb3keDW\n6QxOcBZqaRWmGszETJMAxt/qPEjCcFgaaSXDmum/g+gtTZwNC8CxtHPZGf4h\nMoYVckyevcdRMgG/SoHTKb/SdDZM7AjKrfPg9W27S4HHIC8IMncXl+AjYShv\nmihpg0T3ZPRt0WUkcTwyiqXa7eLR5a9bYmBlR4/sSot/vRoZsCxxUzMkofoR\nAt4fJms9QGfNM9p+s125cb9jWXNtomcjszDxOEbMKaTB6HQwm1osN+ZCS9It\nylwu5hanOt+lEwcjQGxXi2cYulgn8qzGtnBRmCfeYfAfNyEul588Hmlu3hLn\nFyGSKNdRGCvUtVT/9+lINT98PrbIZYJjUyrDPL46IDL8zLZT94y6BBLV1yQW\nefUh/tX2pe7ntGjOc9M0Wczb0I/LWDgfkd8I+n16oHoqAT4HzxdkxmFIb777\nTeeb\r\n=5yOv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f245e2e4f23fe3ce5d7381d316cc8a1443f31b3a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~allow_to_get_process_instances_without_xml"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-f245e2-kzfeqww2_1644402448821_0.2601394006694002","host":"s3://npm-registry-packages"}},"3.4.0-feature-76c56a-kzffx58e":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-76c56a-kzffx58e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-76c56a-kzffx58e","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"84abebe09ad16b84d5cda37b49b3bfcac1d6adbd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-76c56a-kzffx58e.tgz","fileCount":153,"integrity":"sha512-vh8CXmHu7zAdpcb88OKlr/XSDdquruC6Xlj/H3Qj2umSesXnbyJdNvyg053R0+gwnwm+wRFlbydLIPXftyxgtw==","signatures":[{"sig":"MEQCICj7jWSS2C365MKh0MxxBWy4omTuYLlInWof39yPE/CnAiANiJWIfDpt9z7Gwaxtwxc2LYlhiwVRynwg5fxqhW+JeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA57GCRA9TVsSAnZWagAAvYUP/ix587FUo9FHSVJ8PqzE\n7FL3L9kfBuXwjF1CUOz+CrzS9A4BmroWTIF+WyQoLhEHOYZLiZwVsd/0HpHp\nVqd0TLJV1F5qKJamClmtxmrfDN7FDJVn0LzxA5aQzp5PIBlJ4axJIL9jVeAR\nzMBH/R2IETtK87gCF7ZHqa2P3PL6nkm55UnV6Wjc9pQ1o3mTMxrBK6kIn+7e\n6MH31Ot3ClnnGDSYDJS48eZuernthblx38zRbTmL69OG33bogUooxvA1AM5w\nHW07RdTjGU7I3MoBRT5nFYjJJzFfaLxoM2pyPEt9+y6rB/vICGAAy+5ftxif\nwhFH9GG2VFHa6WmvKlMbEV4noPm5AZrEAT1KgJRpg2lQ+AMjINB08c2wMqdc\nytCDEmbr74HhESGENZOu9LzeSQFV5OjqFAxhoKHfEfGYHnAtSdq0HmAKpL+O\nNzrtFLqgtQXxtUTBVJOJV2fC7ZXaZRVdQcGbN2jbVyDsPpbgKqBXqQYT14KV\nMeR2nsE4dZmYa8507pUObcK5ygCqFWtrDPEAU6SOjEZeNDLZTUn308An6qxS\nDofPxbzKS5qg3jOQFnavjcZ5OwKtYs4428WEh5J2LP075OK1SGppxZMoEY4R\no5VVmf6Vi4InHCWrhdQfEPL7Xqr2uRkTEvPvTprZzNCuA3BA1L/KB8rZcZ+q\neiOs\r\n=k3wK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"76c56a86224e989cb69de99551d8074508d45c8a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-76c56a-kzffx58e_1644404422425_0.07225706475425242","host":"s3://npm-registry-packages"}},"3.4.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.13","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"77e6ecd3a56f294f5543147e85c957cf2f47c9fb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.13.tgz","fileCount":153,"integrity":"sha512-77GSCdtRCZWZnSr82Rc7TUAgIM2CeFa318KJOw402ksgk4sUoDGKOaaNHFtwW+A7YABM3k8WZYS7bopi9aLQpg==","signatures":[{"sig":"MEYCIQC0N+qhrDtNpMbRd3OKN8AGqq74SzyQLRqwiS7ogbwAwgIhAKSP7uh8dTLtGv3/+jee31eJ4GID/SUG/PoLdYRyH/Yc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA59OCRA9TVsSAnZWagAAaz4P/i59ZB7lpDQY3jfjpe8+\nmcX+A3asykuZGbn9nAH7eaXpPGXV0Ht5icZ+B/iRFL91bWUUP6ONzlcXFagi\n8YfZQfq/s58OFUTEvZdIDG3IrpWQSdSXs4KhEHkzSGJ5Ae+EuKaC00WT+mMd\n/WksrRe/SDB6btC1TDfydZtbJEIkyZ5hkFywUruDPgL/lkECeV9rPSJunMDw\nW+/7nZop5yJdfs1ZDDJteMPMyEaZns6VDAXsz8avGAyIx9JzMENCBTAdy4/r\nBDG/iTJW8z23h5iiMFlrk/VcDSjN2xHt3TEcRmGJtaqZfr13fmOoryC4Ba2m\nDqqNGjECaTmlqZBy1kh2Dj5/mVBGSv1JeZJCs0p4a8SbAupWmyQFuManGuZz\nUk/V/URmb3XbrTjmIuzM2mzM4iyZiVZZdrnQ8qxfdmQqPWEdIdi81WeBQykA\nyHo3y9HL3n0Bhz9G4P5q0sXLXmDFJBcgev6KhTpptVP1N93z0dsGx74RdqwB\nMSMdeNaKVKE8iemqfHVdO8PDEqaA0jkZ4K+Qv40wtDIv7GTXXLkSCeRmvNct\ngbcPy9gZIz+fLWr1rP9cgQIyIqbjwwlpcAI6JSadwviDeRRJjynYhrs+lTea\nxPagDZ5hYyqPWodTWhrGYJhtkDdlxMRqP7mgELTpW7BMf88b+Zs7AgCAQTDl\n0w5F\r\n=3DuV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9307674c8d1a149fe6d6d52de7517a1ff1293520","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.13_1644404558613_0.0868450823843896","host":"s3://npm-registry-packages"}},"3.4.0-feature-e95323-kzfg4hfw":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-e95323-kzfg4hfw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-e95323-kzfg4hfw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4bfd2a41e4074aab03e4f22589c5c5acf2a50165","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-e95323-kzfg4hfw.tgz","fileCount":153,"integrity":"sha512-kRxAStVJlVRoHc/Bfkf5T33K+6Nr/3lpannKPc7n1H9r5v1DOjZa8cVFApH69tqiUT+stbJeV4PjfXPsGncR3g==","signatures":[{"sig":"MEUCIQDYCWXJ3FfszAYLQZQ72qaW6EP0sOH1uyEx+4LYoqBZAQIgO1AUe+Ct3mRMRSEQcrSFwC20+g8YkC0oN/T1z1W/RWE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA6AZCRA9TVsSAnZWagAAZg0P/jpN/plL1cQ2+6xoTSCn\ndvXQ/JnBmQTyinRUKnqlN/oilzhRy6OX7TxX1ejmhnc3WoJ5W45KU/dlVxb3\nV0nKpIclSMojZfrTj0/QXUPIDDWSZQj4NENmTCqZSuyFWTF17PCIQBQ/uuXq\nML67eVm7Ln58nnqqrB/87yaLZVY/lwxY0MwjV1DQ7JU/e+X7FTIJILcnJGI4\nLLt/XUBTPGMtJWLSucmWGMolh+WV0+xdJjLFiZktvGzuXgZ/E61HYPtibIoR\nPzdXLRKNnbMo6IU5EEgoh+Br+gZ4GfjNt0NjxdfdxhffmrZwL0sS9d97gxe7\nTCJC1zZ/r9Z0BiCn1p8Db9nKsCwAC9sMsriDtmKtFD7VAia2t+0P99LhVoUg\n9KjOuOSbnxIzqsKjJkCK2OGvwDtKsyTGA9/k3gaDloLJ2yAD+w3k/F3Y749f\neC9pYHTONTkpDmwVfTvrl/zj5ZRXgJGrKZd3WvHi5c3tMnrz1gLcl/q8/fYU\n4oNC9TrQWxpcoBVp/36I/FJDQM9Lia1zqXSq0aVS1MpM6fCwPtX/CQ0x52bg\nvk7AwOMUzSjpcwvrgu/QhGZ0WjpQvkK4ctAQU9JFaDAtGnQ5IoJZNsVp3cjm\nC7Iu7yo89scnfzQ3+yoN00sb8s3hXPn2I29aV3BVl7KHCXTbEhR0D+H6x7aI\neZma\r\n=4zCX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e95323a8c9e323db0f4010e37e91333dd2b94a88","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-e95323-kzfg4hfw_1644404761309_0.9097555944471711","host":"s3://npm-registry-packages"}},"3.4.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e47efce75389ace3d9040b977ebd2bcdf0d7cda1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-beta.2.tgz","fileCount":153,"integrity":"sha512-bm5LXGpoh5S0zaLvi0jhBY44SeNsSykW1BTMoVn/4WmZJerCwLQ6JXusybd7pgtkuGFlWXbS08yNcyDzaABD1w==","signatures":[{"sig":"MEUCIQCC8NpjPK4B9db77uA/XrX4nbTWOH26Dhgvzsqwz3ukUgIgaxhJ22TrmNRLiZhKp2xjL8tNQKzqE5CM8yV89wwN03c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA7OCCRA9TVsSAnZWagAAqHAP/10fC33m3J5qoz3XNoiV\nNnUmbraKie2B2m6idaGh4LxTF5iVRiQxQr50HAVdZ2hlfBy+uvIdkDf93aNf\n0rfpDHLTtitdOALWhz0iTcJS9wb+w6mitycTcl86n3Lp5jfxBxu7/SV0MGDi\nIz/ACNVxBo4rQ0Kc0uo5xkNmWEMNqnJoqOMW/XMhnh1d7RycBfmGn420w4LU\nmPIYaHzB6P0/Et9eCuEEMgUj1zrb4XaOP5f8NE4Gn/lncfHG+7w/NlSRMbIn\nEgfEygfFUBF77oYrV13tGxH2f/fVdwfHMS2n9GM1HcAvA2wWLxT2JfB2EKMC\nryU3oJWzCudORIo4c3Y75FnPnKGvnttL0gZT63gEs9NKpybmn5KmnY4ZyzNJ\nFAl/IXvnsSwetkieLWqpeobI+hwm1OXKgCyp+itFT3AKcfzTHPwu0VO8W3V0\np0FgHUlgneVz7OxmSDFPKb6V+W/+jFlgv4yqB+5hDovFOFYAoC81BTKqeTMI\n9Yg70IKkCRxs/Yk1krk1z8/dgMvufPozQeuvS4j7rdEAnqhtmAUSC4pZsR16\n9/cFpSLoxGEYki3Ru5zx84mIc4OediCQnOV4rGkche0s7X0eURI/DXJEb/Yv\nYAAROZKNx9BXyd1oveaLxF6MsDtEh/YCJPqfcINtFXV+or0p7REWLX5TlsOy\nSBIF\r\n=yF01\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8af15bc67e5dcd3cf7941c64914f19c6e7763315","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-beta.2_1644409730241_0.4059852911642061","host":"s3://npm-registry-packages"}},"3.4.0-alpha.14":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.14","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"45d453936ddd8e051766a27dedf6107a58334f69","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.14.tgz","fileCount":153,"integrity":"sha512-HYFDimO6gkiJeVx8RJiZwT3yW2Fd66PcbcMRa96ZeIn2B51FU9LC8QnNRdHP5MlWu7SmGN84lVuEOJiRg/hbCg==","signatures":[{"sig":"MEUCIQDlw9fmRwvHoXgdkbkGNZ4JilrSiTpX9RVF1pMrDEeGPAIgCRqryLdE2LpdPHMvliwryapbU8epfRcjAfOcUG8alyM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA7P2CRA9TVsSAnZWagAAtzUQAIqPgi+LP8vYEVrn6icf\ndYFGn0hRJSuRhcrtKYBlxa/orlwuRmkaQVsdOdBq5eHi9CGYhjL2V2U69pFz\n+nRcxfGG4QS+l75ysRnlgjTQ5Q25T2EoX161OXf3BVIs4RXziCtFuibyNkyL\nxXmSc66W+cy8b8H7o4JGIDnAM7uSmB0u8kIhxEKErndBwN5r1Jxhb5pwZht6\n4BLHojUIJo6+gJYmTWp/B22Q//2Oh3NUG/Y3gnN1WS++Z/qe9Hcg+qzP5THt\nuomK3V8+sl27YLbNS/ceL0MDdbB8IyY5MC//LSzXszh2/cyg1r+yREdwhPch\nPRmTyFckeUIOmRVGjAGPfNdKwu11f4u+266bS5zZP7hUvmehEtrIYAoBPHsz\ngx6oT9XyUuCae/Nqzw4/7tWOoK2gnj65KSB250U2EqM0ZRT+szc9OPcF2art\no3JfONL91+DHz5bLN/tGcdeLSizFw297kyIXxIlXnRWw34TSEyYdwaUorfG5\nklN44L1iWOtvr9mvL15d1nev7mE936aofZlyyRy+ik3FeRI9C59H5Nglmb4n\njRfZNdnmLOPiB5ofhC2FqW+7nLfTWzwI6fBy8KpS/9r+reRhgDKxoqAHJNPv\nhDzzbwVh2sBLk8wlB2bD+0MxsuBIVou2K7pgeZv6n4RxlixF98aIYvQJhqev\nN1UV\r\n=UFEb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d5329c638c3635de2de8cd2e3b6bb97bd7ab35c8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.14_1644409846597_0.5689457397281448","host":"s3://npm-registry-packages"}},"3.4.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e9a461e5b6a55021c8862cb319e52b7c83483ce9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-beta.3.tgz","fileCount":153,"integrity":"sha512-CRxBqYK/BT1UoJEuqfShwfFscC8AvqeJ5qBCHu7pDiPoEHVUZ3Al904pFuITnUS0vgcDeA8kV8Ba5f+rSqzEzQ==","signatures":[{"sig":"MEQCIAfkEfrZHvi6jJJnlvJLpArZqvCQzB2TVMY/LcTMwwIxAiA08ET4pvGMYERn/yNKZwHBneCb9OfCiL4dzjVzu1YDHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA7xQCRA9TVsSAnZWagAADF8P/1KfCeaArg3qz3PoZNmj\nUslGoNyiTsTLL2Zl8jMIzFXzxy5EXiLDYVFghx/FORNFBZGILjeCEfpoTRgU\n8oxl5eya3VEuB5oY5YA3215XPu3PhvVzAEZmFGQMOk3hgi4S3QMWrx7drHhV\nbLQgYqeDAB825iwxklR2HNTkOpDPznYuej9T7OZrjMrGi/uMqNtkB504TjpQ\nsbX6eu+9lAPMbHceC6JmDJIZIJC/6hxKzNNtz7Lcv2FDL6koX12ZTTp3h8Jc\nWG5U2Vyn3paVp4dr8ODRD69XH9Q0MN9NSrE6JGvCPZd1IFW9KjJgCpyWX6Xx\nerjXp4C3I/e0aUC825bdU/Fdhto2ihjSDumMlvX4bRTlViJcaPAOni2O634I\nqtCiqSpeqKrOGo+I4uDQgKDSBDBdypO6/6KmLSd6SmwuSxd9GM2XJTvRXzh3\niHByf/JHMwGxKRfMsCdfn+oornceiAcDZh0mf3I/+ZeoqS/MwY8GcVyFHVbV\nmjRCXyWSqBxFi9BZg5krlSoNVVWUChgKHU9cSN+n/7Kzmp1hCjSSczhnNj4U\n1Y6h2KsV5LIJ/jECJ1ebdt4ppA+/sVIe6Bpp7OK+KSPcYHBl0ZUIErzepCbg\n3VLEGaMCEBYFJgWk234MlBqRRdMmcHfE+S3eZMh6Z/EK+3hpBk0C04EwhgSx\n6IBZ\r\n=XfiA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"71c26ffb9a8124712ba8187e91aff045ec7f1f7c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-beta.3_1644411984616_0.5406660816079061","host":"s3://npm-registry-packages"}},"3.4.0-alpha.15":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.15","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.15","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"88ff5bed54181e5261cb71ae5aa70979b4f35e57","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.15.tgz","fileCount":153,"integrity":"sha512-MMxiBafzSAyew5452MqVgBA1XPvlxK0MbL4GJaGA8OhKWqwxY5ulBKRUUgPJuPhjqgVyQumnMtuJEIGuUmEIRQ==","signatures":[{"sig":"MEQCIHUGsWSeCvKqujfqTQN4dYzZLODvFimAMDbGv9jRylgZAiAP9NZOQKOi5QLBm8igTjltGvS2uxxu9eRA/Tb4enhwXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA7z1CRA9TVsSAnZWagAAuEIP/2G4FgYi2RVLqMUXNm1L\nmR1QGAJGofJE69TERZrM8Wx4AsJrM9e3aOGes4pBIPyDrpiuTEgQ5ufwFSFJ\nAj6CduNSXkcug2wrXmHqrlvaqI29dYWlTX4qbh0R1GagGb+RKKCz4mUxGAdK\nYJ2lsSv+IVtHSdakRwjeHCDhaNyLZWlluMYQRzoCw14eAJdEcj0y/pDOs1eA\nRaJdjaR7SMKhafNL/PGpzeVY/TE8IJk1UCvs42Cx8FJm+yqY8JXKG1KjaoUg\nrWDVKFg+yUPbgvc6Zd1Y78QKh9boJeTM4ufQ+SeeZLjmXSyVHICg3oMUc9dv\nVrxD6zm5QGJfdjrXcPFPMRceZz5ailTJezToeF5jB+90v5TyCsgwvFoUjvkW\nJ1G1kC7EmJl3NEqHt08RxNXGV+DjVHwRFZ7uYvmigm7IhgvzY9ksF7KAJAP3\n22szTtrEMZGx77BQ8hclXWr0OpkihmeUqpR+BwlnywhmJpboiOO3k5R2rgoE\nt8YVcFR+Be1mux6FSmsUhnPbkbjJwsVjmpxGwzJigZ+ULfDQNTRleDD5aoQ9\nd9hRM0tLGCOl6M9uP10vN1wQJ9C9ZGuc/VAqHaRX+h9CFSkcCmmBEC1WMrZR\n2LvDXPBpMkZ00qM8OjX1EKOjUYsSAFVUJeJfRzv4i5xEzNJ7tQbueze3t17j\n8z4g\r\n=ST2/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"363a83e6020285f3c29c7f5ca528d2ba7025f2b1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.15_1644412149816_0.6733823332086173","host":"s3://npm-registry-packages"}},"3.4.0-feature-ed1af6-kzfklvil":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-ed1af6-kzfklvil","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-ed1af6-kzfklvil","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"03a9ba46b2c282528da44669c54640cac0c30c64","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-ed1af6-kzfklvil.tgz","fileCount":153,"integrity":"sha512-u8/1STjPj4/BGwcSvHpbkUx766aIBfFiN/u+pfyM2yfJIjaGywAYUnrEoHjRIBv+uxqBVLiciYaGEmVqVJcxDA==","signatures":[{"sig":"MEQCIAuJh3kOyOIOtqH3mSEdSLDQPwgikSorRFIZVukNFY9fAiAaU5hkMS0FFQc8Q5ZcLcoXTAzS+eGxy3FvKN4x9+hq1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA72FCRA9TVsSAnZWagAANL4P/03IZ38Bu+Tzpo2N/GgD\n1fXtYDDtuLpd2amp2m0ZDW3JIQFZ/7eCFMhYm9qHpPLuAlzYCyKmR+y1QLUT\nXHkPNNZp35kwRfksxSICgwnbf/VyjQmsVMYKvwuLa4vi+JMEZHX0zuk3TglL\nnuGsWMrFWe/Tn2E2wgdDAI5S1tGQwYyNgMxXo3yZU6gd/NdM2s8mCc0FhKUx\nWljVeRJdEt82oQPH1UMEX6mQDk2fX553x0M80ANp/p4ULwAaVvUgYYFXMT2f\nfDF3zsQiohyhIGKxp1CBcLbAh5JEp4pJu/xXdEZbaqwAi7Ixpy8bj7kLMH0o\nKPWoPzaYs8QR+BgKJt+R4cWupGgibN2s95RRUABO+7TpEqI4pS6Ct1PVuuoy\n/T+sF+1IN+nDoJ0ZPEBET3Vams5vKh4k+RypBv4aH58yEgmrxD3sSMudP7K/\n4t0+5m4f3lceah52lwVAADKIzqq1mYDqUsMOsTo5WzAMGY8Hg6WdeVsrp4Pk\nep7ShdLbo3TglqJHTUViIg6QJPOujDXUWgRbO6yqL4z4wMqEUycw68VaR1X5\nGF+WUJgulp4dIEKfaQWpm4mCB6OceNGr6xyyjELZmPoCZLfVjq8K8LH8MQgL\n5jxM2UjYa4CqHta1xinTgysMjHcXwORrdECdD2OU9SPZrw+1VHjHqFfYKEKq\nkMeN\r\n=sAnI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ed1af64200beb6ff258fc45485e1a29a8d179297","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-ed1af6-kzfklvil_1644412293063_0.515912744227881","host":"s3://npm-registry-packages"}},"3.4.0-feature-d5c11f-kzmha38m":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-d5c11f-kzmha38m","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-d5c11f-kzmha38m","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"12d449c6fbb365c81875f81ca63d016124330293","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-d5c11f-kzmha38m.tgz","fileCount":153,"integrity":"sha512-vJRqZKka0QoZZgUOkuaOeJ93qvGRJ2NVwKDFKzvAij2NBIZT7R8QQnFe9bgGV4K/3DvEfHLmO/ERm8Vfwi7Tkw==","signatures":[{"sig":"MEYCIQCyZtww8uzdF2Zh+Fg8Zifh0QtAkBTY/eFC8bTsOwxHmQIhAPRq2BFkdcwXxArkfrHOE8YjH6kPXSIscvlzsXd6HKwZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCh0UCRA9TVsSAnZWagAApbUP/2HzxNzmN6LSOc5Hq1Cu\nwp54KdX2vFFSDLEyfePOuXVeUuc8UkhFh0sk8AWFFzEEWm5en1GNM5TIu7kr\nQDLv2XCaXOnQtcBMeT1yEuwGv9f0YyYQ/TP/6T0N4kfYdWjRBzx+mTxvLZ0L\nbOuwkMPwgyh0UUIszCr3MMbm/ommguOrMOVntgiWs3PjJjtZnv29Q8inY+wK\npARtgHGB4WngMJ0yvo1c8dk8SQMrWe92NJWWcRSDBc0LoNlQJjWBqXTcZy5I\nybwDPb+d3E2im2DtdzwBmzrpYXo3Wlu9e0f+exTbiBn+WK/i7Nof1RODWCG3\nVJKv/bG1q4ps9nKZndhzOwLDLEIWOuQKMm8YaW9x+16w4oPshUvXTFnDJVqT\nL7kkiDBYiJPXTlb5o58MNPxK1fDQhwqaO9KcW4tFf/WLK/5VceId/ivzMEtw\nGr5LEM9HlNlYlWc9kVgRjH3TgcftuEAdIpawfAY6ko87p83LlkFKIIVpgCvH\n5w9pkTwRnlve4P34ddYojDUlkw2SR7wY+ubbFfEQgA/nUMQdtBXo7rGaSkX8\nYYSSnIOw1QlkTlh9gL9PZnaUi1Z6Xns9+v7eZ6bxujXiWjMKaNNL96PX6Fgl\nDfJF9b2D9/H5za9P7IlpBFtP2GlFlnOe611TqUUCc1QghLbONSy2C5kcl+V0\nWEIa\r\n=cf1/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d5c11fd8ae74db00c370498e721fd19f91165c7d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-d5c11f-kzmha38m_1644829972275_0.6881484761186873","host":"s3://npm-registry-packages"}},"3.4.0-feature-1bf6f4-kzmky629":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-1bf6f4-kzmky629","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-1bf6f4-kzmky629","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"09a1bbc6f73799c2756edbd7f3f79b5f08925f80","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-1bf6f4-kzmky629.tgz","fileCount":153,"integrity":"sha512-1k7Wz+jF4ZBzK6enW2MHvkIIXeRGIUn58jK9fJFs/NeRZQoGDmXXpC5X5opZOpGweYYs8WAEc5UW9VdOW8gdDQ==","signatures":[{"sig":"MEUCIQCAJEFWBDr96rlb6+Dg6hcD7b76Dv6mPxjAFHXK54CKigIgPKL03Nc8zqsVbGjPfqub9CDGTflOiWpYqcR6LrGzMGk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCjUjCRA9TVsSAnZWagAAv/0QAKExBPCDYNyUI9ojyYW/\ne8w1ylQeW3Phxnvkj3g8ja26Zd4o+PLR6sJ4t0pRPkdWnL2jTbTA6Kzkpwm0\nW3ZcSatj6rnw98bGfae8i7bNTS61dOeel2DDRRbDNDAaLOcUAjQ8X9Y8n+6/\nyAzcI5w5mgKgWiqeMSmtNCAIxk9+xvWb1qxvcrKf9iyhEJpr3DT/1tUAIFtI\n2m/RTo592cTilSGuNkf3V4d0FNEgORr1/STA5PWdeedLe0dztwdSih1VpvwE\nWvBM3sBJqZ2lOqu2sqsCPe+vqvfpeGbtzjFHD69MJ5MbeKYDEE+JNshEnmDV\nivwWVf1EZxulAfVYIxmEjQ0FWwboZdptkOLZnm6bloGOgh7KgQ/iwUN0qFwr\nhLEzw5E5uoeVnYz9RNMWQj7Vh9XWQepHLWUnYWT1NTM4ddQ3V3Tkvag2GURM\ngSrKXjfvtUqFmRk/qs2+3W+FztxwXZNozMVBFUn2s2d63N7bz8eHFtpEM6Qr\nLJ4oj1LbKuT4c1Fse/Zgbt9BeTWwu9SrymlxIhyutqe1Lc5X5v62hqyUtWJ9\nGFadxr4XKq9mwTfuqy+TV05Kq/S0oKttRFcGhEvvBT/E8BatrIbrOpM3WHKg\npIhCEuxOAO1WdWXg+4lqoxumL5a6Sf2sxO1q8FNv7+cmZ9kOTr4F3TSnmIf+\nr4Rm\r\n=fht8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1bf6f4b2decbbc2ae9bdb5c59b914a4d3e2bc870","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-1bf6f4-kzmky629_1644836131123_0.7367911300449284","host":"s3://npm-registry-packages"}},"3.4.0-feature-177af7-kzmm64yi":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-177af7-kzmm64yi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-177af7-kzmm64yi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7ead39894de2bc574bd6abd48a5bc62d9a46613f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-177af7-kzmm64yi.tgz","fileCount":153,"integrity":"sha512-KaKIk7ho8zUe66qbzMWJiMNc//xigmHeohn9c13oIvKPAWa+bOVr3w03v0J/NgWAu2kThCuop7sewyqPQRMCJQ==","signatures":[{"sig":"MEYCIQDylydscx7MDLDy+LOLBMyi1wIWEIcchOH9xQXUBiTh4wIhAPlteFXgsrk6Ky2Iui9lfHGIXUq7fQZ9KIsDU/jFbUKe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCj0lCRA9TVsSAnZWagAAIZoP/0gmstADpBhgle3Bomvr\nDg+5cn4iT6psrhLAfAePkQwQzUNPO8pXLu6vci3fKcNQo2wv8Os5JWZ9UTy8\nTXI0OirUsvLXMPoHRA+MXoLT1RsLY7if50QxFHftVyJEuHmoE25lQPb7JgqV\nNc8vlgZXdRnUk3AxXhdX8vQorLFS09AmCtfRT6r581eHvKA2v6VDwwpoDY5+\ngQv5TRgCyUIXzzfMVCz/KlHQrolSGURmTwX9qd0CVi5g6p89rju/h04xrx8f\nzx2HUl10DQ6F0aYGGlc3hLVSfEhT+gOhKhcAURQeg4pDf4yZ73WCOglPjWW5\nFM3p3bL+14vpXizhS0HdrmQXATXcdwRVu7SoMkBUt3QjgWLgYITxCLunkf+F\nDGrK3brcrWv265HjPxZUzVPLk2nQ16aButffTVhGS0pOq8CfUPQpMXvEY7Nu\nqdseP3wSfTTh6V1xaBiqUudPYb79uzGqmG0UHYm6I2GkiyobUkREcPVXsyXB\nrj7byDErAg/oPFmCnW2+HWuA1V+HIl3VUH4iKQaH/EUzhKr/a9iJ1yL5t4sq\nA/QQUlrqyVAUOLWMdyFQxcCLTPhwMs0DoIJNhVaypVO8jGuzvDQlRVgZxyLO\nt+txtmIsIo5kHqA64cu389TpgXrC5h97wHwiexaB69dh3ixfb+lh6bDojtyD\nZQPk\r\n=d3q+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"177af7deec1fcd825891b45864a948825aeb2c35","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-177af7-kzmm64yi_1644838181096_0.3769621383147588","host":"s3://npm-registry-packages"}},"3.4.0-feature-7e3ed9-kzmngz04":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-7e3ed9-kzmngz04","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-7e3ed9-kzmngz04","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3731a25c01bea7c2be60139f46752fc318202e59","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-7e3ed9-kzmngz04.tgz","fileCount":153,"integrity":"sha512-NU+7DDc83HFf3+CMrKyHT1CR2jhPOYn5fwDuwIKnjG74Cz+Tqg7B0Tzecsl5ymWDHt3V+1BYQA4wZ4of/L3cBg==","signatures":[{"sig":"MEUCIGyOlgccUI1BsHI64syqh6pVufi8WEtGFKlIEMnywlDKAiEAhyDvDdA5HZp5ozG7WGV0nKSzyCM7xJ3BG3aa3pq14DA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCkWsCRA9TVsSAnZWagAASdAP/2jVJgwmj9cW0TYXxE1c\n9DhiFGkIZBZJm53lwpFk48GSAbLqTAe9gJa7GSmgNCZjgLEayktWA9pGJ4Yk\nAKdOr0Pt0gt6tZ8mZHdVOyi5Na7wGApcwUS+KT80ugrxYAjXofpiH/UjSqAK\nJfzk72aUEep5Lzf4t2G6Csmm6wvrQ3r3L2iX0Wq3tyGEehll2UcoJP4A3lcN\nx0xDFMjwujtKJrLi5X/X2uVJHRjrAnHX6U/o9zLQi9n5Eip9r0dBHbvOpkC2\nFXiCCqk3xZEHyFMoN6Ns7TRTlFomw2ZxiCoeiTccqsTU3lsyUwIzlIBPVYGN\nebbBavfHxyit64I+pP8lrnl1wPx0LROaL3iT5rpffxV2jc9ojIbLjODu7oK3\n+MClGZah0rbppr3ABNIWlbVnuNgWBcT5F8G+kSKUdKQ5Z2uPjII0yDmwKk0q\nCfVE+RO4nR6RgohIciA0guf6ZrjTP7O8V8QobGJS4UUJUtzunKz/07+9uF0S\nw9BuhQhuvvTTcEXSgdmDTuEdPPkBzFXWq+9wsjnX9V2zEhyWx4g1IV01YCpc\nku7teQRhjJGl/UdAhy0URa/FLcSHu2tNr+jHfTWutinO9ty7ykt8fr3MjBqn\nPLx+nMzOH9Y85rH/hNAOHQ3uN6kS3dCqW9WfYkfAxYf0j+CI8cQHC8ngUR1U\nYF24\r\n=yEiq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7e3ed9ffcddb6705deb226ce5a659050b1798419","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-7e3ed9-kzmngz04_1644840364197_0.3551487656475969","host":"s3://npm-registry-packages"}},"3.4.0-feature-68215f-kzmsiz2l":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-68215f-kzmsiz2l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-68215f-kzmsiz2l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2968a79ae621ea71fbf1d1cc53496cd32a4d0b36","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-68215f-kzmsiz2l.tgz","fileCount":153,"integrity":"sha512-4HLtueg56d/JfEatMhAU6Tmp3AqMBtjZ3axkeUdcWvpS4/UB4MtTDnUGFSFQ4XDTPcBtD0Z1bRtarKot8PqJJg==","signatures":[{"sig":"MEYCIQDgoIw35AHW0VH2g1nsOGzsI9SjKsHOaADylulHH6AyGQIhAJhXmP6pWwhS+GVl5v4zo9u+SD7kjBql1qwG0k3Ys43H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCmbaCRA9TVsSAnZWagAA4pIP/juwgp7ZEag4PwLYcKpr\n/sxzOw4RW3j1HnGGGFE1DgO161k/gDKLSDkkieXtR/jchDoS7vezIwkzJs9S\naTUBCK6de4ZUmwbJWk1FntefAo8Y64R90UmfxFDYAqQG4q7V8HeBnbxrMwqo\nndHLhI4oF7zFeRNsd5H/NieVsvsBR8SyUL/VXGMUQMK0+bcxTfk3o3x0dD3o\nCbbzcqKaZLrSGyeEYDNVguqRHXFTZppctCodMDtICRkDnZHQpNcjR+IcuFer\nm+WMnJVHl4qzfAQ8VKAKX2S02XKYBrAKxr702ePuQonw8XGXXQVsHBuDcIum\nzegddiZI9K5kaUUjKCJmc4Md52fyjZV24+PBrrdN2V4uaoKJsiDLlPfRasx9\n+5ZId8H65iekNK79hKCJ/ZfAvyngGCA1QUXzb+9Mxdmge4NjfWEaDC4OyiDj\nCF7zZ2SJ0/DuCUjt+1J0cO1RvsQqevAuzbVLyM9Al875Vy2wqTB2B4ZsgEM9\naLSo04H0ad8l/8d63SHXD/VMCt0XmkAhwhDG5eAXKbgBLfFTdGtw+WXxqDtc\nSmK5sfMe7YrnEG+/ajevR2SCQ8SQgNvJNDYgzfOiAf5LGxS4wNcMfUCG3z1n\nJG8mIFY3TALRMfj1dbp3jH1As/ybDJyJzAi1EHbFM8o8sOkst/AwIxR6M3xu\nFmlr\r\n=rSgB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"68215f71329ad9eae68b1eff6f2aa4cea735bcad","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-68215f-kzmsiz2l_1644848858327_0.4387566415120394","host":"s3://npm-registry-packages"}},"3.4.0-feature-c09b99-kzmx4x32":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-c09b99-kzmx4x32","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-c09b99-kzmx4x32","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"46c11af0b34ed81bcd9c279321c3d3050dcd159c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-c09b99-kzmx4x32.tgz","fileCount":153,"integrity":"sha512-7vbXXIYVPjZ9PhWOQ5FSEThWTz4mikxq15oz+d9SnuTRyoZ4VbXhG0UOjFhsflZQKY/WfxU2PGHzekm2Xm3zeQ==","signatures":[{"sig":"MEUCICB9yWpUGRPGSaZM00J+JoTFZ7a00xAcJc6LENG3lqJZAiEAuPqHyRjT9FXf7jMZAMzQ09depRlUvcbw4IQBXNkpx5U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCoUaCRA9TVsSAnZWagAA9JgP/1Q5VY1KSIamy4teGZX8\naUwsL71zqnAtEhhP3pj1IbPPER8VLJaOHJz5sBQOzf7jK4yAMCpZovTbGMyH\nYHLgByRp4cfXVnvA92PxX+6unuLhzYXrZleCYPnwc3pwyfBWDGxvYzCgCii1\ntzn408mrM4x2jJyotle8E80Xqh6NgyqX/0feWb01bHBr+r0pUPzd52rzEij5\nnstQ/ICLq8LxXyUfBdvlzl6hRpmMOPInpn8xLotwU36zzD4QrVQXRTEI/E8f\nzOzxyIKiQPf9WRnO4bjHcu73yqTZ4ILYD6pF4sXx+AvG8YeLBuZC+zMFj1lu\nw+rsYZdLtFwrJmHv/IJOVtxeSpKEE2gDlswPnY8V7fKM2makBkcPUSnA7O2p\nA5CiXAMkFgA56NB3xw3MJqCZ/CGr/6yi7x2UkdWrnp6Vo758oi07ndu+WuTm\nhxRn/I/2A03jgNiWMe347d/K1FCEaIvAPLdMvlzQWxE8cDAIGGXuNglpIEST\nZ+Y1SZBqrjKTePDSGaQo7tfVufALz4q5jia0KRTLas+ojbp1hRURasbvPYWA\nQLYalHtQVAxaChvwPrjOxFUWZM66RpMVcChaDlWPH67mnJ/kUuKHayZUhIIV\n9MTxaLTUFoUOYdp2E/46aCM1CmX2+bFrerEMMNiKxeFV2S+2PGVcGOaO97no\noMXA\r\n=DtIF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c09b99f239a34296e0275a12d0a0e504c8b79735","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-c09b99-kzmx4x32_1644856602558_0.01975430599281114","host":"s3://npm-registry-packages"}},"3.4.0-feature-81ee3a-kzo2v14u":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-81ee3a-kzo2v14u","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-81ee3a-kzo2v14u","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"62c85058c6f2df923a7e463dbcaf859dbf4b2717","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-81ee3a-kzo2v14u.tgz","fileCount":153,"integrity":"sha512-/PldwkzeWveT6sdgpUBko4/k49Sgpiyk1VCL85WhsLHRoBkfjEhixPYoPjY20jlVuUvDL+l4iu2oZ+q8gLt46w==","signatures":[{"sig":"MEUCIQCy3P9FvRmngkTT+pVCCVZDFEDWbtU/I0uAsBkaiUtTaQIgI4zPIHg3zqXb75oo9/YyfDdOPOPH/ItRYVejXH6zs6Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiC5bWCRA9TVsSAnZWagAAe5kP/27Kvhr30PkX34PMO0kW\nOR041eqI+rnr452COhQjYYYCcREqB02nAto28oM2v1O5SaODuQu9eoaQWspO\nCC+fUl+yvbG7YnmP/NkKbTGro/r6Q5wK3KPIwn8I5f0qDhV9oMTrcM0Q5KR7\nqv7FR5CPNReJKSHQfSrJygTs5QN8W6G5/2KPCZYipZc7YC0xPMBVRAXZo7cL\nut7T6JXoMAH2ixAxK/bOM/npEwUGjj4YX8RYmjopz+I51sfAEkIuJQJwjDp7\nP10tUjWEsyIymChpUXhOrwgjH9+6e4gZsbTcBQoURPsLSRu+Qd3S3u2I6B20\nDHCTDexf5w30sc5qOg4VsDWzFH35O5/6/M+uZDHF9BPvckm+zQ7oATRzW/Qy\nJ/VPS5Zg++rXXPE7mYGSrqM93qenUD5pHiFBq0w7OUuqe1E41Y5JGXv+vi0i\nFGmBkPGYrwQDM0WOPW4DfOTXApzI01DC5HSBpsjxhNZgkUONDgci4yaIh/1A\n0NA33raJY1Zib8q3I5rk8ovRW51a0KlKdvwyKE6B6qECxbex3PDwRmeHPNbh\nbJA1C7FwQBc1B19j1QDqGrnynHb39Sk3R+1Tkn+p5Oiq7NGkE3/kpdKt81hE\nvnvKL4RQUYRkTU7SUmf3gWldgSmWgHHka0c04E8U3T3gBT/F4Bxwe5qabd9k\nl8up\r\n=J5x6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"81ee3ab382b33f14010f84d9cc0b35518a0f501c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.1.2","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-81ee3a-kzo2v14u_1644926678823_0.808101523416529","host":"s3://npm-registry-packages"}},"3.4.0-feature-371380-kzpervze":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-371380-kzpervze","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-371380-kzpervze","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c3f17bac35da2949953a96e7764681ca12a73700","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-371380-kzpervze.tgz","fileCount":153,"integrity":"sha512-vYdARcNnzr0aBplRj1o2/GHD+sZSaCpEmv+8IsMNV6SFnbjN7HAHogzuPFG2eNDlTwNOZmRBo/fDN2P4R4r+xg==","signatures":[{"sig":"MEUCIHQibHcc8ZZAabskKcEPAaWNqheeI61oegbJIUUi0V02AiEAwBW/5h3q10X2fwnVgxoIAZgDheR57GRDtR9xpL04OFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDNE2CRA9TVsSAnZWagAAsl0P/iHvFopKqIUh5xvSlmGf\nsLtgwlOP+PBxKQtf13j45SMlPMUlB6/pBnySU8b5JO2N2D+gcoqzIGy25iCg\n/fiQPndgZ/0n8NsJEv5gsbgnXr8eiqlFkg0IOx7ZnmIKBiMs5DZG17jvkM3r\nS/f0phgsnHhiKcec6HBsDD5CTckWQP4zhVgHKD+iaDBN3Sq/QjHlcUWYfO7H\nRU+HU9mwE5CuNruUBl8XHdUJUQZaYLJVSezRAocbxYekGFc7buTK+NkYiYOG\nL3LfPSVyPAOKA7o5Ohzxjr4U+eKqho9BGjMepW/hb4N7VxWDkedZlbV6v7/H\nJdfQMRNYkHAunq49dXDwP8lY53JaGqnhyTkQfuZtyVrjPH0s/9FDmCehZRYV\n8IiNpwxuc4GjqFYGJkSDL0TFQ4/2Jv2ON6qS1+1tpKuumuy0CxAuw59D+zKv\nhHIm7fk+pqxypJq38eJtLs53OwhQAbWUcUPBmkOQgpggPp735fWfF55uKFrT\n0U2xkKic2/Z4lR+AKKOZNv9X/vIopT/wVvOOvzriniIMhRnslND162a9EVdw\nTPQS71Z6Yy677110/sw03JVRZJGLQ0WQ93+8xL1JBjTN0/dZQyhXivv1EPR3\nnPkz1u5FJfKIwKuGW1iSbh4/pmVei/lWWoANcCkJH01iNVM5yLbUeiKvc0DU\nRqPp\r\n=mM3O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3713806fa6f589b47faa1654b3a09510a803de8a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-371380-kzpervze_1645007158472_0.9323964891061789","host":"s3://npm-registry-packages"}},"3.4.0-feature-dbdb24-kzpf2mss":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-dbdb24-kzpf2mss","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-dbdb24-kzpf2mss","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3e908f7fdff4ec93693d3cc570de82818dd78c92","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-dbdb24-kzpf2mss.tgz","fileCount":153,"integrity":"sha512-Rz81Scrj86DBTcFoZRmeOW+vK80lv3dkfy+yvpJVInTUdKk86OQZapSko0FHFVM5RK9E5KP33pHgWK2n29DsTQ==","signatures":[{"sig":"MEQCIH8fFwM40obAt9WroPyJE7LHR1F746NZndXqhZhrvhSXAiB54iuYTjCDGtL0tIqSJtfdL8G48qUcovWg+/EshTppyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDNMtCRA9TVsSAnZWagAAoJEP/3eGSOkHlXbBqQIa6pRK\nv9OpGdQWREPglVqq+BwS2km16rKs7TtEGOygWZRUaiziOXNza7vvqgKBAMj2\nSBRiZB1BBRea7V57L+W9+K3OMo3VLwCgmHZiWS/yv1t89Bnrbc9orgvXXEci\nYQK1A96DT/6lV+2tjPNQSaUuLCM7CKQI8Ah+aQq296+D/kIXYSmZPc7JO77H\nOSk7e/lSu11i6eO/J6AlHjAam52vA1yiX3edVxTZbdKEcMo5CwoUnAhslG9j\np6CSXubJAWhveG9ohFQRw7+tOh6R5sEs5Bf/KAis8WFNLRWR6rt65MU4VXze\nkMm8XzHZ2r+YrK+gDCaHOgBbUintAqbWpPk3iC+7IHbw10S/rAbiQ5p3e20+\nziM3/k6Hy0nVHBRMeYyeF2eUPH46QbaD0+MVhxQZBvZbFI7PP1ug5Bi1iUXO\n6R6S+kEhQcSsh/A2cGVrMeCUZKjZUV+2xdXL7P2p+ar8gNnLbCa2jAwY9a3S\nDd+A3LEZNL93jdZTGILr96JI+XSNATlsK7PuRarwSCWFJ2AcC3IAzmDSqtvQ\nmpVYEGi5q4nk1BdVgZ+ItzsQUXfkVQwreCXXV5mCvIl5BX7ffcp5b9cgxPwr\nyP6XpOb2BuQetnDm5F83eyJ7iD5VDaswnZNFzAmNZqobp3G8O+djE50rHvOa\njfou\r\n=nTxh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dbdb2412634129e210100b7411f2e0714a4b25c4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-dbdb24-kzpf2mss_1645007661026_0.5461915619329047","host":"s3://npm-registry-packages"}},"3.4.0-feature-c2eb78-kzphc0r2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-c2eb78-kzphc0r2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-c2eb78-kzphc0r2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c34f50697584635e089c89630adc0f349a1d6127","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-c2eb78-kzphc0r2.tgz","fileCount":153,"integrity":"sha512-T44wkJ1IxM65ois9dnZGDQh3fCReb/ilLZ3nwNacEd91vSmZm6elJ4w5mhML4OSC43/Vk7w+juodNaUXtgFPlw==","signatures":[{"sig":"MEUCIBrdxssG6PEtHzY5PIPfnqD45v8gCIpKWJtlQGFipwVmAiEAnGtM1sTP5k7tE2E22z8Swo55/cerHV4Uk7gjvRtrsW0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDOIACRA9TVsSAnZWagAAcucP/04emG09P8lZhkdYqCJ4\nuaJCCluH6qAdWtXDGVHZINZJwIyCYQKH2bgZ/4yBsBsGYG/6YT05gyZnN8MX\nEWnlaTWocqx/DgaHzl/au05t/3Lqw67fLSv7Jlpkg/wjLSPeGIyZH7MtbMQi\nRHu8dgtANxXAyF4S/qPYDhjOUPOHeDea74DiRhCdHZTV1GDXGEoe4kcFnTZg\nRi4CZAodEhcAOQnqyaRI4UpZgSdmCLcLfZ6Wl9zVYV4Dez4oM6U3B7MUmqRb\nDUB8TaQjhyEAMMRxWlDHj17L5CT4kJeneKj/1ndY9Tc56npe+SPWa9Bxc3Ct\nc5Rr2vvZS8a8bfb+RvgI0XawB6cCURWEwCx+eq6Jg88YHR30cFNVfKpGoNIG\nWpt3fJcbmNkCEBcV5+G5PoWNxNikpmI4X0KT6ycPCjtMD3swDYGD+9fFAnz5\nEiyX6biYL1vGUtG8aOKl7rdPnQsJXuIPtWmQ9ap1D/hwInr1C93PPR548KhE\nBKmwU3jFXsip+j1Nr//wEaKLdbRZnrln+LfEEB3uzWPmpEdcVGNlS9DMY/iS\np5zDS89lfWgQ8lwpd/TzKz3Zf7RfXGEnXUBiHx9UK3u07fw/iinP2fqF6RJ8\nZ1GzNEK3VqZaS0ALeJ1302c5welX2V/OIvWfLZHHdR1zWEygn7rG3wyjtYH0\nLXfn\r\n=asgn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c2eb78314d54840dfc94630b5616b6cedc2a6249","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~identity_resolver_extension"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-c2eb78-kzphc0r2_1645011456212_0.23684398980005716","host":"s3://npm-registry-packages"}},"3.4.0-feature-c75900-kzpi90wn":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-c75900-kzpi90wn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-c75900-kzpi90wn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bb81e841166f1aec0524e6d275cd5d549ae6488a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-c75900-kzpi90wn.tgz","fileCount":153,"integrity":"sha512-GoR5mnpsZhAs/IK34uFGg57NPT2IMi6GXfFntj1O0JOlCJHCgNxLMh2eJ9dKGkmAMmwScOJlfBHVQruZoDOw1A==","signatures":[{"sig":"MEUCIQC5BPjFRw7ahZN3gN/i0e3AfgTbc8iv6EW3dTN/awIIYwIgJH43zGTGX6rYMXs1wfYpwF0q8uYCbCxgJDiGZXT+RKg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDOgBCRA9TVsSAnZWagAAO9EP/3+io3s7VimEijMy3IVd\ndK7GVZIzVlvKXmu7/sdfvJlKlsBFUPeSMHH4F0MKFvrNenjJk73fc1qvcC+w\ndlkZsovz6fWvkL8zhJyMETLbLZZRH3BqoUz9Q+2Fy/KXLJFbokiFE5/AOfCH\n8kQAQyGN6Yjba9nUfZOb/lz77CrMTEKBNb3BfUIrgacupgbIMDvTKG3v5nWh\npxQ39ogzkFBiTk6z9GsHLxK+PZapatbyab2tWwW9DNpgvNTxNrKIKKv3lmwz\nwH84GD+C/koXBwuGBme4Gpm/R/NHXvljFbOxnG5T3NUettSKE09ImBlXUpdY\ncGC85IDXG4Y7/1pQ6z316jFiLeiOPLUCl7tmGRIZHwyAI2LSBNVTy8cJRNZr\nAT17RzutQHO7lpbi12sBx749u0gcY4LhW1bM0oXrxicN94tN+MF+w21RNpxm\nPwpihxc50nF3PCleZZYzGRuWLLYhxlkO4FYNc2Ccnpd5D9T24z0SDS1diBZg\n/yOTUoVSL+DJ0/DqhZP1xe62v5r7K10GroYpEnDv+sz0dnrTWpj74HpbVbYH\n4xj2vOEZlopVsk+GpGa686A9nZodKjUHWFfrjcZ5V4zjt8hECnR73HBHcNg+\nkA6iLisIKPK3zZAzil6UThu/FKHfmA8m3y5ZPHA3QPmBrucTtG91J5MkqE3V\nXhdF\r\n=EDt3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c75900d771f6d6dfc21bd13c4b65d2bc51b6880d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.14"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-c75900-kzpi90wn_1645012993110_0.6528838432767201","host":"s3://npm-registry-packages"}},"3.4.0-alpha.16":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-alpha.16","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-alpha.16","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f16df4d39b63ca0fa0df6c3bd1b280cb7f34d2be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-alpha.16.tgz","fileCount":153,"integrity":"sha512-WEoyf6475UdM/rRHKy+CjF3pRaNZ4GwE3ZHvniJJqOoFU9GH6VTGVOE6m7VtyeI2CvoJnMNw/9U7KhYmBG0wFA==","signatures":[{"sig":"MEUCIQDTGGdW9N6zpze/lKPFERfnxB58OR/bLqJIl/kMbU9zGwIgXKu08pjR3Q5bZmJQL1cATCi8Hny45tJ2kIXSJHXPar0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDOglCRA9TVsSAnZWagAAdiwP/RyJJrHGfc+81ao9kpvE\n2Xcd5jo8fvoAdnFVD1cTRpm8QVag/DTcu/HeQCyVLXUuiDscc07qvMqPP8PP\nWPwxYvp8fiKnp3WM8ijUuu12lMMVzDEuH29yyhWaTv1PQsOXP6eObNH6wNQy\ntBgOn9iqDiKl0b1NiUwxyzxZnyw6chsAcLcAKGV9mfuCvHDrbYmUOzS3G9yO\n+v0EIMeeyIA00PEmm/h1uvLMqoAZRnRNZFPk8CjBa8qR6CXmF57n7S90o/kz\ncLnyXhR6jShOwOqKvFpKp64Se/xRD3U+hpxTSwMFALGQGfO4p8S0MzAu7zEy\nmLCaYxL4yOUrz4KCftYat1Ko7NuAauiy0hiUquu0r5y/MRfirGXZioUNDvn3\nmu2BhLNDFuXIC/1pSqHYgHx43bZ2oHk3+hyukwAR3OlsSUj//XhxiB4RmtvI\nV4bKEtYFAq4T/opJy3p2hZzDI+YGZKYNIK5M5fA184TWrQ3nXveXX85XEje4\nIAoi9MrdT8EbFULwHm3THpzcldTfFiQtKGpeePh42sKyTYgvrfaZgunybLs3\nHYeoyQ4LUD1mRPA/3YRslBzBwuWyGuPNOKM5/3MSMhB0FZOmT74z3ds5zdIo\nWH9zvAhpIEtEY0X+ZzU2cFY8GUAEMk6SM6j75KweNgKX0g+xXsqfkYACas2e\n638e\r\n=O0g0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dc4b650c43307a2b2c24d0a1fcca5cfd6ec4e84b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-alpha.14"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-alpha.16_1645013028847_0.5981416145025633","host":"s3://npm-registry-packages"}},"3.4.0-feature-1c4a02-kzpige1s":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-1c4a02-kzpige1s","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-1c4a02-kzpige1s","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6d4cdddeb58a036af5fb79ff5dd8267e4175d767","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-1c4a02-kzpige1s.tgz","fileCount":153,"integrity":"sha512-lPWyU1W2zIzRIp0WDHqCZ4Oy6+lMHDTqUauUL9rmTTbtsF6ciSg1bnE4kIMRBIInNXsbZQU54FV3LipRfUQrqw==","signatures":[{"sig":"MEQCIB6GVDZFBQF1uAtwGEdRAqUSaFV7kHM8knB5BifVaR1OAiAwnCIb0oWDk59U6STJ0DnUsNobUJPMb4Va7+fIVBGojQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDOlWCRA9TVsSAnZWagAAHQ4P/27UDOu80d4Qa7rWerbF\nabo3JeGngyeAwXjjtP3N+P9/NvRyTBHJcLedcAJUEC/+xqDkPVNxdEJj9aAH\nRC494hjz12+ul0QsID5GxUByySk498hRxqYrLsR97iM7iugI+Mb9tv+w8+wk\njGAW3ZjAQI10DArXcTNAibq7Fv0+zh/ljPtTm8hWZ7v7kcuWpWujVEO83poJ\nzaCVSB6RPplstU6/LZtCAtPCY14wQ4wj72aqFqMq59cIXe5BxHWXtWNbCWS3\ncRhtfTUuh4e6HzB7bPptbsiauqfRdaM6he3o4HD9qCnINnbboPuR+Xu2sb3O\nknN2xdHChJaU3lfeATTc8SePGyxmQMIWx04Ah+fQcwxZiajrHs4+98bwCH7R\nRQXr9f/88RuSAT6AI8DzGMqEBJ6tHdlpNouYoAhfRZbydO/01sWBUCmC28Kz\nnzab09GD+GUnXV07p6XV/YFVseeUlZC34HWD+winGPHc3qFAOPOFHy8Dgs1R\nDY4TFI4o2aHtAS4MAfuOkX5SXfY/chWOupY9ygFwrxW/6lDHZFepC1Nk75Rz\nKT0t9EniIKZ7kAmUN8xlLpINcnipKO6QCzOZcBb9LjT375HaSBE8qMr+9Cfr\nq+s6qSVXEXXPtoI3r9L4zpB5i8MLqxShmm1zjTdY9eGvgYMwCAv9HB+bDAEx\nx1/+\r\n=tjdK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1c4a0252f72af6f23de97b6cb44a0832f12b733f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-1c4a02-kzpige1s_1645013334430_0.06594843359139468","host":"s3://npm-registry-packages"}},"3.4.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7f7422f84bebcfc2317dde21932c5a446b3263b3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-beta.4.tgz","fileCount":153,"integrity":"sha512-XOWzzsOhagzKkl8GTpytA9YQBO6Lz4l213Xl/YRHSXRvZFfCvqjFOfDp6SQxU+1qoLPqXKEgi6xuksVbKH3FGg==","signatures":[{"sig":"MEYCIQCz7EVLnvZP7dObYbcJ9jXa1u+cAFD4oZxetpkWzq4tDAIhAMW1mrSShbAEGsE5USPMa3Uvo4NAVpbYjGS/K7j7nZsd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDRdICRA9TVsSAnZWagAAjLUQAJsuwSEkOxqUMoXLht8v\n6aaX4QsJQo+6LExlpgXMEZBajChKrcSZv73KUvX8zg4Us4uPzPDkyp+maA7X\nZIo5kulredu8kw+fZ6fQYQ2GhLv8ZlGin28KyLYERYZ5n5S1ggWUH+syvuGb\n1obgkpYeqVYrEmgdZHeQyMKkGdf/nMakljrLsSDnCc/i8VtomI9k1Ivi/+Qg\nCeiXWumZmWE2osA5hj5naOqvfBBbaAPzKZt79G3apCoEVk7QW77655jjwYvf\nsgObFlAYEpQzFtFn17R3wG78vApHYQvdgFjGV5HGF1YW4Nee2H9i7DLBAAON\n22/FVlUCZUVuvMNaTSL7FjpZjNFdrAWXnTPoe1mwXrFf/PNItcygkQc8kvHY\nVZ5/MXqEbwbd7Cf4Nv0cNEgAVQO26d6rBAjAXy3Y8kMfjDPtUNYHDk7K5Mgk\njMDOmO/xeRvOB48yeFwqjp1r2+BwGj5PnLD1VmvR+vEbjN3k4XwVNsri2i+Q\nXlKeR7M+xNbCpZzQyX5ebxqhj9oLo04FjGu/YLOzKIl+q6qjULHG2nnVNS9/\nmNOh25MyaldYgtFcMu+DRArWBwZxp4ath5VRR/vruZjFUXCOMHyzT8AGudcs\nOLiEcTSbLy2xNXXzCuWaumP9YaVeqxftFl96dPPw4gizlmOGC8K/7iJSSqyv\nRE3e\r\n=d2tV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"02e648622e415a42af1aac6dfc2087b74edfcc8c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-beta.4_1645025096017_0.8779438786046412","host":"s3://npm-registry-packages"}},"3.4.0-feature-c0ab0e-kzpqjk8d":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-c0ab0e-kzpqjk8d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-c0ab0e-kzpqjk8d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f3abaf28486ed0f32562fbf6ff8d661233cfe6c8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-c0ab0e-kzpqjk8d.tgz","fileCount":153,"integrity":"sha512-DaV7tywtRpCY4KmCHXdoIsvPs6vifhQsg844kzA/8DjX2jos6E0mVu8IxIIMqcy7DQ9H3XFfXgHwmnfh2w+VPQ==","signatures":[{"sig":"MEMCH2uv6piF9bSVJJoE0cCMW3YboXD3IS0HBysdhhvhlswCIFXMyANVUP+kq+iOI1BsdKdonKsLsPbdYrXDVjpR5pQx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDR5pCRA9TVsSAnZWagAAj8EQAKG32J6zXdZYuOLtYS03\net8lU7egUQDVEsZ80wXek0jX1GTvxbRpgf7nv4y1A8z1DD3Lv3BQ3mTYSnxf\nP1tnC11/pjR3QMxUBCp7Rb6pMlMQWkuaEv5Gpg5FSuFEGecuz5A+3/haaJe8\ntMOFBiJfMUzTAmucDOycudnBlzyh+uK5P4jbZvULhQE7iV/et3uYeyj0mMGy\ny5Tngcw8L7DI+DgGHaOW99AkVF1EUyrV+CqA/RPqxMjwZeia8a2LWjMuc731\nPAm0vs8bZmFSaPQIrQkQX3y3YVh9YeTq8ZGvKTTYgjHcDNDb4+F5DQgP41Ln\nKLNbMp0Qk/hYo/2cVozN9inCW3C06UN2S6fVTGFPkUzbqfhluQJdLv6NDiaz\nd8TABrDCipW9S0MdHqqZL3ccCzWOk0yM1BTFu2Yg+0Z5Vut0Xq8tOMD4I9pb\nIzv6PVrygQmZXAIEn4MEAGynyrpmZohwLaW01iZ64gjw/jsQxlFRj0K1bjfa\nUetkqoyHovmxo2nuw2wdJstEtnjqBysTr0ztV6pA0tgYPnx6XPEKP5StI/fm\nKMQ8ylBMsvo/cTgIQaQ7Rgluk7YzFlrx/iDD5FBAUNkm273zZe93ASfQKksZ\nT79av6SwC1Um8/eXjPomu78SwpVp7/hcprv7VIQ8KsfFjniOMfRVMzQur8P5\nkmvK\r\n=ZDrq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c0ab0e3337b5e8b2acd161f3eb5c97bd649d5839","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-c0ab0e-kzpqjk8d_1645026921370_0.5210967460032994","host":"s3://npm-registry-packages"}},"4.0.0-feature-95bfcf-kzy6x3i0":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-95bfcf-kzy6x3i0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-95bfcf-kzy6x3i0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f33079f3a832430bd564d99b1ce913592983464a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-95bfcf-kzy6x3i0.tgz","fileCount":153,"integrity":"sha512-1ISLcLaI6Ai6YT69UApgpVo1tL1Jq328YAbvs2X4Is5YKJ7KtSuWEDvbAG2TSkBJLhd89zjImWvFoggfvFKBAQ==","signatures":[{"sig":"MEUCIQCkW119XlgB1LnJF94ORI2GVoqdQpq27Lj3hZRUw+cj5QIgVo7SyjEADA1iOMn5KwAesC7P4qRiS+rRIlXR/ZahBHg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFOtvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonbRAAkRD/4CvZ5BUJ1gmi0juBhAZHu4gXYp2P0Hjv/eifxK+Bsij3\r\nEJm/iXMFOIgYnWGhsHsjFRZ/wDfAD0t/iNb9k9SleR+mF7NddOiddyR5X/Mn\r\nXsBN/QQow2Kg5NaAbEIuyXr15ZxajTYLuBheCJpvVID0xlusPrjOXIyRzxof\r\n9hw0xdhxdQLlpgfpgnmv+BuAbrEItt8tc1KNJxQpqekKG/u6YFa0+sIHmwPG\r\n0vbMfX2ZOnjQoMbFPBkRFrkqhoIqUzgbCBc0KH1nceN76mN36aJvzRyRHwwa\r\n/jgHd0yW9yPB22Yio14ypXI64X3LIfQlSUxMNmo/nqiuM0yxtw8i+4Kf+Mzr\r\nSHSOnRVKIT0IrKnBuT/hpQ9U9ocAtfdvhiW9Fv9/72JBdvAHvPTBz/EWL7AO\r\nCsrZKAoTdyUfmj5o+SlNQtgsNPCZoY4X22Bg0IDZ1U6zMI36kCg6QHWKLs5M\r\nJeDhx1ZpM3b2xSXMbze5BjdZVFUcu+lJiQLoA4KtioOl3LaFC/rTEELyorUm\r\nc7wXWwOt2w08Nhnx3m8LZKPHK0iZSZM176kDAz/GjbPFHpMia90E9GwQKsXr\r\nx25cy20nBeZRRdWVMVwuzdGAn6kcq7M8s1QXbcmuq4xuRqeRyd5akvJM/8Y6\r\nZpBqY+LEnJCS95pogTQs+h6nEIu5mb3Gyuc=\r\n=VMu2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"95bfcf53556f682b32c73df87c29729c4af6f142","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-95bfcf-kzy6x3i0_1645538159364_0.8836611705268158","host":"s3://npm-registry-packages"}},"4.0.0-feature-bd4980-kzy9d3yd":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-bd4980-kzy9d3yd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-bd4980-kzy9d3yd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f997080518ac45e6a1f46d7ddace929efca413a4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-bd4980-kzy9d3yd.tgz","fileCount":153,"integrity":"sha512-9x59D4LAThhISqIe1QloV1TWhngGfkXdEuKBYMI8Y/nXFbZgrU01vIIBVwZ+62p5JUY+0DC0GE3O6LlCfnwgAQ==","signatures":[{"sig":"MEQCIF9nYNHMYCXk5etkZNqxrU5629DSe3LNtzsZtBEvXt8aAiBB76/PvDbOqAJxkwTDfxlXxZkQrS0MEwo7XeXKxFRi3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":446389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFPt3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrchRAAkrZWR3Uxb6Mef1eDTqnbg00g9WsNtsaJTDbGF2zH5w9Qw2yb\r\nK/yB1OEDSbPSOOSbMc85JBT91T+tHUAbx6g0CpLj5Iyz7se2ThZ3K442KvrH\r\nybbWukXnn27/IqSCKXxtqbCFls/QIKpO9Ctgx9KkhjgOO2ifZGSO1dsEiP/9\r\nu2SVahHZdxE4Me1jo8tp0jGU4DPErWUGWdhBXAFpiAz45eMbmsNZWmwydUME\r\n5gBwE7bxZIwylXQEJEfD15/zV0wf8zGphzoZ9Z4/RzGKJaHFk4rqAT/hvuid\r\nWDHufm0zlWUUnsUgyxheealc0Ync8T9+3Lqiwc/AODUpSB0q9DQUDAICAKjz\r\n9ujL5OtCaQeLQvQu/pFLMIMe4Eu1jssHJnbj0CJtJz4Jle4lSjUh4dTsfNnt\r\nX4f47CRfI2VCz066jxm8nms8aD2UfiRjMJWanmpYn8k+4i6c3/FNXnQRZs5r\r\nSt/UGXc4LfaOZk9Gvv94zP7ln3NF9bOuqpPTInVdTGKg3F8UseYC9S0uPLsU\r\nSwBd6I++E2ceRCZ6oclJN360NTq03PXavrgt3rXATVyxIrz1ncgdPZlFp9l0\r\nqJPwHE8SBxzuzxsseZF481+/ztDg5x4/NCZtQwET+PMTFgjsznAGKbJTMyls\r\n+yV1VY8LS3EMgvUXl7E4K1RMpthIZ+HnyKI=\r\n=X25D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bd4980f0c0df96fa613b368f0f2d2439b8dd41fc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-bd4980-kzy9d3yd_1645542263509_0.5641182484457341","host":"s3://npm-registry-packages"}},"3.4.0":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a780853565ab1fa9bf5f4645a975ec4e18d4d839","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0.tgz","fileCount":153,"integrity":"sha512-uuSrXAfnRPEGe1s0IHeKG0r3WLDPewW6B4dkof6H0RH66PKb3obch5vIj0i456xspG4w50UWj0ETZWgIG4JPGA==","signatures":[{"sig":"MEUCICFYRV6hG1P4z23Ddykx0EXEKZM1+BCdTauip/T80MarAiEAqwCK7ktyytCs9H9Xewm3zm7LPHFjEpqPBLTo3A0xSSc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKIt7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1IQ//Y4eZmV2xWdFVa+HSP8pIIND+c9vwG+NBIALdtUAoiyTBnvTq\r\nRKc8MRq8h4RhNnwpJdwk8Ppy9hK4rESfIRG9zI8BhFR0i+T3jDrqm4grS/Ix\r\nATb0FfexGYnPuAFwsSTKc/i7WDe1Kj4Ir4X1QAGjJ1+NybKD06+E9aI0URqc\r\nGx+8kYr5uyvBG7m9w5a+InYFVEU8RsNUh9CtTgAecDxzxqW5Bdtc/DBRQrVW\r\natQAlpLrSmAnLVmKM5PNGBeeRcfNhXnmLdQFHDV0+tyWPhirv4Ymxawx6pLo\r\nq44/YtWIW5ORZ4GJlU53mPFoaJ81qGMI28gvH1jh189e4pIfEEHYtsajOmWr\r\neB1AKAjz8uLAm+cJHvuJhLI2XrfBMaB9wwNR2qJXeBGk21eiJrU3DoZtDetM\r\n5DcO0ZD8WJhcLGauFBxNAZWTQIcyYd/CN7kC4PHTKIsyD9FJ0OaGrQGWUv3Y\r\nofmB0aGM4Z6FmRSTh/o3qAljJZbGZ4cLMp/8xfP6QBv5newJKdUev9MlY7iP\r\nS5k2G9LjC3iAgIqMA7WcqByPXy6GUgEyOpkpN4YQkUN5iHJKpw2y3MShZhsJ\r\nSGUUdXgXuQNqd2n+Ubevk/F4lMsCshNxy9d7vip5WHs2CzLtMpzeoA3tRIg1\r\nvdIQojw1+cJ86VdAWu85KJbCBkfhUwRjXpg=\r\n=AS32\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"ec618a605168ccd8926eed46b57bf7215f28db18","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0_1646824315427_0.9877555775360032","host":"s3://npm-registry-packages"}},"3.4.0-feature-19085a-l0kslk8l":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-19085a-l0kslk8l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-19085a-l0kslk8l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fbb6506458fcca4b61563201c814a3baa58dfc57","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-19085a-l0kslk8l.tgz","fileCount":153,"integrity":"sha512-57q0+It3bzZAEiIK6nOTWDXQy+/OBvEWVBKGYZaT1zMlm0ZgdG+qKkBPHhF6i8SedRIc7tpayGJ4SWDfw+Hv2g==","signatures":[{"sig":"MEUCIQDPhl2OwVUo1hENIcnxAOo5VWoTOv1NYDHu68M7KBxtpAIgNJpxxPgdLZ41g7e7KUuDTAZS5U+Me3pTNstDEuzVhRs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKcX9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXIA/9FXRCAapGvSpX7+MvgEhUo+fqf0ReTWP3julWSUZ+yklhYZzm\r\n3xtYY7zSKTOdyx73dYlVFKaz49fmqjSLL6Dz28DoRK7oHbKpYapuWciGM9l3\r\nxn5EpgQEScDOP8mLpPpHacJNgsI9jBxS8kTmT6RNA6bbYUh7d6b6357/uo2Y\r\nFw9/vyIWfFqfiF1HXS2CkH07+Ua8OEnd5CEM+MC1NlDwDx1g2VE2cZ9ILKe9\r\n1bVH1Jde5XYRdg4mkgAqPFNHwh6HkSKEqIaE3Hq2a/jdq9d39iMf6eshrGO/\r\nGWzuORaZXqHMc+/UsWPSJJfMnhDInveq2Ob1NQqfNTAA/tI0gNOcKiYWdNqJ\r\nf36cGpIh2pID6ws/DLnhUvksLbt/BvNUhpSy5B7KySUwyZCU17CosqHI7d5S\r\nBPTxxFZIwaDouKlo8DbihBg5aDA4uu+F/w9eNOwizsoxXMNPscjVjfdZAlmn\r\nIM93v6COj27Uv7s3sbzxD4jKVKnon/eg/U2JEn5wiahGyrm97Xe4vxHtHAEs\r\nC41frSF0wwxb8PZ41n4B/wTJFSQp8chcc0dsMAPPIAGtkRWJR005d8r/yLA7\r\nY2j1C2h8kRhhsEPb4LdZ3PvIz/dkxqWtAWtOoIhZs+/lvwPy9UygwJpt7lTL\r\nTwnh6Ec6Bsp4w18jwQ5+ufvtEOnEb+PdgCU=\r\n=DdAi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"19085acfb5d54f900f85daa58b82bd68960b6d55","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-19085a-l0kslk8l_1646904829503_0.29004180047226913","host":"s3://npm-registry-packages"}},"4.0.0-feature-b90b35-l0kvz0c6":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-b90b35-l0kvz0c6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-b90b35-l0kvz0c6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0fe9b3b5c98834e4ce4804ff7fe75b3deef14ac9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-b90b35-l0kvz0c6.tgz","fileCount":153,"integrity":"sha512-sxH3Oj9Qe55YVjYhlRhaCdcxxe/N/igv1a62YB2HSt5akIcCgPPIo+x/Tw8om5chHoVI40gWulp4CE+cA71OCA==","signatures":[{"sig":"MEUCIGZzciir0feIx+VfqxrHRIUr3YEJ+Z3EBxHO8655jkRYAiEAo4Ci5aAamAO6EYO5Djm4/eKgkDUxFJDHi3NKOtJKibU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKdwaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwWxAAnOTn0z3/VBgi77HRim8XF5MJF55GLPjupeyEmhzaPbUPmJmF\r\nSWUYLBiIqAQ2MsWhgOjs9CAvl/OCIuOWcMKjKOBSfQgPakNB/GXq3ja3Ikmc\r\n4IRDz8DHDQutdFcrLcf/sUw9Fq9O7jQThbhs8/rnztZ2mCboGWMDz7tkVkj7\r\nAyCGmxoDj0QgQoyd3y6TXs3NinLjiAGkG5DkCBOhW068/JXRaPijNRNT4701\r\nEL8voyUXLvNz+cqhxG/XrsJ46GEjr5qgcNdeY8Vn8EJsLWlxFJMdx42vZvg+\r\n+31k8uPKUbVeswiFO4waMvnJVKQKxVKwPT6xK2H5GjTnbsyUXOzLXFqFNzPH\r\nXMnX5f8d1sgbCWY7mpflN89u3cCqGKwiuF60B4Px43H8MJj0mrlC3OLjbcvT\r\nPaD/cDbUiYXN8yUxvK6+cp3btge9uAfVFuiIK6D2Tu3bGK7V67UiF1m+S00C\r\ni37yIkRPiuNY0REF2Ex1RdMbQ7leS62azz+diAmRwesN9fbrYaVHFOyUDkkd\r\nMB0qysUtHBUs8dlQBkDHJA0py9FV6Xf4peRA6/iCUFZD4vK/5mU8keNXUlB7\r\n2oPltQd6Zwiyptb9AghweWM4XNdly7yNTOX13j+A9Shazs4BaFkBG3C3kSv7\r\nWNwUm+QoxC5imGKkuhWTzaFu1zPx56DbDEI=\r\n=oPM+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b90b35f15153f267b3b2ad6cfcc1afcaaa590423","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-b90b35-l0kvz0c6_1646910490668_0.5286820629998787","host":"s3://npm-registry-packages"}},"3.4.0-feature-de0ebb-l0kwl4uf":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-de0ebb-l0kwl4uf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-de0ebb-l0kwl4uf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"57f04a84f6f6f78c55db79902e4740f48bcf67cd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-de0ebb-l0kwl4uf.tgz","fileCount":153,"integrity":"sha512-Af0zlW9+pJg5SQb8tvyYGss12aMuNL55aHRrUi0uslUMjcM8oBrN8p+kqBqElqM1YUUeiQGx6uqi43MxH3J4IA==","signatures":[{"sig":"MEYCIQCFbuL8gcaqEwscaPK6rQWgmsembwWbIONrd8/REqQfJgIhAOG+sNz9d4DVu1Qc/0zdxgpsLcvJDDC4LYK92i6Y8DWK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKeAnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6kg//QgzRkOPA+ICTeb7dvdeQOuFwMVaykmJG6FpQyf1b2FzF5clC\r\n0/Exkj8HkIo0db/MpqYovXKaDe5CDY/xqd2qy0lKWnDKcP4VAqM2+X9Cqs1Q\r\nkpbGVtsDv7zgBWgC0EkpzNK9UPJM529GUtnpmnSSO0VhCuY6gUN6XABXNiRB\r\nPM6X3PakGKDnIRqCGOpnHVjkig0lnzyyMrNHjgHL5iWBtqSTLXB/6Q0WpX2R\r\nlThed6pLRggv372KLJphgGyUWxM1bbp6vmiswlcCaUFpCHx89zW8IVEyYqIT\r\njKXaaV2uIFZk6POSmfq4De4ZmvYCNauvLhCkl1so9vaE34ilS0BsJYEFLEgQ\r\nXBbtks0iQyWg5iXyHz0UikLkeSNoGyHuRjhrwRwsIFFede0NN1a/AIJrkAsT\r\nS13/GznyoXC3st3SUehSX3feRKarwnDlx7+pB0X8tZI1HQXU9Z9YfIl3kcqZ\r\nkHw+diToQM6ETQmI31DGJsnSvpnbKgfr+m6n2PDTwUQmLD0CY337z8Hxt0op\r\nNNZKVX+12PVkFtWX2tkEPlUUSsUc4z6TksfYZg0coKoHQ5yPDABubx02KY4g\r\nRWDI0XIu5pXgiPpsCg4SHqiqSk5sRgHkrN2smThEbjPHeUxWCn4nzotmUgvf\r\nAdEilXZlZ3ofIsVIwNluQuU6oCbJroTqsfY=\r\n=18sR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"de0ebb38bb663db8e735d52c535d672a5650914c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_filter_and_sorting_to_process-models"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-de0ebb-l0kwl4uf_1646911527666_0.8167111470767141","host":"s3://npm-registry-packages"}},"3.4.0-feature-598ccb-l127d2de":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-598ccb-l127d2de","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-598ccb-l127d2de","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ff06da7dfa0f7af3c0f21c573260fe9bfe0dd627","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-598ccb-l127d2de.tgz","fileCount":153,"integrity":"sha512-DIqPL4rkFVJLBHfpKOhd45wQ0JrlV2cUyQXB3/yy0RxNBg615OcMm3KOjR/STfEGGNOElv7IaD8ANGQWdy+iRg==","signatures":[{"sig":"MEUCIELMBZQoDjFCbsyUI1wdCVgT3epTo/DO8y8/U5ONvfcSAiEAsicX7tFD0IstugS2ItDHxiLzyfl4/hwJV04+5gUdiHI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOdYrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoARQ/+KFoEYo3N+MJdlgwYlp7vYQ2phE2eNWd7oY4VBXZ51WXM0sSk\r\nXpJBxaVY/5bfAg76TeiHDU6Un4SsQhBEMBxlgkdE//4FohlvqGHN/ScBuo8C\r\nS1MTcYsIFruIEPybHPrfdFLKPbrPhEQNBxPOL2aZm6q7KZFlBXGCgfZPFJCc\r\nifWLhRY6X7Kwr9X2vCfeB1X/5/vEaltkO1uWvK04ZP0lOsSYiF29TLrLKNVK\r\n4bUs/O6JZGMZLMpPZ7yT/GCFvt+KEH/J2BGA22V52tSdvs4Rzs+dgXvzxnBR\r\nl6+5o0gMFehJhgoAYzpNloCA57GCRi9xPr1O3tpxiVuF+c2VLHWDfx//O7He\r\nJLUGiklCZrklAo9aQXBOT5XLXOO3qCH6xC8xNFaS2trlxWmTNc5Gm6K3b1Aa\r\ny7JxVxwViVOJ4XLk5b8svfZnDWbbjc9pmqWOFmQmc7Nl7Yr5sT1CndrB0Cwm\r\nNm7SXz34k0USNLILWF/kWPF1OJ1XXaJr81r9uN45RwjMBuHtSKO7ChGqcJg4\r\nE+ephjVijKfje/e6q6QhJXS3M9ZhDJjhj7MSI2pb6RYUKAbVZFrremtk8VZA\r\nWCIqK4u4JzRZ8weGsH26bi+TIi1kNhoFDOfykjfKyz9tXsgnyvzXcSzOhkpb\r\nN3Sb2r0xuK1OLYoiA19npV4u/p1RWDLR6Do=\r\n=95WA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"598ccb94ba6f2da95732afff23186cef8d024cd8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-598ccb-l127d2de_1647957547452_0.16593825577592236","host":"s3://npm-registry-packages"}},"3.4.0-feature-9b47f1-l127zh3v":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-9b47f1-l127zh3v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-9b47f1-l127zh3v","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2c2e2e7d59421cb4a4d6b6fb69b5a3efdd0b5149","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-9b47f1-l127zh3v.tgz","fileCount":153,"integrity":"sha512-rxpBvpHDZKnjHcUAgh4CcWfQlaFOsgiwyhmMLoO+uGGxEhSyxCDsyyzFp+XCwg74jL2g0uaiBTqHx3J+Uj8uwg==","signatures":[{"sig":"MEYCIQC9mo5j9ldikM5D7Qe9lTtI/ApiS4UP/qPoCZjWxlPdnAIhAMeD8c3no+pFEQHVjP+ddWV3/kOQtq36DCEoX+9wbL+u","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOdpBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTpA/9F1iYeIOZHw+RG66+A0I94xOiiYcZztAnVbjqTCaeE8g9I6zN\r\nR63CfP1dGf4y/wVbXTURo+qxDYA0OcsfVHbiePjPsRmypvvDwPYkOnLmMOmp\r\nCOUA4mA73b568sChM2Omk/ZGuxIKZ5V6tzhtXFf13ZQTwtQDVEA4mkOxMfCs\r\n97USc5/bgrrrib2ILK2Z+AfQbbEorgn+Vytx9ohHUSWv6eKKV+QPCC+lc4oy\r\n7uUVJt5jdauRyW+iCQDMRqB+OZu1zbUW29TYOM773p4qDy2XqD3m+FBm6VuR\r\nDDiGGPWSW5e3VIihbTbLadC6pw6Obuil8NTuwMMrVNvrgjeY/NU6x+FgQg16\r\nPzciELeIKHUZQaBvKHNkZKqCf9b157OLpQSjEkXmM/4GkoNAcpPYUhq8uOgc\r\nVGh+5lucLqTW8cmgKwoRg8bs5j+N5foVQ3AXiXO8IPtQa/xHQ4PrEFxygWz0\r\nfr9Me3SxUQMJeou4YoYJLBtjFb9GNlcZZOI7a5YC9kWxYmYpBPFfMMYnx479\r\nB+4F/mImHPAlpgmDdlbUiO4E+lBe/zIvH3PeC8b61GLffpKIgYyCHj9x7Vc3\r\nSWdf9mXu7zujo171+2E6/La7xVPDVT8KaWIFEbrNUEw4j2gRpVeo04zuNlyN\r\ndHjj6V/rGjlxJ11XIPXrmeYIIW2vnzwwHoI=\r\n=HhhB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9b47f17e0ef4a7c29c2a5acb662e96b1b0becc35","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-9b47f1-l127zh3v_1647958593176_0.6235426067548364","host":"s3://npm-registry-packages"}},"3.4.0-feature-0c084d-l12927u8":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-0c084d-l12927u8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-0c084d-l12927u8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"499f7fd6761233632ab3a48b743361f212db25d2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-0c084d-l12927u8.tgz","fileCount":153,"integrity":"sha512-lrkb77x/P1wbrQxVnkEujMwettT+SCIU8u5ntGM3onvJLCdild21sD7dDzGpV4aDF59rwJwh9s2iTJ8yxs8B6w==","signatures":[{"sig":"MEQCIGxWy7/sOPXi19ueXUEN0SrqGCzyEthPMWvOT2s/29ErAiA8nk7cpJBJS26BAdDoQ2BJdUIvof8keB4p+BksVEfVOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOeFZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKUw//fdtIt990gtRXOPSB5x5VoU9XpK5M5a+5bWiL/K5ZE8KhP+MN\r\ns92zOPGcx0UXYk5y5gT2C401bCmARlVECNFJueW9fM/5H9+kYIiwHJFOAKZ2\r\n39KjNezI4itYn5WkyYC41FdWq1iYHNomKHcMjUYe2mP6sDPLXWQl70fKqj2H\r\nYRByDLbqhhSL3EUL705fHaQU2oWwBQqKZzz+Cz0p7OPXdL53vbYwCBW9tEHv\r\nRbceC/1ow3YNqmy0L//xjIx48DdztMVyzN0qn8lawS6LHvQL+JOZy55cFq27\r\nXlOxJ2sKbHhmBuntbhZTt2vToUVS8jRJCevcyll1DKRXa3qsR7ieAZKx7A9F\r\njhkjbhRx5nkYwIoBaATCp0zYvGY70BPgdCC1EUD4NONbSgkmcTltHr+ITYAX\r\nUUqNfbaYxv4PYi0jnQbFj+w/GpnKAuV8WfKrYNUCdjjXhP2Jf4UuT4umvCj0\r\nxQalM+GtBL5BDV0hXp99KHc0z6T25oKJD1ke8CfwU5PQfP3+04i4IgqBsn5R\r\n0rNwaOk1ftAyLU78MmYhAr+kmUS8lRh6e27TwM7zomu3tIZHNlBDp02hZbL8\r\nKYlmgxnNGSqKxoquSUQAKNe3b3/y1kPgcEej3+vpnfzvSJ7OV+z8YjrTZWPn\r\nuDCMrq0X3wY7v5Vnvd1Aa3LiNLBRHe0GDCU=\r\n=j/HN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0c084da9aefd0fa568779918c9e8ee741ff2569b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-0c084d-l12927u8_1647960409232_0.046864795882306076","host":"s3://npm-registry-packages"}},"3.4.0-feature-472705-l13e53mr":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-472705-l13e53mr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-472705-l13e53mr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9fad90f238c70983cadf376033417eb2aff61e09","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-472705-l13e53mr.tgz","fileCount":153,"integrity":"sha512-a7CgNNlkKoHNqkw+wnD2pqCjTvFe1Z2lXevhwvA5RmrKxzn2Fcw4Syp8LrOAbWb136NoMIbn/K85XgK2XZC9Ew==","signatures":[{"sig":"MEUCIBvdJ0NoAoEwiadeEHDwJPOB01wlktWrPysPN4gy+iJjAiEA2LHqFezRD4h/4F4VtwKfSqlOm3vBsv0AkEn8guhdE5w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOu7YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmryQQ/9EJT8jlLwatBWC+BW6/aGErRczk0RBuxoVNtllxA5AXEJdbvI\r\n2xl9KTPQYRSrTk2AWjYui5MgSNXo8jhPcw6wC6Bf+Xfr1iXVIxFTMtJ4ZXzq\r\nudqN/rpwwd2RcHMn72ZFHU8rp0ddTdHlhGrD/n4CPh+u6cEhJTzXuOHrulcU\r\n80crNwGcgJEM2ribOYur6UILMeW0HeEcb2BE8ULiT9Sjrv8+2cVXux9PuDY/\r\nw+q3U6b8TjuCbEFlmxjm6IjNrny0+GJyDnF66x4R48E+33zvfkf2ppjSaJuf\r\nHkZQf20Y18TP9NxF59haPdIm8EX4APdiF8rU/CO2eCIRGsCKT1FJZSPZBbs7\r\ndRkqym0+HeSUw6eTsUoRsesJJwpDLMz/WDymWzDvh5YMefFbTfmQfBunxNpQ\r\nZ93EIMjARjG5IxR19uQPZuqvi1QaiHvPi6O8W0MpGRHxmMt29HwwJASnhvDa\r\nf385v7jVMEE402fV1BaZiQT9Bcu/vzDKhERTsL+hTAX//jRBZx12/7tFIeoW\r\nEwjPjqqnxbqsd4q5V0DDFL3T/P/dnzedvoCQlg8bitbDtKh2LyHGteSNxKnC\r\nE8A8P7sKTlR0c8AvZB1UXjSdut7x4IUCEnYkAIiZRBuC9Y/V8mhGTcOVPU7Z\r\ncsZreishDjRWWTy/Aa5VIxU/tQsl8K+H9rk=\r\n=j77E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"472705e72831e9b39260c57ff0e288ed38838502","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-472705-l13e53mr_1648029400791_0.792380284266252","host":"s3://npm-registry-packages"}},"3.4.0-feature-81fdbb-l13f7yf8":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-81fdbb-l13f7yf8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-81fdbb-l13f7yf8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"83c7b43093a3c5a078ed288b81106d92f868a999","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-81fdbb-l13f7yf8.tgz","fileCount":153,"integrity":"sha512-goOeLH2jHV3SQimsup+NQ1C+qMxD6u7r1IP/PtbeirSZK2cJAom+JoV7YD225UEoLJSLtHiyWdpYj5S+dIf2aw==","signatures":[{"sig":"MEUCIAJVBU+mXraDNZXDkU0tVf6xnzkFr8WrbSKoCvpLFnaNAiEAhIK/yBeu1g0YCFpP1/Sg/q+N9S/djlM6eXQkU4Dq/Yc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOvXsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobGA/+Ounn32laLT0ng561DUXjpTW/0iDbkZ69cXrNkEAza6iAHoH4\r\nIRVgjfIAWwMrNPC5v5WME2mE2m9zy2cSvbXZ6O953zZ8gKPuntmjnpjEZKvE\r\nBSc1lynNVE9veW+acONzeFQHdHiShvbrb39dxCM7DeqNipPS4XkIvnAK4Mio\r\nBClFUQyqAItSKf6FZuR+GLsx3KQyQNsHcgvyJYeZ9aqFLjiKDfVDuM9bo+7K\r\nV2jNQawCcGR95nAESZLDx89H9qCgJ826EqPL8fL6yzLpCfuN5cFo/NyOH2Yi\r\nn26pu+9qNWBe0E+wE2Mb+kAjgqieaIb0f++d+Whr1fJt0UShXA2MZRMa5biZ\r\n8UPKhJbCjrwKRt3XyVAlQbgYdDSw1eymHQDkAN03J7E0+x7zJlnrRcu7b+9K\r\ntScYjtSr5G5wiyAESUREB5ueq3Avd0dgyzk15+0JDfyEG1CU90a68PXqsgCy\r\neGNGxD5jLDFI5FMy2t1HXt52NLII+Ksrzt9IUVOb/iTet1hPlYX8KA4ZCUE3\r\na5Xjn0HIf6S+a8MEJwWj8lZ+fJTaJqejDV+w9H23a1gmh2ob59v983CGr9gd\r\nl5NeAdZT9rhS64DGbvbBjTEQ0rG44jWXo00KLP0e7owDtxo7bp+4YKFg7RNa\r\nR6k9krP2sqaka8hXXboc+CdvtGHRlvSGjqc=\r\n=NzJ8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"81fdbb96d02524459b453fc5f2f3dda3f8ec6a1d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-81fdbb-l13f7yf8_1648031212297_0.6018594129799733","host":"s3://npm-registry-packages"}},"3.4.0-feature-d45eee-l13jxqhr":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-d45eee-l13jxqhr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-d45eee-l13jxqhr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"29d2ad2855387be46be4da0ebfc53049652db8ea","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-d45eee-l13jxqhr.tgz","fileCount":153,"integrity":"sha512-owmCHNdvhCkGBi8IY5Ybj2wUOKUQ6aD/yRVmyBu6YXwLIbxs6TZUzT2Vx87z2X5gkEmJEkExhU1vNh7mdK17xg==","signatures":[{"sig":"MEUCIAN9KUBIoDIspb84Ej6hUrffP5vlCoWulivtoQI/qnk9AiEA25dPdkreJstnp0+gEyfx5gnLFuWJ5+QvxSuRe5C8YgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOxTeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSoQ/+L5j7FcOGaBq1Rgt3z50huxzTTOz3voeHDpPVdHXufOvjAubN\r\nroLV7aEdrMlT1c4NJHzJRsuS/Og85Z7nAyNvFJofd56Updef1pHPwMfd+jO+\r\nG4OZziMDRA9iKMZ4b30Q8zjALAzEmVDvxYOQiNdZpBujGQa0wU6PXKWADDTT\r\n172pT610XLgH1s4OjoJC+g9IV5pXvm093kL41I00+IwDlvz1CfwCpX4/SQrv\r\nB5hj0667x2E6vWwVp8bqp2C2ZfVPMSaOJD1pR9lGuD+4SWU12LUEjjB3RRQQ\r\n1Tq44e1JggIeTtvgUk+9iVvjMKsx9FLAiypemAgzBDAe5vIqV2HtceaSqQpM\r\n73K+923HMMSQyz6ahDp29UbEKuDKR/EYfpP+OigyistHRZqV42XZFesIQYy7\r\nh9p2tPTkHt3dF9RahmQ9FFLgnfoQmrSlO6EmDeOe1bGbrNgl9ugFW3Qr2Ajn\r\n4spznIF9/vNV2wdQpaYRqK4dP43NpliEUZEz1geOmXj1nmukm03/nSThEP1z\r\ngWjqijg+7d3tOHr8UqbPeVc+NlbGPnQZD1e6FOMIDaV07KZJtaCgnfICzdbd\r\nbS9Tx7ancIvR6h/ntZEnNZzhXBsNkXYT+zpMd2c7qHTulIplFg4IarzMkTbR\r\n+g4yj37bN0W1P8o+YJlMXQ2HM45/njc61Dg=\r\n=7hK8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d45eee49062fad7702646f92c8f86d6d54ed17a3","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-d45eee-l13jxqhr_1648039134239_0.487470348040403","host":"s3://npm-registry-packages"}},"3.4.0-feature-32ca58-l13kdrf9":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-32ca58-l13kdrf9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-32ca58-l13kdrf9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"683d03592123ae987b6ed40384b61951e33668c4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-32ca58-l13kdrf9.tgz","fileCount":153,"integrity":"sha512-JA9kF1hkYI+feA+EB+d6tIK70G8cssG4WXnj+1eAMV6ls5r+A1NXNh5y9N/ezuQqB9lA9e7zymaGw43hu5/qEg==","signatures":[{"sig":"MEYCIQCKuJMy9XC/rTyG/Vie53RZPrtmjOtC/tnyAVqiqYuMdAIhAI1l6LI24P0RyTVXajUXzl85nVS8h3Q/FyKdegFRqfOy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOxfJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5Ww/+N5dXJSHA4k5H9P2VyNve/4R9ENGbT5OJ9SO7FbX3/xoCsvt6\r\nVP4tDZ/nl61mzMe83B2z/HvQZuJPjPYAZmY1XhhtUaJSyHsGnpqYlPlN468I\r\n1R+huE16ui83BVU2isyBcTGuVSpZTRS1lDdkcN+1Ln5SyTIKoqJbZNByntd3\r\nuZCHtdgcaz7oD7Qv1JGBA/nXtWeJO0A8D/Ig9HN4LteFHGuVrjRf+ahBcUUq\r\nUDAHex5tTY8dDOYkMYMBBR+wAKjvwfrRd5k5l2oCTTyzG6BFhIk7zY2LOGVu\r\nJAMQEKjAqEpp4rfOJQcqt9++2B1AxygFJe6gyjWSxo/weAwMH/FPJrmlxRL1\r\n4b/j9/xsUofgW/A6Z5yk7zHqa6AiiifMzHJf2B4KxT91Bgnz5ABgHZgGu8+B\r\nTb+B7MlNVDGhiy9D+SOlmr/GYoP/96DxxPLOnmJLgcStQWpENtEvPjlzdi8l\r\ny0MTcGWyDocYXHBGTWQyVaElc3v9IXnNdJwXEQHsoBVXNaa768AR+ILUg9Qd\r\nlqEl3cKypyVFKvg4HnkfK1ilzMonDaP6Xrt4HS+SzWYtba0XeTvRlp9FsN9R\r\n/dxHhrcjrfRRV6GPLZjurY9cVTmd2uPS9G/+xMNMe6H4qCm3exXmV9jiyki+\r\nJwncjGk9j3WX/triFZmsFWawV6bz9GlN42Y=\r\n=luml\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"32ca5878f5d8e18220277fac0543e7c59f5fd1cc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-32ca58-l13kdrf9_1648039881609_0.30345315578384957","host":"s3://npm-registry-packages"}},"3.4.0-feature-d34a58-l13lfi8t":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-d34a58-l13lfi8t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-d34a58-l13lfi8t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"77ad6720a6e7fbfde87657f21787b984dee983f0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-d34a58-l13lfi8t.tgz","fileCount":153,"integrity":"sha512-WNzxMCbdQ8fGagdI/HPum/t1/wi1T1pbWmJljgGfaDJ6yUWHwIraTA1JNujPKqHFzxG2T6rB8VeoHBppBM8TCA==","signatures":[{"sig":"MEYCIQDlyVJkrszg9RN1E51qjqL9BTKDEW14gy4KjNeUNcANXwIhAMVGvNObicNlA67WgV2fae/QjWsGvhto38lA64o9pBb3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOx6xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrH7Q//Y+uucC0Qu9ieP1Aynrf6vihYYsImH0c5BVYh2wN/zfOp4/fx\r\nxUAYwVU4YC7FxppeE+1pkYfXckDdqLJn79xQuu3tkXfCuQhF6dnTI7T0EeWR\r\nEzozwh3bwhp+4ixGbmxTBNKv6JUIargz40zEpSGycdpX9+8ay6JiMWBplzWg\r\n52pPkbVnwLy7FGncO3zI2s/ctcT+/+Bp++W++3kMD+vCni9r7etq1NG/za6N\r\nq8FFocsoJ7LUD5GqKQZLKo4VwF1KUBL/lOGB2/2HcR58Cj2ScYstyriWAf+q\r\nteExh/X/8+SgWy/V+QYv4vb9ov8k0fm7IiQkQLr44CMctbx63Y1SFsLhzwGU\r\nmZq8xcEiEVBIFeP7B9K1g4rR05yHFIEINVqzYo1VeJIS5jDWTMqsiq+8kmY/\r\nnomSfBncPd7hRcsSrNSFOROxcoz//GTqW5v0O0RXxVV9idkBVMiBn611zfDL\r\nX26xng78RoeDg3anh+z8hds7ojwTuWGEz+Mtslaslw1Fc/vU3bxvWJPPOwAx\r\nZYhO4XZwIrUI6EDJ3gN/CoIVxnaW/V8X24fcCX54ipdFObemRjOz16/PzZUR\r\nja3YZTQ7eOeR7aBMVjNFY9oQrfuqTqb34KfwdEKPAGgkIvSxPlWggw8A/dZT\r\nRiXGyFHw9A3ToI7XVQqkVQiwM5jmjbpXCxM=\r\n=VpZ7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d34a5890d2dc5fa94e2fe413121827c284c2b79c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-d34a58-l13lfi8t_1648041649156_0.24631560645609119","host":"s3://npm-registry-packages"}},"3.4.0-feature-04fb48-l13nvtg4":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-04fb48-l13nvtg4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-04fb48-l13nvtg4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"18453144289e38903616f43019ad38af72f2519c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-04fb48-l13nvtg4.tgz","fileCount":153,"integrity":"sha512-WgZ2K48hwrw6ChtePiRXzQahvzCIFdwhDXDjBUDTSqEBAnKEZrrO84SehC1gRUjXPO8RWRDVu8VVrDFL5yp0hg==","signatures":[{"sig":"MEQCIGHuO8nBh87udgjV56p4aS762VDDN8D0RZ1Ar4JpfswkAiAy/R+5dCcwMGjvzu+M3+t8AyX7xDQEkMITbklkvaJ7jw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOy7GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoyrg/+JH1KQfT1gDaYuq+8SF6m2ax8fS8uWRYDDwbgsrKcFYX6z9f8\r\nbtcIqeVmnowX+ynGJfi09UMeC2sRfgZV6QiiLUbKVXeM8UMOKp6MHIno8Xml\r\n/B4JpQ33cIxyo8zs85auMGjP/eKiPhyvYONnkzfK//NZDiE+UUdp8nAq37J9\r\nJXUAKsZ5t2sOQidqyzx0ArzeRbaUqYOa4WzYOjqUAOOBOFPT3apESXQtiJNO\r\niJC+ukZ9CjMJkZglSE3khWMi92EFj+wkZ+aqca8k/rZ3dHza0/ZRIq1FMIEN\r\ncp5/MRTd5pdZGLFx9pXAowu7ZqnHBt46D+nHv6e2283B69qycbsY8rH4os10\r\nszVS4C4dtrMT1xU1tzsc6Bkxe9FzB1vkTLOfjg18s07q5nCFStmPDTaIC9Cj\r\nVA6GrLQRi5jzjTz8s82+HUYm7QIu95jkeQ2hEKt5LigVjNqtMaikXo5JAKhU\r\norkcBi/CGg0jXzpl6BaUbZS6xIDyIw/6TdpO/OFcvWI7KijBrFWYDydi0SYf\r\nm+p0m2bLdbK5P62y1/gUy45dVgBi4HQ9eWyTfZvcbNtayhvA8kMqO7sYa1R+\r\nSUOLMeW38drbHsKoQI9ZE9/j1drRZfunlwzDmPfc1AVI8Hib0FPip/EkMID+\r\nRnafD/uKgPYGK8MJt3F1g9nuj0vjjkzvxIw=\r\n=Kg8g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"04fb48af69519c048dbe95e684290dec47864b1c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-04fb48-l13nvtg4_1648045766611_0.14022395927538356","host":"s3://npm-registry-packages"}},"3.4.0-feature-b315e2-l13q8lbz":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-b315e2-l13q8lbz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-b315e2-l13q8lbz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"697d8cd809a87c01f3a6cddf5b2d5b9e2c3d6956","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-b315e2-l13q8lbz.tgz","fileCount":153,"integrity":"sha512-DjdwMCex4ba415s3cz6CRkvySqGPuQTDSRxh686a8q8QOo+QLc/LnqqF0nfZCStiKiBRr/Uh9RvWtSLDwYdruQ==","signatures":[{"sig":"MEUCIQDN7GGhkHmh9WeMzR3agobqpYEkOxspurNWcRpd6BzRTwIgY5c2y1hYgAUkg/OAnhAk73VcvqcptrzDe1DYEofY11g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOz49ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1PA//frFe5R7QBHlSgSS0IkjRTIepgMh6Z8cDN/PxQ5diAsKmmEbz\r\nl4qadY5cAbs6hosdbXU/V62Hu5abT9Vb4PmCJ9lCwzEWugccEcvz8676CsX4\r\nPYnpc2/okesEeMXRJHoXn8ks1skq9JpeSU945PMI1IA9dn4x3FSF8UfCf7J8\r\npWaDuoLXScUp5SlJfYzswsxR2Gw90hGY3lrj29rh4fdxz0uuNRT+UMMEP08T\r\nt2jW6oxBeaYpeKtwZ6i0F5zPtR6CrS7C64ql3/lXLMSP+z0OMNycoP0zjuUA\r\nZYPAilOv024KOpoPpi5ALbiknaE+cgQYkmoepa2U6AEeXiNszyE4BjjYp8v0\r\nBb5mZK1aU9hYV3CrpwQWe/creDz2b5gp7olMxccuYgQNf2lGYGbSaooFkc9V\r\nQ96tcoMwZePOBGhOTBRBmqu3VQn+b62k5mUI/NbriZLUn8DYv3RoT0yqdfm3\r\nh4e8psWVMd8YIEOnAxgM5KU/d5CTCpdCVyhiYwyqp+frD9XVss8M17th5BfS\r\nj/41NfTJcxmIC+uOqcG5Bn8FzM8/gIpcQLqO30QH27ZckcpB6WB85O4i25LP\r\n+4Jgg1bYxf0tllhnO4d9Cx9r+AbEBM+El+/qy4f5YRgF04ndqB5S0bvndYZZ\r\nhmBi7KHqfot5NIMGBq5qXp6SygB82nTJhks=\r\n=vE9k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b315e28c464ac01bfcebce735d8694dd4bc6b697","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-b315e2-l13q8lbz_1648049725240_0.26251130782201515","host":"s3://npm-registry-packages"}},"3.4.0-feature-e1f4c3-l13thnf1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-e1f4c3-l13thnf1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-e1f4c3-l13thnf1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"773701f66892fe2b4b0cdb9a3e817e65e029bf31","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-e1f4c3-l13thnf1.tgz","fileCount":153,"integrity":"sha512-JFm8lKSQk9JGueEl+1o99F4EsOclhIUevIceFAJTWW1QtoP9S82FKHBHlnUKkX+iqWY5EQLkwJPQu1YFw53psQ==","signatures":[{"sig":"MEQCIDeG+PFwyAw2rFq3PFu4qithaGEwOEMlMBFWGBWixxffAiAjzjhGmAEExTcMnnrwXT9kXY6CR3nt+tmGLwd2JBZ9hQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO1OQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHJA//TPbNwxJLl6eETAg0GSiBiidJwoyEWCxMSBbU5ZWN9hAV/J3f\r\n8SBsCm1BnTWqqIgYOCf0Jfg2HKmXM/bSpLl7UpoY146nId5iOR3qVPp3m5lf\r\nM1i0IdmOUK1QQSbiCXWOW+kDmETdw1DZAIW/XuyIVfkpeQ7qJU2WITK7KjGC\r\ngDVBkxFwBYu98uG6Da+hsjdUvRECAmIktebyQmreJ8MjXUGm2TdcTrsSSQnx\r\niQQ/nlgdH/0LRTIIdrKZfwId0kViE+m5aOexISd8lpLiadbZ8sCnDEp2QgYN\r\nC4LgD3Qt3C3/4ykS6X6TLm2mAniEwd1BQFCKg59MmBqOgzkHs2nSNXTl2mcf\r\nwvUQ8tsRZckBkDEEJeugthzOk5o2gsywCy7oKmDZChWZAsG0iEEGXOyubVd2\r\nZObOsJxJwbEVWzk9qqwcGr5lQBceRBj0Fv1DSRGsuLiXl931utnEF/qE+kXL\r\nEhbDUWOHYWDTTCbfSKUlY4DNVBuxXmLoCwZe5PWUDMzVLv3IyXspLLJJDdfN\r\nDenJodQrzOTCdvwfjZudyWj7RR51sz8shsvCGTSXyXrkMPMSj9zavX08WLKf\r\nU6PenSB+9OWeC8SVNaWRmmJ5xL+KN2m6wkJ9pXlZH9rYZqp7YAnJkwH6VZDt\r\nh7w0jR7VcqB8TrwUSiVKLaOCyD+rGypu/68=\r\n=nB5z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e1f4c363a24b750682aa94d0428f1433bb8b4a0f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-e1f4c3-l13thnf1_1648055184072_0.9510719879805729","host":"s3://npm-registry-packages"}},"3.4.0-feature-5074f4-l13v9lh9":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-5074f4-l13v9lh9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-5074f4-l13v9lh9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"93d73cafa6b64a76edcecccee5a9db46eec95bec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-5074f4-l13v9lh9.tgz","fileCount":153,"integrity":"sha512-Kz+PpQ8BdPJPL4RdfB3Gy10vPfQJ/SzRAAvjyV1tdLMxercB4VkM8LnLXb3XFZpujgzR1qw2jnyzlBOblaH45w==","signatures":[{"sig":"MEYCIQCxpyPijhisZ19qciAZVL6sfas1kG3qOjRqvODHbPmXJQIhALlFNW9CufYzhQkT8mkL+AmD3qjSJqwoRd7st3ux/l5o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO18zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/wQ/9EnLG2bbvYsfjkZVwHP3Ywt4Dhp5oxTefp7Pz/1pFFXENHUgD\r\ndxV5rG3Ddhl5FaIQH5IKELztnMmPJZr99ZZZfAlB2js7U3GFp/nvK4bKj+57\r\nirSi7LduxNAIUAV4zNBVMdpe6fCVYJfcG3TmrVt7jXeZSgc8R5oCaoob6VR3\r\n+jbPDSX2MTe1XFZ5rx1JiZHpEzN/4irkr+jtpuvZLbDkLWOu6DL6VwDc6jJc\r\n4hgKkLM/zu3U+qblrvfS8kzcakOaR1TdOpHTvaITFD7uI1R6F4riwmqEMdLw\r\n7r7OMHUswZQR8WA+56lKQi9JbWQ1TftScOmR4QnT4FhnKnTRqtgj3ZBw2luJ\r\nOgWDgwLfZCInWxMm8b0GozmxGvSVgzm/qvygjnAEwirYxSpQuzW3KHbimhXh\r\nTslnUU9TuPfFSBwGP1cTavZmF5VOR9bNtmH4q6sCJpj3yaPJXI36z28Mkszw\r\npUy/sC15AfU0y7S7llGDDyOYc4JRCdsiyCrMLrHxuhEgzX9Axaulct04FUtu\r\nRcjLn74Gttjzr6Ftl0izD678wZ0bbrwP5vOzilJe76HVEfGHmwg2XrXw6dHq\r\nyRvwch8n/LKWTwMUgRhEmw7gqg45A3UCbKn74CsUbIkjTg2NjExamPdVsbWr\r\nuAgCT67BOeliUTDGqa6MDrz3LwlGbxi595Q=\r\n=Ia8i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5074f43e999c25f17597966d5a22cb3e7c81c019","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-5074f4-l13v9lh9_1648058163446_0.003835613622002798","host":"s3://npm-registry-packages"}},"3.4.1-hotfix-606de3-l1518hud":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.1-hotfix-606de3-l1518hud","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.1-hotfix-606de3-l1518hud","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6b47dda522f5e1d2301069be07f2b55e2e42211d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.1-hotfix-606de3-l1518hud.tgz","fileCount":153,"integrity":"sha512-NWnF/zglQ6kHPtVNU2twnfr37WiILbddvhgutE+DhaFs02/yaKqPXd97Vc6oTYVq/LivgUxZAS17MCFSI99huQ==","signatures":[{"sig":"MEYCIQD8O60GdobUng2gOrQbzCza9g+5dE2rON9Nhk3w9+B8VQIhAJaTDf6nGKSfF8+v+PKfprZxtOtmSOVmgurqxdY0e5h+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPHKWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoW6w//VSheBQfhtlU/oWrqo24ALxpT50d4ZpOwsFl8/kWf103j9J3E\r\n5Fxuktu/ZwEIXXdjaQTfeBDDGRHokfshi0KJ8tP/zjKgDlEVQU+m9rslxhdr\r\nlXGPN3VE8FtbyvE5yZN13DpXtjKsxErTFO99nN8eigSZ2ZZBIuilKp8+TFGH\r\ns5LnLT04X3KZUSQjCEVnFSYCuM43BEz3umIQWwv4DWZsuY864DcyPlvFBiWl\r\nFfXtUq24/JiKrO2gDZQqZTXYN43erge3+L7hRIyxXWEbp14dGn042wxNvkwt\r\n04fAVNEPf39oy8W1tCY7vueVF+5NCm+2+gCqxFk5ozE6p8HYJmuua3lrCYGD\r\nphe/Z5459nXR940paAUmxP21bvS7wUOfyggYffMJZss5lGamgzuBwX56l2xy\r\nuk8WTexg8dYEax+HQm0aI23k4HBu7ZP9b69zNm50L+88sDa7bOSViKnVG6TI\r\nJ9EsCbi0/9wbPHV9+UQjpbOeXaFARoCVnobZWSCtKCZSMcD9F0dgnNmt4sx2\r\nPsBjKXGlFB+34bLNkMNuvVyx87nuwr2GukYyvFjoNp2fngfQFdOofYWGwxx3\r\nw5BbAdpAP2M7qSy4mAcyDnpL8KKTjtCTaciknsCOB68v1TbmZQ0osVm/p0Hx\r\n0QGkALNHgDPr7QJj2QtYoCf89ar+Ky2yH+0=\r\n=/FyZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"606de3b21723e9c7dfcd5f7cc9ab8e4f9ce7c567","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~fix_logging"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.1-hotfix-606de3-l1518hud_1648128662107_0.5603624139773538","host":"s3://npm-registry-packages"}},"3.4.1-hotfix-313916-l152rg86":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.1-hotfix-313916-l152rg86","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.1-hotfix-313916-l152rg86","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d3b437512deccf1d15a8ef71b6917064f6ee0c53","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.1-hotfix-313916-l152rg86.tgz","fileCount":153,"integrity":"sha512-Ai+/61RRbgszy/JumUiG4ZO3zDBAPFijn7BrL4CHzVZuqrMrZHRduBzgGQhU45OEICpxGlT8qIPRJXysYM7ViA==","signatures":[{"sig":"MEQCIGJdb7M1wxmV1SjW3+WITRyxObuRUaVYmgKQcFw56NhMAiAOOwE8vuA9+CCP4eHcycyCzooigCC1UdyoaMPN+4NHSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPHyTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpDA/+L5HqQz8kSTxVnQwO64njm5NBp5nUsBsTPFjMPZu/N/JxtbdY\r\n//xStNUSMWP1nyp5z8z7nSW9mFnK9CWVuE3907FzME7snNFUKELaBOaQ/VFo\r\nLqzMQ1c5+VxGNDy7vb5ODB8f022WfBlQVvfLYcG/FMwDZzit9BcKLCad/B2d\r\nURq0YWIAaSqzyz0lB/JndCakp/ZOKnUlwRG3lEIrYAkiGbT+Pg/SF/xFA5WO\r\nWihDVZG5MNvSCjtlyXf3AAPcwW7rXCUNncwHtaq532fuTeFEnqWJaXI4K+tD\r\nwHPEqZkok3lfNNWQULL9hdHePiA+VmO7ZQKZQlDe+TOFwOBT0Z5ctYohDUHR\r\nVy7VoWUnScHeY7ldFvsTNCviJwwlLAeQf/xPbM5wwpALkJGF3gTHRthWMP4a\r\n2g+va4irOfh67D5+JIsYHZgXuWLyBsJMjYN3+ZZUK5o2GqyhRUs2yTKe4tU7\r\nPU/DTSWpUPGOFMI1TszNiPE4tBQdf1wOUw4S7vxFUj1p3KESp8tivZiwDMV0\r\nxMGKPmgzl8xJhAX/+E48jTyg4VIAu/w6CCh4BWW9fbVAdJ2m7VYa5mi873rN\r\ngkPOaLdiXvnkJ6NGh511thYHrMMeZKYRFzcoqyzDPhSxx8GAXGV9HUtNlDhZ\r\nX8ZqjaMQZwAFVJaAQkrYX2USCSLpUjw1lD4=\r\n=y8EA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"313916bfc5b95b2923173177a1b588c0189484df","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~fix_logging"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.1-hotfix-313916-l152rg86_1648131219331_0.4450665613126892","host":"s3://npm-registry-packages"}},"3.4.1-hotfix-4d6af8-l153zd2y":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.1-hotfix-4d6af8-l153zd2y","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.1-hotfix-4d6af8-l153zd2y","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"61b46ee42bee1beffa1442e4f07f2996063ce2b5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.1-hotfix-4d6af8-l153zd2y.tgz","fileCount":153,"integrity":"sha512-tksAPkxgg8PZk4Gq5ikyp4md3lBxCcCs7xWnbdHyrkW3wxs0c6H7tQRLbl4d/072am7A+DVIAqJI/iYmzoaGbQ==","signatures":[{"sig":"MEQCIC/2mWkRv3bU7yoBSCTbqsdi6zCBoaF+W1zwZRm5PmH1AiAz5iJaF52HzHNLXe4n0JCxYN1x0+vj0xIe9RP3AaWbrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPISXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrp6w/+MuiVlw6zzaf14EN+4s1hCHMb/ghkw51qUk4Ub6/R/XKH46s5\r\n34nGRyVlG7z+mTcXEer9nZtT2Xf2qD+I7xl5qF9gzm/xMmq9BZnLd5nyrHWL\r\npErQDAZMdFpMID4s2F0Us/pSjpBjuAsOUL7XUM5o+zPY0BgqURZoqGWzfeLr\r\n+KPDyhWYWrb9wKCZlUOO/fr9UrZqjIfwpJUqenXysALrkBNYYhc40MU1wayz\r\ng59Tc8fznTGPoq8+Re7ka0j7ZBZLl/66LVvhRVeIqx93esOCC8xi6JWz8wN0\r\nm5RvIlqku+oo+hfO0jGlyKORepZxp7KtI4ZarTNScTa+5RR/zxOsObDmXV7j\r\n46mzzz0poyEV0SCi/ZTZ9BJuZbSZzbYOLRC03nhd1mOEEHNBfIKd+VTpM4Ht\r\n6Apc3uO/+qJ71TKhRye2FJFnwjcBHGqmxU0yFemYsQK+ewod/o90HLWQkH0l\r\nG7WIPIVKAyGED1QKE8JGlQVIGuqwb903ixnx03wVoC9acPlkZu1J6Mg/XNlN\r\n+y3PmS/5aQwjYauBwkQvGzQluzcsYFt2Yk01HG++AtPnPoT1z6VPWG8O2F/a\r\nHKZkMkJ+06po+5LrWSqieMOF6SXzHeRnwsSe2US6DQ+PvCik30T8TYbG7gVI\r\nP7UNMbRzDkiDQdb7ZmqSr4AL6Lz2pLgE5UE=\r\n=+e70\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4d6af86bdef8b549b9e4511dafcbaa1e4a9e5610","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.1-hotfix-4d6af8-l153zd2y_1648133271519_0.5227961139855415","host":"s3://npm-registry-packages"}},"3.4.1-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.1-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.1-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dc7879dafcfc0c87b8488e9845b39f8da13ac053","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.1-beta.1.tgz","fileCount":153,"integrity":"sha512-iK6pC5BJR5TfA7gdOkBbK7y+qGiR9U2Nl2r8zmdiMC4FZZ1hhikDobaTaeQEJ+Hv7YURgvQZ5hnTjsS728H8LA==","signatures":[{"sig":"MEUCIQDh0YICYXQE+EVg5gWI42OuQk7DY++zuuX6DnCGosbBtAIgCabej2ySHPpMESnVluGJWivsjpZuvFLJYCyHUm5AcNU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPIS6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotJA//VjvGu+DUlD/AmA+jreswXhIte5TKnjPm0VBSJYXJmFf7PUrU\r\nYidW+IE/jO0voH/RYws7pqfVEiRG3pXLpTLsP42VK2geBIcgP2b1iJXftSsx\r\nP7s0blWlNumu+JCK6HFm5jN3NilfSL32xuJVMJluTIYTHL3qXgG7FEoeEQIa\r\ndaBoYZz6VDF1vwDCbNBQCnhTLsyj6lMfdYB1V3G/09CcHeJo24OYQsK4SDjk\r\nItFLwNSxaGb/LULObuldbY5km5vwWYrZqNDwslUSD962HkY/wjZ9gVAYcoWU\r\n+FybeFXouYND5SLhxJ+pDooW1nZ+sS8AhfEKk5BfZu11XbpWIl0UvRTpyPPS\r\niYZxa3MV3gRMDNupmK/Gf5McJ5OzV0MMwxBhCX/Z7qGW7lRTays2daTKRHWK\r\nZX1gYTT9bg8JVv+A0Uj4QfwW1OOsVAxE+M9edNurI2oEqcnXpVEFmFKYg4rH\r\nXucf/69TSlOaRJD5yD07A9XMcew0d9PnrJ1F9OA0/8n5zPz+roK4BSTKRy5f\r\nmHzrH/r9OjjyvhFS96IneLgdrSv2qc7e5yBtfooO26/oGRwR+WCM/DK7sO4E\r\nOOtZ43MMIcPJUVBGH0aDuaM9mT0sfbLND0KWGm+8C6pl8XNtbklzq/YEGFXz\r\nOnO2/TptWfw1ChNU8T8wqFTSaTV11ewF5r8=\r\n=8ESr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d41704f9c391939dc12b00ea73fad081399f937b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.1-beta.1_1648133306234_0.11105880701499271","host":"s3://npm-registry-packages"}},"3.4.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64952d500daa9769f3096d50f9c147431ca6019b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.1.tgz","fileCount":153,"integrity":"sha512-+IY3G8t3DbaT1nHBiyOEWv+Nu6mFekmjrsn3+rDrU5oKPh5jxdjsScpgawf0Kniypn0fWRVz851Pn2tx9RVXOw==","signatures":[{"sig":"MEYCIQDhYAcGypX2EulTKS/aqsfmn7Ia3/pKETSJg7+oyueh8wIhAJgPXuy+J0LgMSVFB9kZs2p+6dIJVd5AQCLM8r6xKQm9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPIXuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrasA//RZ1JtKys99fglpAk8VZAVPMDQTTydlOdhr34duWJXSe25Tw1\r\nvqf2Z95HsHRiyCrbxwuqdkzHG0Px7T9KbKgGxSZ2ry/HwaTRXOUqJCfEVfIw\r\nw+TmIC3Mubyz8tUUe5EjgGRQvf4Ox5QSYpqz8OnSn0BuUzQ775naeTwhdS3A\r\neQgkPUbcSxzpU81yn3rw1axUiEKVg65EEQTFNc+wbkOci7ujxaBIbR3Vb57R\r\nd9O1EXNaggw2lrnMuhgc9SUZj3zZLKPkPNq5XZo9UhT/nbDYuMQ4yQ+P0vsX\r\n6mhn2k/DYYURrQ7Kznh+SVPZRpCKeY20DmdqOs2WD4M5Nfu8cBhyfJA4EHn7\r\nxPMru9PMZuTu0P4i6W3wUf9k8RSUWLmnrIW3dqtMzTftM3cqSi4nPPGQXRqF\r\ndlrTmr0Vy82Y9MXJWxahzkWZc3OkDTMEyugUvdxw9XudYk1XA+NTtKbkkigs\r\nzmO9CIw3tvnE5SMCRicQyBW7ht24R/l2DHqRgPJtdI/rIisBfoRUkmB9py+m\r\nTfXitSnXYRFJojNARxZDh3ilEJc2z74QSf0DVmB9UTgDmIZvuD0yf9vjc+i8\r\nvlwYzE2iVojFZnF3NiV6XUlsaz3t58ZoA/p7hNtvXxO5grYtgQEA+tGdfuv4\r\nZKCYRv3pCP/BfcMjSkHjCplo8SeV/Sq3B7A=\r\n=U6Ds\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"b1184f729e387fbcc9b214fc7771064b5720bb8a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.1_1648133614737_0.040088423743759316","host":"s3://npm-registry-packages"}},"3.4.2-feature-84c975-l168vrqb":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-84c975-l168vrqb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-84c975-l168vrqb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8e7d03db7eda2741213a8ccc927c9eec268546d0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-84c975-l168vrqb.tgz","fileCount":153,"integrity":"sha512-u9EEamm47GOnsS8BNS13HDde4SMSs8Q9PHXh2KxvIYyp0iJ/PaLbCRsdNO/1hCJtbp6yMgqoxMag0Mh+iRTifg==","signatures":[{"sig":"MEQCIHAj2ngGLTUZMX2Iqd1vJywTvNB/J+LYo2d5Efj9iSnYAiBjfzTTld/4Jc8hIm1hIL040T+QC+cpnOLPuebXqxGv2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPZDxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJaRAAgTNYnnoas7GY0mcacmJDSdmiQH+E3g90FRQwzLEQ+FVkyUmk\r\nWbqInlaNAsLxq8a5QEeH4+0EmRKhfX7y7hKtksFRCYPQM77bFV6U9xUFRHSU\r\nthHhUcHXCYs8hLp9athwgRhg6th87DmL0n3roYfAB690a1CJYthrGfUG/gje\r\ndXR9a/Iq6r90M/qqbhwdAGOD7TYuiHPjQMCZZMe39lvfH8Sp8KSgi6dOfi1Q\r\nbnpozpQBw8MM6KJYcTb4T1FIcAUV57P9ogO/cO85XQWrezpwRU/LwjZmf8xa\r\nyLRHEuGf6ltmmAP4VfU7a6qztzwXHN5DfiDsUZ9c8MUHz4CTXIVBU6Snx/H2\r\nLUFT31c8NdCzyuy99pKAzkniOwVajz5gL8xm6Hqj31ubeKgFsK5DbaBhUpNM\r\njk08Vq3w+dzHEurVEtsDzSwPbmUda+hb8rTEtLGro36h59WwQNXpt860m2bu\r\nEZfz0wSwZurLVDq27CgyZmdKnbQ2hNLyoRitxLDggRVgjOFPJ3NqPhKgYQEg\r\nyYmFyiv7f+y4sCe1ERzARV9WBrhB5LgTa51XnC5ZC+y9VygHuwPYxjmERRh8\r\nJlofSHwKsEPzUh+3f/Qi+9i2PJNKoAdfu2rthIv6Wg55AISpy9WYcw+jn/fY\r\naSluWlLM0Ur19P6jtPgYvGJGBamDebxrdGs=\r\n=N3tT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"84c97524f429f36f37a09a82fb86517a667662ca","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_hostname_to_logger_metadata"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-84c975-l168vrqb_1648201969246_0.6405218038599139","host":"s3://npm-registry-packages"}},"3.4.2-feature-463b10-l169y9tg":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-463b10-l169y9tg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-463b10-l169y9tg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b295b3aeeea6cb11bc069718d51f6591f025b9db","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-463b10-l169y9tg.tgz","fileCount":153,"integrity":"sha512-uMLI8E84C5R+kqCkoGjecJNCL+ZYGPyOjGfqfKI2+skkS/WCrBez1eLJrlFwiwcId2Be4ajeYKZgr/Yt+Ybm8w==","signatures":[{"sig":"MEUCIQCHtw2GEHPaAXPLgZxGe87WrlCxGSi5VPnWDXY4Q3ifUgIgEZ7ilmb8RdOEnhK4p9vqlWm7luG61ou0Qywfb8/Oeco=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPZfxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9ag//ciUXGYzg5dukuu44rGMgMwPr5Xx0qc8003MgtCRqK3bpn1dr\r\nesL2OpMXzbcGqwWwywtzyEKIqfUR/F+OTTTiOw9RXsmKHUdx9AU6e4Yt4X2i\r\nUiv0SbHze7ceyzdzJqwM0//NOU5QrMtI8/ubEdvQO6orUKw4FP2U1AgtpEjW\r\noI6bjamB/lfE/0b+cUvqYI7j557YbAJE79s4an4sZKKzNJjolvlPbIaBFJqS\r\nRwBEoVMog3YVnP9VlpI9SirIPZ6UwLRDd85CrK4rPPO6wpaTEGsun4VfBnU5\r\nv0Y8SpvkzkW382VuPdGAC5H3KO3NZ/WeOw5jnqkPgJRJmsBjn6zzGNFQkOqZ\r\nmoPdhAhsDFnzewncF4mGxmjktSRhgJyX7PEyr1sOfs437G3m+uOmbjLtPHci\r\ng3RNPlFn7COBEqvJUD/vipR7apIU4/+Q5qqpLwTLcwMxxbCfo0si6wE/tK3+\r\nhsbomPfo3zTQZUuBpL5qldTfrNcrX4cFI/KH9+2CoFPoybjbn2aMkpv6U+85\r\nq0qiJyl8IsLa4O55bzTcEu48Bz8eNml1ox6o3eYaWVi4neM5yqVtxiEG30Nu\r\nO7dYy1b8/Lt5VTAtcUFMlIvJdk1YbGCX91vfAbAE7GKV7vcWgqBjqiweQgQt\r\nugRoGtcI/3x2Ys5HvPryGDUn2nlGsg+sIiI=\r\n=bHjW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"463b10775aaa01b0418e50b529f640c4af1aabd9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-463b10-l169y9tg_1648203761363_0.9855140653820658","host":"s3://npm-registry-packages"}},"3.4.2-feature-fd4a3a-l169za52":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-fd4a3a-l169za52","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-fd4a3a-l169za52","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2666b79231f5f59dbab7287b5c6ec30ac129b6d2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-fd4a3a-l169za52.tgz","fileCount":153,"integrity":"sha512-RAYIOY9+hVrfCGSppjvtk80EjM1RR/LyI6a66s7r5oK9FGo9YQIXwVHPFJxK9z0O7yIt5IpAtztE8rmjRBsu1w==","signatures":[{"sig":"MEYCIQDBKER1jPi0NpsSHAD1jX84YvEMSbQZQDL46QCE4TCwsAIhAKmnftpZIyARXRQ/f6M3N9tG+K3tcrA5UmfzKfkfmhOF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPZgjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBWA/9F6wPVPoqqHb860zO5Ge1ftO1cOA9e6/IMbNmmf8Er/l5STXf\r\nRK+19bnlbAGqI3liRDZ6xnQCpXZxXk6mY/0tjbZtB1saxxPUUcBA0tm7JYDb\r\nfEKEYkNdCx8FG3m/i5PDTA+KppEjFotk7IbbSTR4FmfaOhYsidI00oFh5mSz\r\nm1EXyOhBL5tieBSALD+c5Z6KEEuIyZ4zoOgLAc16FEU0wo9dPUCXU8/8tNVB\r\nQhxUge40psgPi+QuFu+Czyb2vglWoWNbYZvDZeVZsLByRgYN9xTfxk9Oshy2\r\nRX3NQFtMKJ5BA8K4eNB8KOo0Ifcy5hRoP8rH9zs4BxUxWxkiePntlotQr03W\r\nai8jB00Yy3NnVOUVtzS3axf9ZA1mhTSkdgO137d+CWo9ApTdSh/zhn9nSHzd\r\ncLymWZIPrdbgm9dmvSF4iP2B8mZrzx+0WHnHAQMqGhs8RgrMYvNqT7PTHjUr\r\n7+wEJPmSFUetZvlIeoOy83oH6fWg84nL0meItPkz3oXwWlccpj/A43v4ssJn\r\nmboJ0QeDUMFIX/TVplF9rbiYpmBH3hSGhwY+be2rJsAjK/19vjBwFR5OB1H4\r\nwC6Cjlw6zoT2NSmYoWqmtGUFemldWO+6Wum70+SShKa0P+elHtR3y+oI6Y5l\r\n8rfYtttLn5lo2GW13ZJpUWkgV03JUmJDpdI=\r\n=a9Qo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fd4a3a6a0d22a150ce883d5539b4e78f16799f9b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-fd4a3a-l169za52_1648203811231_0.006789534104270745","host":"s3://npm-registry-packages"}},"3.4.2-feature-759af3-l16a0omh":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-759af3-l16a0omh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-759af3-l16a0omh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2436550fd7e186daf4646bb668a1d91da2c2b078","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-759af3-l16a0omh.tgz","fileCount":153,"integrity":"sha512-umHBctXHXHFXxJwqLCxsBWPp+IJk545YDFNh02NZDf0hjEylcL95vDriA8EOpWwpyjneQcnWzd1vzu28hAJ+dA==","signatures":[{"sig":"MEUCIEr+gyDGVfJsjg127Uj0JTZcv2A1n0tITlwGSQevKFVkAiEAmjkcNOA+dTEzUDihHZgUZFeCAojXf9emn/JdQ/FIw4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPZhlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0exAAoy5YJE0RKKEzre8T/r+SvBnPcCU25tXVxUfB4teG/mHVOG2h\r\nfus3aPFTt7JmrKrBecfMIHYL7Vf8qkyNvNcS5qvVPb4S8i5qqMBF9l4W5Wy6\r\nhHnb4a9WGOiyPSXKp+aePlbOBj50lDYsVhKG/3n4BlztI2BmFtOAF1a5/ye4\r\npNSk38YE2E5/v1CDCgQ5QE+xa7h/XQHjbxhZXz2W3KDrO8deQTD1vLWHKqYc\r\n2GLjk9DTy9WPp2CVISwA9tApq+a0Cy11TeYgDfFq4UESHJ5CNRQ4Z5dlqO5g\r\nXlZGbFJfQjlAkM8w7/mjhCeRZ1sQjtC3jsunMC6qv013c9l1HWXK8KPn92Ab\r\niM0RJngDTKsueLo0jG2dqW6GMfVP8RKIiSk/xBwxdu4ry91cZL8k/BbeVhx7\r\n6Z4OBFdXxYBqL7Sq8a2aPpAClepfTmd7hIwd1AD8Zo4K+NTc16DgudwUhZum\r\n0BaA9lAgUre/ULxMSXir4g+LJK2+asqZTFPKZmxhuwkGqzl0GmPKftpgTIAs\r\nFhasddcpq7qTRqqAvm9LHz9GbiTq+LapsDBcTW8GOUDh6EGb/Gn4ZcEIal5O\r\nqXaUD2rMClmF6aSravy+OCnzSBRCo7HTFFjqUdjhezKLou20SFVso8FAdI7K\r\nt26v7nkrUImvxNRcqIuLs2NqpZC2nCh+f4I=\r\n=5dgu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"759af39e8be4c91a19447491c7af1961caa9e641","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-759af3-l16a0omh_1648203877618_0.1871302734253657","host":"s3://npm-registry-packages"}},"3.4.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8e72f3dfc064685c0b64430c7d7a1cf024e0aead","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2.tgz","fileCount":153,"integrity":"sha512-W6RgHmfYu9VfXwxXlQOTdjYILZ61Pt3c5cfDrjudQb04z7B7xufdDilsjxQXRPNaJmHqY7BHx6v2vvrvOkXmAg==","signatures":[{"sig":"MEUCIFujLXL8TIchskaDUbLTd8zfHxLK1k7h8lLoXzChZ0VjAiEA/L1Qvx9UV8B7SlaTuRzXMvJ+NFwb2a2UuwiQU6AEQBw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPZjgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEQQ/+Mu/qTeJ2wJ1KQFgBse5CuaPmcloWTpvqFBg9UuitImsC1I0R\r\ni4svuuuOkFMVZJ7mbfQHK8nIFEEpmaSM0tdWuam3d5NcYJPTnFY+jhiOJImy\r\ng4T9JLCG+Sp8eB7JXVoxJWAGt7v29/byHlArQgOC3nTPTXikqidcwlhyuspf\r\nmPL87E0UeVqWaptknMOukpreugf7+17LqA1oOBN3PZ8XC8PCMnk8/XwqO2sq\r\n20xXtcDEVoD0wXq5bw82kweSJ4WTTxJG+ba0V4WFbEn0LqCkXSR4uWGr0tSX\r\noLFtu2rxMe0lvcL0EmYkBhf/dJnTlwPDPzo4FmU5UUaUQuu+3hmdSs7McJxt\r\nt+V3+u8qfN8rTVY/RdlypTPHy1uX2AUXoqIKuAdMkMsCtR5hWm+D7XiT0T5Y\r\nrH4S9b6FBx0Q58A4MZ857grNZ0fYsmNKygrlspCtpp6spXiY51+EL7Ic8B0s\r\nrdlV+i8ndei34T0dKv8rMVmadeoxJT2TxbnTorJbmVtTP2OD9hMYsKDoT78k\r\nU05SZhTZf56vlcOlUBFr2oDGec9rIkfoilqyXaH3mKsM5G4fINnzfpcxqmz9\r\nO862AXHu0b0nLQ1of6zbvqgYe+qVk/Kb0t5JFh8YEpad1wc7S+ztAqhl9eGX\r\ndGfz0R1j7Ak5mEGIEtshPST7A/aAsQ7zrdc=\r\n=tBzO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"7ec6ad66a369be335b1272677d90acbd4a1f65df","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2_1648204000257_0.7071602000333574","host":"s3://npm-registry-packages"}},"3.4.0-feature-e1ff35-l1ahxwa5":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.0-feature-e1ff35-l1ahxwa5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.0-feature-e1ff35-l1ahxwa5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64c25b41abd165c2ae2cb4285345a57dae9565b7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.0-feature-e1ff35-l1ahxwa5.tgz","fileCount":153,"integrity":"sha512-Wvsx3ez8/7lsFLJus4KBm4OebzX4e4jRz3WMrxQaq8lBKcxcy0VCxqW1/CiGi7Wv0ZNJryx/4QK8v6Wl9O/jHA==","signatures":[{"sig":"MEUCIH7wRZhRhD/AbG4DbCP6WYKV3Bfvn2XGDFtWyQGvT40iAiEAgvLuf47FazFezDNLBDZCUhcUhOojft3Qf36pxgjm6Cg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQX0kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrupA//f8Uwok9PLcr+FEY8dlr3iprz0rv7RbgY6TAxjyyOT3Z6Si6i\r\ndD+QqiAbxN9lEFbGSe0UiEXF7gt1gpIKN/p1XsJjp8ZblZFlTuOzy/s9ECNO\r\nBtSxTbkDx/h+z0iMPa+O2RqL1zmKEWJw/r4J5JnYciR/wC/H5TlzY/JiJt0s\r\nLydr9DtnrEoxg745cBrvIGUn0oxz2FASV0bXqy0yxe5Fq9GEgToaIKIlgff0\r\nV44XoxwcKNJPyatLBD6LhhcIL4MnRxKTb+eeujnWIqdxR8ELEP+1z+Agj3vC\r\ndxexseI3aodEICdN66Nx6ebsfr6rDgDOvOVljERVammbOeZJR99cGoI75qIQ\r\nlXaJegvRKxI/Wpa7RHGRvzYTHHiUjVU0pDSUFpqnoZu3vB5k2tZqpp1Jc69D\r\ngG5CcCsresQzmp4mUINoNaoSlBwnS/F81fA52k/UId7TYCc0NILSIxRDqfKn\r\n00ZBDwkLxrx7X6dCKeLTXqBrUvvt7jRBZBnQBSABjKiEB2S2KuN2X0qgiXdm\r\nwnYBDktUygmoONPWbsBNvTSZ60I0s4lm5JlOzDbNAEk7vLfOOrUlmjSfG+Y/\r\noNWz00JhATuXF8VQ3Ay9c39nWABDX04zEu9AIDmdAtj3cTnrisKB809WSfJJ\r\nKByN2W9SttqxlC49fowLhZ+f7MpJEtZ1PPk=\r\n=+KkH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e1ff35b59984c3fab6392e04bcd59ebda983c1c7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.0-feature-e1ff35-l1ahxwa5_1648459044127_0.4275465666759837","host":"s3://npm-registry-packages"}},"3.4.2-feature-dbdf2b-l1asf7o2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-dbdf2b-l1asf7o2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-dbdf2b-l1asf7o2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"312c025c8418f7f6e2a9ff2e84516ee642177c6d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-dbdf2b-l1asf7o2.tgz","fileCount":153,"integrity":"sha512-ACSMmawWrdUWlrSVRdFJoGvHFx8B7XDIaW9RcSdin9jpvNGq44tyd9KYnKQbM3rWpp4N/lqVGYoQzA6lwLDz5g==","signatures":[{"sig":"MEQCIF6J+INnWmJOk15ahLZKvGytNr9mPqrU9qc+aXaHbQCtAiBHlZQdD+9uz5JrHJ4RVKwyaEmt1apEbcZ/jzcYDwRDhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQcHuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPtA/8DNTYrMGw5oDjr/MjflszKl6idcoAzGm5QyhRoG68GCKWRsf0\r\nl3bgQjrccykBFZo9xFR42wcy48cYspEjwPnUeBfXbv5Irvw3wnk8a5amLaT/\r\n1otAN8N+j1G3eVnlFGy7c7cjCeUEWZ8k5CpqXXQXu0lsb9Ix6/8pM3iqDuaV\r\nCqClqKwc94sP63y+XhLkCOylE1IDXBBpaBYsBYQsU9rr+I630uzLB63DV1l+\r\nECrFdUNmesg9LGOBrXHVSiH/x2KOQZnPDPiOnT3O8cvvqpUfR3Z3vtdFokiz\r\nfvCp0smPScgGh+54v8tbQCCQcvv6UCphUsW+c5u3eydFn0/1E9LnKjk9BYh3\r\n74dm1FhlT0gvXAAeXzb9r8Cvf4Yi5LFZrkxVL0tI1Q7crqWol/1o/GycQvt7\r\niYjeU3xVqf9/Cp4xo48XpkrCqI48hxLVw++Dym5kU3INvf2tCxarQd0x8gSu\r\nxZTH4huVMfrzhmHlqG55c3z1jrXaMq8YJrj2m2ejy0qlRBZkM6ugDcek8aYI\r\nlcpmhvX8mAjP7aKYgHTmsxF7PTQ7m6vyNPUi5+MwR+jMgvSbyhrn2avrj1PT\r\nXvou80p3ncFFAJ1l9Wo91fCEnu3epW3Y2ApouAUZxUkptX1PD1ot13MhKGot\r\ne78oVj9MloTNQ09BMVgbLjyc+6s28yTn0J4=\r\n=G7Xf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dbdf2bf6f70a1685e21abbf057d3e9a683993a5c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-dbdf2b-l1asf7o2_1648476654101_0.12137813418569876","host":"s3://npm-registry-packages"}},"3.4.2-feature-869d08-l1c2vk2w":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-869d08-l1c2vk2w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-869d08-l1c2vk2w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8e440eafc5ba2f3064ca485a97ef6f6ec4eafcd7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-869d08-l1c2vk2w.tgz","fileCount":153,"integrity":"sha512-I88DcvmjIxKmkerYVBLDThG9yaSARIbFdpNBaWzlsMc96jkxP4v6W4k616uoNWoGlJpn2wXiSHbJXFpLGcnNBQ==","signatures":[{"sig":"MEUCIQDBQW1i7cjk1MZ1qgnFaSy61kESUr9LgASbIQ9g0+73FgIgMX22Q+IXWInhhRMXY4AFtGrZNx8YnGnsg+XgCbFQnII=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":473799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQvK2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqi7g/+IaICx7Zxs/zn8prx/QEsoMJasVo36dhYoFzFih2fLuIjmT+T\r\nalPRA0AaqJZ8vpfbqrYT3Sd+7WF1aRBq6VeI5/uN//j3WpihPhdTDG6FTfY3\r\nSlzYigEM9ZKLjKk8POMf4F2h84rzYg8S78lPBpoPm/tNUYI1g4tMcw9uA7TG\r\nK75WEcGNRSmbFAA/u/OQowaOXdotU1Fw+JxwmenM0IY7NGm2tLViM9YlzZCF\r\nsmU9LTloGGH2IfwJf2TYrI13EgrLfnKPoT6Hu8ioKKGyQJNLXWEsEV3FhAqd\r\nf9GPK7Vq/Qc/FPhtiMsSdRtbi7jka8C/ZR4z4/9626A6kBUuvsF/XMY4T9uf\r\nAkzGuMukCHoE8019ZBlSx8khhQOnAuoO/SyHYtjICVvf7Fnza6V1W6GmrPim\r\nry4B16Zvj6jnk4PLaHR22rbXvKZtgjfraQZPnRd4L8+Fw3KM+/zSd0I3yD4+\r\nY091IxDJMct+n4rAIxJTJDtY3Ggxw3bIfH1nSQ8wvSMay2eK2DS4A4himZnE\r\n/NSFX5A7rIW2oZ/jZ/MwZWZpW4K2caU9AlD1iacfQLj97554cYaE7sSpCmFA\r\nYjm3MNi8tV0/3pCza7jJIvSBGZ6ixZK2BUzIG6y7C+bDENJR930OVNou434I\r\nrIkshYEjU6jQdFUI6hVUGgv4Io2nQplEiLk=\r\n=+bK4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"869d08ac296989565057865d54235e0b16c48b92","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-869d08-l1c2vk2w_1648554678633_0.6665724266995503","host":"s3://npm-registry-packages"}},"3.4.2-feature-0d505e-l1dako7j":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-0d505e-l1dako7j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-0d505e-l1dako7j","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"316c89426535812c3cf6b7a8d09450d117bd5ed7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-0d505e-l1dako7j.tgz","fileCount":153,"integrity":"sha512-s7o+krO7EQe65ozngARbdVR1w/7RXcxlSGEzKI6jf+UEoiAffMkIZkk1dW4hyDTuqqBHm0tofeH7LktiWElnLg==","signatures":[{"sig":"MEQCIHWHI8hYTGZxMEaVThwZBkPWAeDqaptNf/AQxbUUT4YYAiASbpPVN7UIxxFZ4VvDRB023kg1CboPVzeVsz8k9lxU/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRBFwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqycA//YCqnLb3ZmGJ8oWyDeoZGrTzv0cL6lUGnIVCpsICeYyGtGfv3\r\n+OkqcWzV7pHOTrrkiG2jgnjT5zRx59cqkMQWR28rp8EyZ86yWae+wITz/HYE\r\nVhHcAMsxHsDyhDLYBA0J6NCJh2QtjvvPhbO8K1zdTAmmKSZtwI/MA5N4prFI\r\n6QsI4GdGYbwO/3eZpf7Op/eESoRe/Rnbe+t0t/eEMhtWVL7mHbaAavVao6Sr\r\nCJxiJuJawmpcaP+wKySiYIMZiWl4oBY2y5e6KmWYX75JBR18GWKddXelPqB/\r\nRQ0Rzu+CVELWSoGRhK0EiF0APJ87unXy3lBl6v3z94Xy2ESvqczcD4l1PsL9\r\ncG47QAsIFmwLPvANxvqbv1ss9kPaCMbjbi2HdXl/3ffUxh3mOc6ql39GeuLe\r\nOAatUv/9+qZAtifVdfbkrFmOJWU4t0ukY9+FKpm4dNZfLK35DtAVit+6DvId\r\n/CWm22ivnwBsP1W3OtlQE1UglF3nuUZkH48RILoOgagKy3B0SkopgjheU3aP\r\n51Hye61Ynjmi48uWc5W0538yAcCxaDj0p6143ZN2td7NSRLYwDFgjhyHK1gA\r\nBEAhhQUhQAu9pMi8Tozh7bq0KxY9DsxSCuXxoiEnWUTck7T+Ro3iQ1gQnkXo\r\nSdLzkFCmIomsIv6g1miTrFZ7MBYfo9V7cr0=\r\n=hfv9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0d505e1a42eb288540724434a5b2e3459da1e383","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.3.1","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-0d505e-l1dako7j_1648628079840_0.610794720940735","host":"s3://npm-registry-packages"}},"3.4.2-feature-479635-l1uga57e":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-479635-l1uga57e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-479635-l1uga57e","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2c9a3cfdd165c96580eb3ba4722f6a867c47c4ed","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-479635-l1uga57e.tgz","fileCount":153,"integrity":"sha512-nBJQ0A8zHxWvPOYAmg8WBHHNwa6nFfeid9ruKTc6LlPg+fxDlJ8SDhCyC9gy4iCh0KQksjic/inVYXMRTM1qvQ==","signatures":[{"sig":"MEUCIQCfVtXwsMsqs/N9iyfNfTq4srozOzMgpRU7eMjygo36tgIgE67xTKqqQYRdoUCe35X1IiARD39Aqki4jD82qORY0Rc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiU+Y0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvNg//XZVHP4yXNVgjTVlb/VLI9QvYvqSoghHFHjsfc3Wk1FTI8o8V\r\nx9g+nk2A7s7HJL+sVLyDE8OmwFt3herRtQPpSbsv6vo0vF8mFtn3KepReVia\r\nWeOD18qaTUSCNED9mnIPGcQcQ/A40f5Xk4nFGZfSPCItnBgxOjo/KOvGJubr\r\netTVYS/EmTHV1CSUG9LcMYzvAQbq6sr3VnCUDkSkgvpnPuCi6ecygqB76AOO\r\n2yyNo+BJnpT/LL5B/01qoavUtAf3uv424yt7HpOjr+EVc3eziKJ3iC+m26bW\r\nkgSXXyPhQUssZ6Fb+EfCoK9Z5oT7/QCzbrTU9YVz28bnKk6gA5YJTcLWJTAz\r\nPUqbEhd8dm/f6YJ0Cm5nNWjMUI3CmqY1G6fmXQ/3S/NHD0PBEQcGEKaFclmd\r\nbKRRuo3IF8NxPUp2BWdR4GySI/3r9mCEo0dEvY5gBEliyZPrlNNMF7IdgfoQ\r\nsIWEpRAGxAeN2sc8Px+99b9nVCnTjIrKuAjcUbrf0pXAiinJ0lMun89PRwH0\r\npaCg3FvIJox7dXn+UMfmlh1VB9P8RsyeuHnB8nSe0/NROgCAq8OXwfWU6Roy\r\nkYAxpRA47uJkmt4zn8VLNKtSYg3DUCyf4IfyhEQdbihsOa31FMDZmXCCo6D6\r\nQbG2Dc/rtzL8QuONAYombh+ZtdYL/yLSLYI=\r\n=lZ3+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"479635455861ccade1138acdecb777d6ce88af9d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-479635-l1uga57e_1649665588514_0.9727701884808202","host":"s3://npm-registry-packages"}},"3.4.2-feature-9262f1-l2egfjp3":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-9262f1-l2egfjp3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-9262f1-l2egfjp3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4b677f86fb7a3a34fc908fe3eab2f17d3b372bef","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-9262f1-l2egfjp3.tgz","fileCount":153,"integrity":"sha512-nVb30Hr7uHbfQfwo+kdnqDX+2H17uG2I9W7Ilz7++MgqD7pYoQhbq2XxYTxs70tGQi01gY1uL9ExM9KK81v+Lw==","signatures":[{"sig":"MEQCICnHzjqJYOHHGuJou8plxgRRdjT9JVK4EbD/V9t3EzUpAiBfQjpQw9zMHQa48cDiWjawar6ZfrfAMsbfHMz32UveTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZlsYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqhdg/9GoaCBAzV+zzSQhYQa+NEyRRI9QKg7MzwKKLT4g9wStK3I5TM\r\ntSNsv1WBEo5MLJs3tqPvtmlw2yPAyqqPreo1pQyW1qbZ6SI5b0XnxSlKle2V\r\n6ZG7r+mSt/2jeWa5iqn43OM49//06WO0JSl0EI9pB0gr4hsUBOMF+ABvnO+E\r\nhWkkSqDl4SLat5AfIJgy3QplWSQS0S/z4kbfpWNI59eozFTSOrzToi6Njc31\r\nnEXU139nIFGk6plT0BnrU9k3pp7Iyb4Cfdx6/7VIIJxWa7rfAB8e+1iToXvQ\r\ngiXlGwCkaOJCJZK1dgzLUjlIqvpPExu8fYRnRHvsAj32vDKAkwMiU14Y1diC\r\n2i//0eBLyi27X6owtCDNxqL6PPvWaa6nZltvyDMlbfNzchnV8PxiPglGIZHf\r\nlRNzQGqySjHm784NeUoZNQYMvbyWCBVcm+ZHGKanVgXhezJWD+1N6NLOalUU\r\nkNhqyvIYc+Ef0nTMzAdRvPUfS3FOJjj4bvJiwYfxIlhopVEzwS5/0bYT70tO\r\ne1Sq6bd8pdSiDtsy6I+CANoBnZbaTT7Vxa1S1lqoAeXtg0xKsB3Hwa4+2126\r\n+Z3Qat3AgI+cuABNb5uhYdo39N/qGWsOj88c5HBcDY4UxGhZXYhvukOnxwSQ\r\nUMwTysIzejjnFI58kSskDelKsANQ+UugkcA=\r\n=gtx3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9262f123fa6b1603e6a8cc3db0b11125dc8c5ebd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.14.2","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-9262f1-l2egfjp3_1650875160528_0.1588435328597002","host":"s3://npm-registry-packages"}},"3.4.2-feature-6ec1f6-l306dr9g":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-6ec1f6-l306dr9g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-6ec1f6-l306dr9g","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5eb9016d71d678beed17b8bc7669f2f0586bd6ea","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-6ec1f6-l306dr9g.tgz","fileCount":153,"integrity":"sha512-Qb+bxRctpDTHJEkgxRU6xMmzdS32ylCrIUiUudYsOVFFQLFEmO7D3m5W7XnikX8QhWOOpoLvHb+PEk0C56pewQ==","signatures":[{"sig":"MEUCICPPkP+1+4878+kRaxViopo5u9/j6ALnkeaTvYRm0REfAiEAl/sPKjl0vVtWNWm4BwXZE5RiUYMTH0AnP5kMkaHBkJ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiemV1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCIw/9HxSqgbkwn0ms2hzFNq6M5uniaSLJg/MumZNs2GJcJIMKLOzF\r\nBY4Bx5QN31Rcp3MBgzT278Fc7z4iK1OdP8+HeLic6PvxuEtwsZIdvPevCKZs\r\nHr9D+POeCuNHLys+sdLShnLST6CXddunPBmZxowy134WYWLt6ZknczUzbnHH\r\nGy89RVTE3BoQTiEjzYDhJQKSENQCUhXlYmmEqK90/xRtSI7WRFjLQpxr3VmT\r\nMRcDHuJuUWePQLrnbCWRppLDFIjIUOAe88YiKxLvQAQdmb/QIA2vYLy9ggv2\r\nxfyixeCh9ig+HmU98Y7Fw8y59yZ8RvMuJK+hR5HjTWCO2aqGCrkB6sQ8HwlB\r\nsjTXdICCds9i4p0PSY0rluD/YrkXbSzIAnxiDWWfL7d9aKC2c25zK1OUt5Un\r\nUlLu3rhWQJmT0RVhku0gN8l/tuOU6PFHiE4DMc4KLGCP5RnJlUb5wyXsmrGV\r\n8dCKJdAcsHlg+B8o/XF6KjuwmzaJ4mKzNqpidj3JtFukC9jpyAd6ud6LBlmF\r\ndVB0hcg0jynIi4K5yjMQJk+t3G/IKLwoiobDc1WZrsbckbU5hgCALwFkyB+I\r\ncwphAW06aP8BZ/0sKHNs6KEJ1sYcDcmVWXgsqAzLPrPB9tF/7dHgSbo+d+JQ\r\nsxpW34T7mW8nPYWMQjfK/sTFd0YRFXfS3hA=\r\n=2Cyk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6ec1f62181cb0a66d83a8494697c23e18dafb958","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2-feature-bbb9b8-l305d0oy"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-6ec1f6-l306dr9g_1652188532735_0.07397256098755634","host":"s3://npm-registry-packages"}},"4.0.0-feature-616cba-l3bg5bph":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-616cba-l3bg5bph","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-616cba-l3bg5bph","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6a420ade3ac611c3f8338e5830062868f3d19a57","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-616cba-l3bg5bph.tgz","fileCount":153,"integrity":"sha512-SWLWV/FGUX8zkAQO+nHFi611CA/p0Hrt7hffkwOdsq3VH2S+upLxRPtIl3aHpVxT79Lo480a/rurKGssRVCHMw==","signatures":[{"sig":"MEUCIQDiUrKf6VCkWnvVQcwJulOzfiad2mo2NfHfpagd1og5NQIgdwQ3veGYs1ixYotdBQpqe8w/McevKNk8dCANq57yNFQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":447421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihMuwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjkg/8DpdjHxNIelIXsVt38JoSV7HL0Rp9c/lBrluGGVmDLOI4NjcG\r\nZhz68OYXlXGtuQCaekhDUBKx8SwogE8oa/gtVT9f1Tt82eTbrGFrBN8blE2o\r\n3CyFd8hwwt1M/dYAM6V6Xel9Z3FFEGQkDYmcw8VdsSoiODiaCOIWYr6ylxhu\r\n/VyHYlEOP3Lowq82v/RGUUqS29wV7EhD4wG00dBd+dQfiL0jHsvLm83APCId\r\nIVM0xUVIUHy1n1HPHtQ/KGk4xY7LVbGI0myv/20BllWgy5gw2dkLrVORAwkp\r\n3jvCejpDmLy3xjANIo0wphSU6vxmxSl3975VcN85zRNv1ZUuA9Q8Mu8QygVm\r\nrem2eA53zMFFP17L8kul2YzNxepuJQLKg/iVWtzF5cEkAsTh8EXi54P4HtaS\r\nH0V8p7mMW9MUzODmutEoZ4TtcjkUynzfAWlXbKXtR1PKM/wRxYhsvt9cg0lh\r\nm7l/+xqBPf841fdBSl7Y5ibzTurH/N6pW6rBgekDYtdWjZxF7uet8q41xIRv\r\nmyktUWMS8tLNcpqDk1XBsp1Cv44H4FaOu3yc6mL2A+kVk0jLJEkBckL8w8m+\r\nteYFIa3OG1fb3t1HV1PnJGTLlK0St6JgXGE0zsgDzP85sOA6sWDZJkdmlST8\r\nctujFAwuyr1b+AnF01FlFUs+GemfG34Xx4o=\r\n=MIWp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"616cbaddb83b5a0dc126192ff90c076f76ad09f1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains the client for accessing the AtlasEngine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-616cba-l3bg5bph_1652870063764_0.6601210231119252","host":"s3://npm-registry-packages"}},"3.4.2-hotfix-fe89ba-l3edgzbw":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-hotfix-fe89ba-l3edgzbw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-hotfix-fe89ba-l3edgzbw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a34d6481c28058a359d1882332ae1b4a4eeaf254","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-hotfix-fe89ba-l3edgzbw.tgz","fileCount":153,"integrity":"sha512-ntPNVHZLB8ujNoIGlsBKk5IHs+m68/AEgBET0MEhmwDyGv3NR6nNbtue80qJ8WkaodSZTh2di4hkjgrEAaTL8g==","signatures":[{"sig":"MEUCIQC8t39KdcbnRWuGrgoB7Tb0wjCdKEabOEKleVWql6eWEQIgVGeanRGobdF9p56iB9D8FRvXMn+7n7uI5LuNjw6mfwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":466991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih363ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqerA/9GUX+h/XK0I4WOj46j9rcP1QjHI2sTufXwAhIxzJtJMMyDyCU\r\n2l6xDmXnmsgfDhZ5L2fYODetkbf16QxHUwWjLbFSjSxZEBnyE8BVm7PCp4ve\r\nliaQubch3P9m5Lw9vr4quGwRgv1Vrzx1kXG5L5b/H+v/Ounfy26L9gd++wY9\r\nO8FKHjc/Freundl3SRZnH82yDUHvP7rg//T9U1HGPZ+JgbV1xwFjQ6kgaz+v\r\nimEZA3Tn0b2whiCyp/x/dHsxy+V9feAfYgz1kI1Rm6wh5oPACWh/nfFqL8hv\r\neZdW/NJC+rEHGXrieeGTn7zNHzJHyMZCwdPHk9V32M6BRL9KXambQ+mOImPC\r\n1I6i0ngB2uotuLxVk5ghkfQh/GfztCSQtMnjWIOPgEg6Zup0AaB4FBALBGBW\r\nF/WsvGizaHHulGUEiKwI2WxLh5PLjl+kUgZA59MftCifj/ZbVLEIOGsy3lrI\r\njyT/O5K9KIEFT4sHRhLQkOvegzajJptUdMYjHaxTU4SAYInwCtkcpzU1m1vY\r\nXZ0dzVdButlmo6lutRrar8KwqRNGwqQgtHa86kgsZT9VUexoyuKf11kCdB9y\r\njvV+ftkJk6abHSWO/+UN1PjJj3Fclb1lZ3j/AlroSLuM/1S5DOEBZj1PE0Ob\r\nzRb1G67OnjQcPhS4naOLp0pL999wOCxDxCM=\r\n=fLdD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fe89bacd68f1ddc25ddf1749ffcc139a3e3df0a7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-hotfix-fe89ba-l3edgzbw_1653046967208_0.07417986950395594","host":"s3://npm-registry-packages"}},"3.4.2-hotfix-ee97db-l3ee8mxp":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-hotfix-ee97db-l3ee8mxp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-hotfix-ee97db-l3ee8mxp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"73575499b8008725bd713422c72d4aee6a33949a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-hotfix-ee97db-l3ee8mxp.tgz","fileCount":153,"integrity":"sha512-PR6xgxnzEd5cC4YZ+6yz7S2FzbMQBZzZEi78zqz8jxDS4tT9Pmsq8OSBwgXUAk8pA+wz+O8TEIPppe74BE7/nQ==","signatures":[{"sig":"MEUCIQDM9JHMLgAF+azMjp5D+vcdhcyYIqIKzItQLfxhrvJnAgIgdk9x8LOqzyyYn3lGBKdJThmXLgDnRwOnFitMA13zKaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih4PBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpO1w/6A2Z032NRdpVurnk9NZn9tYNYNtYz2jAEXcoG1pHlAbOx2LnE\r\nJsAD4D8i/BonV9jaE3lZddov4TJQVcWupCehYCkMpl7s2aZzUWYYfqQjFkAq\r\nLNJxEPzGoBhHgSGE2Hb4iOKSXX+M/rnUhT55VAgg6asQIMP68xvmU7QYWC6r\r\nIla1IhnIs3tNT4/K9lV65EQIsBJhlByRFF5iZhYtTjmI0LSQWQAn2rs+xTH+\r\n2C1AYF0NbMhz2HDYC0Nvwc6RdzhwuE7wPIEdr2Pu86fVAy8sIG4lqa9KKzAB\r\n2MNKQpzCD2qTmTGFy20cmTDifhbBizSv/b1D5IQMydG4EnT5VjPEqQ5748Hy\r\n1dUcSn+eIvwEo4JYLGw5qfuj7kZsUUjAvxT5oBLxb/oprAySPrfT/mnGTyuA\r\nQwReGD8vX0nIMI96ZZewF9ZxFDgvlV4uQkQ0+KNRqmCdSsgt5rt0q7gnYTj8\r\n9Z+ZrgTzJ2wTZ/0tG81FrRoYz//N//9XXT0xUrofc510ygSdtfEam2x6Oh+T\r\nVgMhSFQHQMgrdq1L2XAxw7po2Scazut/FRBOAxpOxxBjXyox1/8J7ioqYxdi\r\n+BDjQ/wlQl3z+p3jmPY0bMUE0Ljhq0T2pLI9o8u6qf3izpIl3eVI4sDXLURs\r\n8JEdY1dGUScU4BdxkMH4LS7DnMtTHTTgwe4=\r\n=JEdO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ee97db3c9088787345efe7afe778ad172231f47c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-hotfix-ee97db-l3ee8mxp_1653048256995_0.8407015001369718","host":"s3://npm-registry-packages"}},"3.4.2-hotfix-f2b6ec-l3ikfa42":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-hotfix-f2b6ec-l3ikfa42","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-hotfix-f2b6ec-l3ikfa42","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0e45c17c7623302116ad57117764d1573af30186","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-hotfix-f2b6ec-l3ikfa42.tgz","fileCount":153,"integrity":"sha512-Ll0/jhcnBVr0Rak6xu3YwdQ86xnR9SAw67R65eY9I5fh25kHP90xg+nFRwDyaRQx3HNlrGPgZN1RPqOsd0tutw==","signatures":[{"sig":"MEYCIQC2fhpHUoOBwbJzAWWZjMZUYlZ7tS04998vy923XAhiggIhAIRfCgkY7yEeg99fdFq812RqxNmvIdokMMjbui8wfmvg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii10eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpeA/+MqfEicVtKY/A82XiEnWSKeE6T9N0SjR4ind/acJHiB20lx9u\r\nS6gC1sOQ8PO4IssxgrIz+SGBB8d63uiXoPbzTsbd18c07MrIC7nKcH56LHAd\r\nXG7c7GroxTt//3yuasKYX0TUwj47xPm6TwffPtpmxsSR+hGjbYico6u9YoXu\r\nfKYcXqHLRKuiulT30bjyQKgdxA/J473+Dj5t3VA38lEDttGs4DMpff5AQKh8\r\nijuOeIdFS70sBTx45lam/MsUCLvf7f3HWroh4tyQMW9lwvbf4AyjF7xq06Qw\r\nHndXIHBBtg9cZmlH4pDufd0KDEe6v8b4oTiylLDjzA4xym0D+jRMGuRbEZNv\r\nMWxzX0c3YnYHgyk3FebRxKn4qlvzeZXVavHv8PiP1ct/6A1sagyeAJpusiO3\r\ndRB/5sFd12HhDJM6gOSQZfBZSAJy0bi4s2Wh5ExVrsk6NviwXTmS5awiREDt\r\ncabAMqJFOSB8waerse46Nv3q+/keYTOo9QkeX7zz6u05lQHU/62GbtRZMsXw\r\n3ooQQez6t+MtF56m/RTdK8N/woER2ZiSibaxZZzOz0YU8dnQywuH9taB5AWz\r\nC/zqvgpbl3TZ5CunDMWr6Pp8BURO25taGmr3KX/WuDDeyokqSsf9jkus60GV\r\nypki1SUND0NiNtXZkM1E5EuffRd2qXbc2kI=\r\n=XwJ1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f2b6eca5f40650020d18b47df389a4d229e7f4f9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-hotfix-f2b6ec-l3ikfa42_1653300509842_0.04575233328493811","host":"s3://npm-registry-packages"}},"3.4.2-hotfix-dc36bd-l3iqhrio":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-hotfix-dc36bd-l3iqhrio","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-hotfix-dc36bd-l3iqhrio","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"50b985768a86ca58eea73a14945fcafad8ee0af9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-hotfix-dc36bd-l3iqhrio.tgz","fileCount":153,"integrity":"sha512-BZW7uGCRe9L5RVBI8Zlvfneqi2Yf+s0syITmaIcz4+QcN1RSvBDasPD35cQUcAonGBU8/MVlD6LNlViBwtPDBQ==","signatures":[{"sig":"MEYCIQDvtbKWT01X9PwoCgv0LG2DzmTjDTA0XcgRV4eOFqAMyQIhAJzm515VRCgE5wQVXDa+9KgtSs6oEDRl8j6/CPrqO65b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii4TzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+JA//Vsft5I5T8u4sXnLsAJuhhIpVSYw14xs4Ok36SQvr5R4ezT3x\r\nKGHsGO8Y8RpILwv9TN87Up92DYibV2AwUxa/RYa/quIkULap84s/yutY7FL9\r\nBoKERdhm0Y2HeK242+A1YCf5yB9M9dM7Do0MxVi0Op0iW8/1d3U3m2A8kHDk\r\npENQ0C1MwraMPcS0l3QryPLdHxE/5dJ3rqusdXKWrKpWyJfic50yhshMLNnI\r\nneVcNSS6mF07ekZkUNTlqMALtYyAWDZhVPjJEi07oJkqJaxeynF8qnGKbqqf\r\ndPO8EOieLapca8XplXid2mg0ztX0tyeuZ0Sjrl0DrPpDymEINvSoI2+OYSUd\r\nMM6HgiJLkUNBjgJiGR3tUDMd9/nG4apE92MeL186einIba8IeY5yIG8YO9V5\r\nPhWoyY0JRqfQDkSI8FGjQR6661M1iSvzm4LILGA0VYYtcz3r41YXKK18hZMA\r\nJEnuvVqFDdR89m1QE2dP1YPJYtkpGVKM/Oj65cI6NMxV2Ai2kuSIU417XokA\r\n2Hg6fPZa0WrmTR8zLfbY77SjmTNBjEWDgeC+K/6X5zpSm6rqSoR1+KY0VIqx\r\ntcpFvIDlJZQwXadBsACAlIShoh1N3LCgfWl7xy9zk3E/H7KHlvqvbFQUwoUZ\r\n92YzWpBBWHuX0vsWS8+3cTOO9AErB+ifukw=\r\n=wM8K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dc36bdc8293d708279b029c5ea0fc82af4b0fe69","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-hotfix-dc36bd-l3iqhrio_1653310707597_0.5672961438747899","host":"s3://npm-registry-packages"}},"3.4.3-hotfix-e17e7d-l3irwhd6":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-hotfix-e17e7d-l3irwhd6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-hotfix-e17e7d-l3irwhd6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c6282a460942bef52041ba2fd030b39f55e609b9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-hotfix-e17e7d-l3irwhd6.tgz","fileCount":153,"integrity":"sha512-OanlQckdeCXUbAZf3Tvbqg+RTj8XTm5QjFcbI1HEo/z5/ydFLkQDdKvSkWLOwzLVlHEWf/jzwW7Kzo3AQ31S9g==","signatures":[{"sig":"MEQCICeyv4EOgJ+POCUPfixsX3lG1us4N/A8uEkKwAJifO7MAiBMfib682Qw2OnqGatKye5WfO+QMl4zh+EHzK8Uz9nrFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii44uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonOw/+NqaXkTsvWoSFkZjQwnG0dQNIeOG9GAn1LWk9bROvZkWAI+HY\r\nEtDtzlZf+g9rS3/5Bf3d3aH4z1XqA+U1CewGTPXEI29yIOn0I4FqRpt5vmgU\r\nI8kv5szKh1ZCLEysDISVJl2xIZLVxEUwL/+wUHLalLDUwZD86We49woO2xKo\r\npBLnLcQtYLvMEzdxRwBXkq9OgHc3yM8V0gIo88ePZB7rz5xuibnDsFHXIa+o\r\nKDz/uwiAtdFi22JePta4HoU6W9j22SxwtFG2RVESe0GxZaV46DzdKILDMmeh\r\njtt3tmlW0MyV0GfJh0fNDQxJkfHphA4jajgK5TRPuWoOrrO56Gb0vcT0yLJY\r\nUETOEaFID5by0PnUk6DCWsy1/dYZ+W0K74uc+R8zOsV2zLTFq/lgNDfK6Wi/\r\n8vQ6m8q75JUDbfasF1K87Md43f5zZh8JZkoik/Vd6Mhu2uWdUu+u/Yc7q8OB\r\nJ55DCoZmWvtnCD60o1uje5DN6NzrTf1BL4ArFZ0Rpd8ky1jHvjlI0hjnfRyV\r\nZCgTMo0HKDmqVAEo+CUyRqcFA0TTKLiSpd1hDA44aLGDln1Rt6NEmMxNjowc\r\nfyVfuzt4H9tNiyDo4gbfBLW+vbwUs1ZZGTgoN82jBweXmI4Mp/qVRKqFcs2J\r\nkDNVTqtJhlednpVlvAQZ2OnxbzQhj4nKsSk=\r\n=T8Qp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e17e7d2d08178f37c17ab9a0827f509959e953c7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-hotfix-e17e7d-l3irwhd6_1653313069723_0.38962641404703113","host":"s3://npm-registry-packages"}},"3.4.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"507b831c9afbb2553ee76c01051d39212a119a72","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3.tgz","fileCount":153,"integrity":"sha512-87Eh0NWD0kovEDRQ0m/Kw9L2ycb3ccOAmaTS/ePgc18CKDzWHj8VSTGPlyVup9GZaJqc8PMRnRzjOmuar/KCbw==","signatures":[{"sig":"MEYCIQDyA+GUgoU06dQkZ/X9XXMEsO1dIHrIR0/ciZtwjP8WgQIhAM9daZqfavFS0eAOIOvRVt4n//xoqD+D8Iyn5zUJ5nhE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii45IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopKw/9HUjCN0lfaKA0DBwlgoK9D/VTucL4rqiF7UfJmJ5bxXeHFVBB\r\nYkVAZYGXZ8J9KdoGAUH+vjfapiUDPCvGL9L6MzHhFnXwgZWdZ9HuyuHxvvld\r\nupFQ/ACnSwIE921TTXUldO4ezvZjtNWFpacEymY/4v5tvwmPEe3UvDGE28xZ\r\nNVzOZfci9hOrlZzHqypFkqgTbGT2JcapxT5Fo/syuTBQs/0yWbodNQ/gla/B\r\nXF559ok38uTCG7dxzOmQTU8gqu5/DUrQy2yeSD/7DAt4gkFKHkCSZsaLU0m3\r\nbRT/EcKy9RYcTZXEC/bbSZP76lAiPvM2DwPXVWH41G9DSxwSK7l2Fi5IfNzU\r\nL4+75fBrjFhOtr44fAmoVBQJXS7H7an8aZIhoj4GC5VqF7sAZsJjc+n/SFo0\r\n5Wu/kpp5YXvEMh7BAque4BEBSO83ItfKUj3eDuQrfDq9lPi0uwfL9dTLiKy2\r\nicgCQSV6vqnmOGEvlEZFfpScQt03TnRqtZcZwEzfYUxi1r4Vx4mgk/cQ6YQ2\r\n125+3jhLYBrzZO9Mzc8/q/gCPO98mEP5BO1PTkKr/GrcjkzafnMNrxL+x57q\r\nY2VIeVPP/DhLcvlkb+3g4sEMZBqJQ8q2Lk9CQetLiC9+pjtS9AhqXcaLNG6o\r\nwF1Denaf/9bLvUYXhbUJZpmUfDNY3NjLf5g=\r\n=lVJ8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"105f3135df3380ba2040b5fc9b888046a081e99a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3_1653313095906_0.07010087072998461","host":"s3://npm-registry-packages"}},"3.4.3-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c6afcf79f67c5d22d2dfe51083e00e637b45cb7b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-beta.1.tgz","fileCount":153,"integrity":"sha512-eAasVy+5kNQoDciNz6ydoqMSRrvOMys17mV1buIe1cCNOwsl7Xy8Eh6UtKLbSjrJa3nvf2NP63uFQMMRyn8JsA==","signatures":[{"sig":"MEUCIDq9QRhF/wvsy9wzpPEqZATJTKE9XiBbcqU/DRKsPIJpAiEAq1HBQ5c9iCCW/bn9iOgQkBZiUzWESn1PGl7cxKdCq3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii46CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5Cg/+MZV+fXDgmosqn6/uZrP9Ztls/Y9esG8Djvts2NXJeMb/8NGd\r\nx7yEsbP1tzNRrtk+3ODoEjo++KW9sSzlk3EhZvLtyXFYeyw0uJMtC+IOGAPT\r\nHfKulfwq6KUmcNYlbbFf6+VXA1aEltyym2+2HFxjwvfbAhof5VNo5KKV5Mxn\r\nxIgl9OqjLGjKEC+ZRBgNIDm26V1Hx+taQKVTKySBycyLkB7kDGTFoll2KRBI\r\nUqwlyERFAnNZNHaxRn5opNH3Go4AD+ya/ARnligjXrTlHRkTcM9L+sLT8K3h\r\nrjY/vdDPK8xa+MNdqs1Lr3aPvWujgv5D11vRVZr3JlMm3SNzwM0aNZWWA2nU\r\nmJnpbsKlQXi9wcMI8QjnqUoFZzqvh9jWu9MJkYQI6e85eRYyacWKlTkTdYha\r\n90PfUA4yVJuAV4SekJpbJQmH2GLhYxiF1CN2nL5ZUbb7YjpW6lUTczg2mn+R\r\nhMC5ut4W7h+NZplFBaMpo2CIPU7bzelAjTNR4+4vVUHdmbjIcPPNBBJRcBQY\r\nTspmqZOPHoCO/xF757Jlv1unFh7ZiZ7UmDc0v2sXPgjI1HMIvhRK9vSMtzhX\r\nZc969MgGY3MDGtmvDQ6oTrHJk4Yk+qR/StZ8quF7CrL68g9Z3mvoim/t4aH4\r\neGq+abA1SQsKs44sbGnOOy9xS1kMGuREdtg=\r\n=0VNZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6f91e3da7487344c4feee17dd5df7cf2f3abb546","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-beta.1_1653313154085_0.4201883433468807","host":"s3://npm-registry-packages"}},"3.4.3-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6f55c283f0be5a2b1b4bdb8f2e1ddb0959f2ba80","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-alpha.1.tgz","fileCount":153,"integrity":"sha512-29uYG6nK30dcLiAES7wxzHXpWDalxUKaPkZo58oL05jv0JEU+uTHaM9VJSn6p6eJmkie4adbzypoDJYYfBdwCg==","signatures":[{"sig":"MEQCIG8I+2T2gdOLMI8fjTwWoEyDeQs+45UH+fxHp9710QHUAiAHwgH+6mbI134woxnIkd4bE4S1txGdv6TkXugBYKd9MQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii46fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCHg//dFz1P4r+AQyyL9/89EOgTSuym1gYZOmD08F3NaTH4ym77uwD\r\nCok2nnW4ys42tubAbG4ZQNIPFttXnD29uBVJlpWOxgNiCGHGrJc6v+o+lzXI\r\ntXsc+NyVf/ow7T9DyPOZy8ZdiNeCNOtEH7V/15WK3bmSDD8wmR9LHou7gv4n\r\nkfto/VJl4leSpvGN3qRD51Wi1u1HYdSvXa1EQOKu7ufa6frVgQhiMwn7wLr/\r\nYo1h6kokkJVw23lfcVQd9eCjacGbO8vGUO8J8elJE1cDwFYtgxvISbFwI7Eg\r\n7akfuVT1+2Lsh6LzV7QEIptwqYM0iTFB9Mo3G8fnTpUbg2abVZeMhpF07vkG\r\n46vbvije/dUXIsYC9x2iXccJGU1r5H9K695Mal6q/nMZ7G+UCEBHXbcEsm9S\r\n9xVkGmksr3YT9ZD2IuYRYF87FV+TinNVJ76Kxf7PD12B1DLAQJbfAFVFJhvn\r\nJNYHB/slkYm1wXAWdk9cuWFnjALdwaucZWo6ix2LP2haaDrdWr0yOQ42zA+W\r\nhat2LW1qBMW23MM+RqugD5/QtKBMXpFLIw3bBaWYWXMIZt/Rd13tMMX4hZO1\r\nlCrKaSQk3qvisggmuxjSRIvDa4W34zREaG24QmzNKW6rSuxJgWZ7ZpBWA2Q4\r\nOZP3j1/5mHikjvGIzoZV4Zb1ljjkQdNZ9/Q=\r\n=8qB4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c2d46be4632d8de7fbee445c13d495589a71781b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-alpha.1_1653313183625_0.5256231079735099","host":"s3://npm-registry-packages"}},"3.4.3-feature-041c21-l3jsp418":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-feature-041c21-l3jsp418","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-feature-041c21-l3jsp418","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bf3e75e399656677f699862330a669b42bc7878b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-feature-041c21-l3jsp418.tgz","fileCount":153,"integrity":"sha512-1bHXp7A6BPT0J+gutwqMctIXYjwy2XzTkYYJCSNVnqaTvEUESmMdtHE6BY2zTZxn3kq2Pesud7MgwKTkRs1FvQ==","signatures":[{"sig":"MEUCIGnAiHD5+7tpFeguFm6ZTAID8hP5h8Stc0JhLZKrBoKYAiEAlwQ9WJ5APTVD7uEKhJkeRyWtHfJy+dtgzJHk7gvSY/U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijH+XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHXQ/+L1M3JG869MkqiZC7a9LtgQabSsd/uG5N6jEVkGblR608sG/J\r\n/aKyMOL2JypcaZDpOC1EpuculO7QysGOCCJGJPow3zIVmgTBzloug4OhOjEd\r\n+sRtSLuej8/mVFIJ1Ar3F11N/S0uM8HKufJf2kkRuxJPrYFC8Pg98RoGT/2/\r\nbfTBGunEOIaclUcqldkJZ+pOfkIluv/uBva3jU1U0AGCAmR+HltBE0no0x5P\r\naGmNSY6zSlIg1CCzkDM1wIivx02Zxpgjpm5/CbME1483oZL0vxXzlZTbzWCH\r\ncNeUpR9iWq73/aibSMrqiSTvddtkCRZo5693ZRwG534i75o9IhYuCPBA0snc\r\npn84t9mpVN3x+8tbeQb4jcUep2MfhSlgltop1Knv6iKjb+fKGfaCN1AuFvzZ\r\n1CCB7fUR6SVnI9Bydzc/hc3a2328x8F4WAdHLzXJZzp93YIjwytdjahcQKSX\r\n9+35Fuzn1ZiQZCZIebLET8uKbSDaHG/tq3DSIq7RtkKADgHXTdalEGuTuNxT\r\nJ7/qWqdHnrMYIWHCNAybNBrMgeSAEc8e99o5VlCI5eCpwz8IvKPlhfhFy3UM\r\nLsr8HK6f5qNTudKcXg8289K/mzGNKD1HH62DA+2rST/xM169ObnUhwNjiPlo\r\n72LU0CT9S+9EWbd7A3EXy0EiSZzr+fdyY2s=\r\n=d4Q/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"041c215ca0ed0e236fb6f3c4162aa43692c6dee6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2-feature-bbb9b8-l305d0oy"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-feature-041c21-l3jsp418_1653374871538_0.6241482226549604","host":"s3://npm-registry-packages"}},"3.4.3-feature-a16da4-l3jxi8bg":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-feature-a16da4-l3jxi8bg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-feature-a16da4-l3jxi8bg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"23012fb9f7307ed5269f48e2620d7ea632e051cb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-feature-a16da4-l3jxi8bg.tgz","fileCount":153,"integrity":"sha512-6ldrYQt+Ge/7NCu86SyYc4pJnW8llo5eOxRumkZ6lEXROF1j5qJj06sSAjrQjEpl6UmtzDCSN7uOnIljdGuc/g==","signatures":[{"sig":"MEUCIDFUKZjwIafz6z+B+aZWakS1WcInsQqXEplW1o7hJQOmAiEAgukkkeA/5jcLxNeq4WuKLDMi9BGppjMcOJs/ZTVckEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijJ8mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdNA//R3Tz5FJHFXZ0iOz+ziyIbT4Jge179zAH8yMgA3f8tDFDC5lg\r\nv7NfFFIM3kTKDMiof8mPnKtoMpMdGqgKQBCMnkrSXGaLKxhpJj0yH6SzhgbY\r\npqTIdah0a2Ss5bdZ77jo03mI7Hex8S+Likw7wRHnw6irYJpdGl3WZ/DNoRGJ\r\nRu4NwudQLAnXd7IiDmX9LPzC20EdchotwGWiAohuFn95KeZeprz9Lvpv8NPn\r\n00lH6DtCrPxvF1b9Wrj+xGTicpeiETGtgrj5OfsGT1fYZxBy4q77Wa7NFamw\r\nfdqcXwk2kKiHjjdO0FRLpC8ylfnfNkP5DBQGXXXB6yf7IRRLufrxpo+tVsYm\r\nkaSOM574pQ4hZJII50WkT6CjmAx3sooQUSe9uAjgx64OFhSRb6FnehX5SFZF\r\n5pBJrrf7xWAFJIfbgd6fFVtGeWKMgLrwWN37fuG30z7GGzSO4BF1c7k6OPgu\r\nzJQ+GPBKq4FCpEH1HQmqZ5KVOjm+uz2hW5pH0dCHTk3X/AjHlJ9mhcTE5LEX\r\nc9nOcMSnzmyVOvE8EakW087s1q8KeHvl98MHGc+E5/DWjSv2KU55AtcVj+0F\r\nn8dIR8vxkJBhZIYDNAug2lo1CF1Pmt7p0COSMGCpeCiHf6e0hX+lbh6X1uka\r\nUOVKi+fgfRmHoieA134/CV0LVpspZ5TdPY0=\r\n=Xftu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a16da4d82a6f4d64bcba42f514bd7c8c03f7bdcf","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.2-feature-bbb9b8-l305d0oy"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-feature-a16da4-l3jxi8bg_1653382950486_0.8340478607055903","host":"s3://npm-registry-packages"}},"3.4.3-feature-4bf6c3-l3jxqtvj":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-feature-4bf6c3-l3jxqtvj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-feature-4bf6c3-l3jxqtvj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"51652fdb8446229c80e8f1d7fb6b6131c5ddce39","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-feature-4bf6c3-l3jxqtvj.tgz","fileCount":153,"integrity":"sha512-MEQEYQB6K+Zq+k3IRMxM+mJNDfQc/c7lN+sXLoCW3aOtF41qseyB1XzQhVI1lAuuzjUFsZUwcH1b9LfsknZQxg==","signatures":[{"sig":"MEUCIQDhlJfMdI5QnAIg99USgBARi9OJIYpz4LTv7mYpyIazEgIgCYJ6lHcAGKW5aWzXZSAUQpqdYC6gHcyL1Dam/9LkQ2c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijKC1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMvA/9FfoGjGn6sssbIpN0XQrS/iKcEKaz+viAYijJOqE0FaS1mO0G\r\n4ERj7oPd/T+r150e1lHwDfUl/JL+Ye6ybAo4dKR7w3VsQm6HCTqhZJHY5Qb1\r\nIKs60O4uKD936lOK7vZRA4qMUD3t4gEaRyuVQmZHc8iw2OumCk9QKY3qPGqI\r\nKRZmEJljmX4HtMeHLeAcdIFu8zeHbm2bNQD2sZrms17SN05Bl8qinxxg9P9e\r\n+iX5rjRce684Yz7YQeU2hUJZrkNrXkwO2RcB92SQokz6aaghkP4vOeeBRFWG\r\nhuAfH2x0cQDUfS3eKYQ59MtJCIxiZTmhvkuDhVxVpRuudzfz3PVIH1TClq3J\r\n3S4odbtQWPzBpotXdiMHRZyufYbEeFItNs1sOJpUKhbrylVqDhHc+LvDROvK\r\nlwB4UlfJWUrdddz1M1Sz+dnrsJJh9EmbUfPfvuWjz42Ff2tzT/7tyzNIghcB\r\nOsNKwDfkzoNHAeqoGIIPacG6uDW106pB8cWIp7paXP786HJ43Tf3dUz22QYx\r\nXSL+Lo2HbS2eQEIiwQIWYlpMQYmLei+koeGKxkpy70tgJ38Ex0h2UgtvQWcE\r\nqakTj4Zsc1vY92VFr/ioWcdtY602CTX824D19ZOUM4tPSHI3ceaORnZ5YvtY\r\n97Zsz8NryBFeLJPdMe65eWhC9NRcI+YRLWY=\r\n=aYBz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4bf6c3e9cfce0ff7d907a3919a62bd2c6ad86992","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-feature-4bf6c3-l3jxqtvj_1653383349655_0.3821971637383339","host":"s3://npm-registry-packages"}},"3.4.2-feature-6a5e3c-l3vcjfwk":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-6a5e3c-l3vcjfwk","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-6a5e3c-l3vcjfwk","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"769fc411b07061b5d0b5da8840d1b4e44cde4faf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-6a5e3c-l3vcjfwk.tgz","fileCount":153,"integrity":"sha512-gU254RB3/V13/POiNwLayDufOlQHGrjdWMvYsSb1EtViPSzWS74K0+QYgEt6/H+Lo4rsc5upk6ULvyCH5bqBUg==","signatures":[{"sig":"MEUCIQCktKRY0NNMJokLqDRubDgmdT52c5daC8C++6yiw0QdNwIgKxgOaRz6Pufe9DDaOWX/gLpAagUXKpNYhy2sTlyV64Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilyfwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpa7A/+PRpmHDC9ZvtoMFltNiLVKRgjsLCpQaovvc34czgO6eIXkLbZ\r\n/JD1Ci3MJA+T5JDWYHlgrifu94HnWjHVqS7kQsv5IttTCmvCfvqKqnZesn5Y\r\n/Z10cjlBwGyHu8IjP+DS0F8NpZGqv9a07nqcZqtgFxPiTNHE8pgOsoDiBD80\r\nP+111t2wLaZtoajz1gdEjips34PrapvHTG/Pg8gBFua2GmzkzMGRKIMP47YS\r\n9WHC9gcNS4G3AoQIgSaapO5Q4lyVDXUfrOewMHLaUMRMSd8TBoVcrkXG6Q6y\r\n2/zbvabWl8MG/VavcR3MjESSU6SyezznGD/mujo80mfaFuujOaWB44am+ahK\r\nWK4EKz0pKp8VOT4TBo+3SphWWnzME8ckzYnAR8lIWkXAI1Ko0VPaHb9Cs0DE\r\nB9T1Q2Qep5Iwe3BSRw3NAspAWvsf/apieAVEU8nWeUGfgtDoHJBKPPLd7fqw\r\nS5+yG+9rzp45Bn2bZCsG1S6hwyDlnADlaSdbz6kTqLV9JVJ7+EYqOqEEX45Q\r\nRXHuIqhDDnyPJLUNCCCnDpYV/L0UB6xmfN3Dldum4cf0qk8SWjGVTxn/CO/z\r\n5B9Z+Haz2ODEAMwQ01oXcig87zE33ktRrBkTcFquk2X6qJFEXS2iCggEP8r+\r\nZYj8co/Pay7ScBklZARhS6aAQmLyKfU8w88=\r\n=AiI6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6a5e3c2b120dc966f63e64d6527895b4a2115a32","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-6a5e3c-l3vcjfwk_1654073328080_0.35071462060232794","host":"s3://npm-registry-packages"}},"3.4.3-feature-73f2c9-l3x2uq6x":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.3-feature-73f2c9-l3x2uq6x","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.3-feature-73f2c9-l3x2uq6x","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"389dd09b79d8c1bc82cfd78fdbe77e7ff7aa45e3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.3-feature-73f2c9-l3x2uq6x.tgz","fileCount":153,"integrity":"sha512-e3mi1u1Ps9RuzU7+gMqRnP92WUY/cAQQGODSDdwDNSYNjBDEkmpTQnf/RZ0Acty+xA3WiotLfUON0D1Q6UWsKA==","signatures":[{"sig":"MEQCIEvqLpHNYRRLVVBnNB6uCLuJu7RyN/Pnkxftwnp1GDXZAiAkY4M5EjWaS6IUkYC+IhWBXvnJK59GeqMRBhXaKdvQWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimMDGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnWg//T/kQNS5WD15RHm//f/Hy5x9DFOvyHQG/vtkFqHsw0P90yVPi\r\nTEujG9phRN2pyvHAk/sC3aEGqBy7Qye9wTbwDfvN9nhr1Kn3uWPgfFD52b2Y\r\n/UmVa134NKo6alLiuKtlSgIBginPanCg1NEgfuD2akPJiA11sDF+bP0k1xuv\r\ntYunyM7R7VWRxzrb2PvNcBm0EY5NciQMkYA9Y6cOl1wnxgx3bkAi0APbxCzw\r\noWQWolBd5XkEfgRmX88B54TvpoGPYlNAcAUw7gl/HXMpUwGpGKSlL0JYsQrp\r\n+h4nwJOoK/zX7AlgPJEfPr6zO2Et2J9GUa+0NOBkZBYAGcSsACcufkAoI+xG\r\nxxTmC75i/ZlCwRAXKfwPHg6BtkHgpI1olDJMJ6LaHRc1ML7YheuHipP+ERue\r\n54ImA6jVaj02YM2Af+IfTKzS4f4yimW3qU5L1AoiUsVpou6Wh6DME9czNWqd\r\nzqIYV6CvOkq1nZ1vaNolxbzRqob2WlxkEVvUOZFU4r57xoGm8Tm2gVna3S/T\r\nkG2w3Gbq6NAoajyLVji1M9y+diTJ9c5ic/ekZuxiC/H/++Us56wZOfPhYxow\r\nn3Rn/U3DbkHg7xAGbqpi32HS1RD8MJwQC25ylFBcoi/pqDNTsvGOJ389IIMx\r\nKxFlyv+rafDhZ5RV8BFmsxO0nIAK5rAwIDU=\r\n=bDO6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"73f2c9dcf6187f937075b41b44932c376dd34ea6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.3-feature-73f2c9-l3x2uq6x_1654177989812_0.4298974453316924","host":"s3://npm-registry-packages"}},"3.5.0-feature-4aa753-l3x2vjwq":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-4aa753-l3x2vjwq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-4aa753-l3x2vjwq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9186425889a0bb3a1b3c5b9513f4e0072cbe900a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-4aa753-l3x2vjwq.tgz","fileCount":153,"integrity":"sha512-B6drdRCEEvo2PQ1fAOrUDOkMYxBDUxNGx+eax582XBBvIOBIQ1l3Az9S5O4ERv3T0pErcMq5ys6q1UVWQGw4nw==","signatures":[{"sig":"MEUCIQCw59hgNxJ6IyGCQr56zD9e04RoY/8e76mpF5TjN5nh+gIgEDIhK5FsFdciEzhFfJNkZ+C5rzPDheQvwSIsqQgCNHI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimMDyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmotiw//a1yiReTRBs/sigeNQW4I0pJfnMJMP7I51T2sdi6QgynwbpuT\r\nTWborf94qBbuzx2/QXl6lcWPsVjam0I4PnWM2U+dsmv9GXO5aZF200XoMyT5\r\nTJi0FpWfRtHTKxFV4pzZqGoRchwvvsSjBwFlwv+Sg0HRAujsMzSuDJ4sV++g\r\nby222bNLXHiJ9s0x68WLjAq2AGi8TeK21R2B80Ldmud2YCzIvq7EL4F1VZE4\r\nZGxIIQVz6Ru0XDiFWM4g12syUhv9xZGv8AYrvHcKKC+kqMrNioZg3FVsBsbD\r\n3BDkm1/uRMBUQnA+mTVppuYmmpgllFNOTacgljTX+FlVD2dZcd9sp0PwD1Y7\r\nmeDFwa3HN2UcDreZWcEZyO++uMb0H6d2QZvUpifQ2Y53+tmGJ+8cmN7dLzB0\r\nQrFu75KN0O2p2j7VyytXIEV4JIttXzpJxIHcAWEht5HddfmQ/qPawSnV2Rgx\r\n61u3F5AkcSI7vpWirG+nJCWAgtfBM0QpzKPSmyUQGMr4Bu8iPJDa6Bg4XrW5\r\nnU9kGNkab1a5U++C8zCeramLMWrij9/3n6jY6K6qlCka1LpaaUs07mESdNvW\r\nhVhNBypqsNgqSZ8DwC+GyiKBk65YqGXO7KhP50Q+six5o8FUfe8kaGSFYciI\r\n8O+qy6qj3mekK5OYiZ+htPn8IBVAi0y5vPg=\r\n=4L6u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4aa753891e3dde4485b66a8e26f8fa774e546b3b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-4aa753-l3x2vjwq_1654178034280_0.8034891809260569","host":"s3://npm-registry-packages"}},"4.0.0-feature-1c92da-l3x2xat4":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-1c92da-l3x2xat4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-1c92da-l3x2xat4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f71a4aac9204b5dedf087e70f8c3500378bfb9d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-1c92da-l3x2xat4.tgz","fileCount":153,"integrity":"sha512-TMEY9pQo5lG8Hn3WasNZX+s0PX7Q6N+K+VsFoIkUmmPiPy4sII/v8Unapd8bFDXPehfywe8AnwDXhZs984YFNg==","signatures":[{"sig":"MEQCIEj2tY1NhtBazLlW9s6r6d5R1mi2MQd2VzpymiWg6IHwAiBLKhbh+QmWcxnjbujJUwPi+3fLdgXp12LWtmy1LzbEmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimME+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoong//Y3Y0V3JdX350TqYoND2V1w45rkqkS8QKFUGUDe9tMjRRxKBM\r\nmFZPpJFjibtLM8qh0rZY7jFGOrxb5XWis0tg2cksibNSTP4zHEDvo3gJkS+J\r\nFYUMutTMwgdmp/ZF5o3aqH1fcfTGeDeZ7BEFjtzRQ/YXzml4JCwpqhXEKTlP\r\nUjM2AEtsPq4BHynPKLCaLUP+2qMFH0YxrFO/Vu0gk6fFB0b1/tXT10th4S85\r\nb6Fi29gS05w9045euPnHx0EhPDdyRnDijZL9RmF4PP626jJ3cZog5oZ5ciR1\r\nEerBUGZpXK8iHJ7GcgYNAZu8xIzIdi9axbEi4AVFFDygGZRymSGpuBSH42fi\r\nhapJftIg4n1JHoumXCMdFu8gNKgTeC4HIs236k+FCn95wAUToYxSmDXfikVc\r\npIpnz8aDKgiQrRloc6lhF7gJN4QyaJK394Ux7mNvIc6nAvr0XrChZ/E2AN9z\r\narS4jksjKD4H52gRlJ8h75qZp6elI0LwM+Vkvr7gDKJaoF0liqWn1LoUfYBq\r\nRC7O8ptH/cfAwA48uyKj8OLLMEc/QnNgdb+zC93x4eGg05z0ATObqrAinxWy\r\nOS/S4kkNnIhfpFYAPfs8td8R0R+G2zn3ABrOd5xbpwhDAUm2aYIxNqBXCEDS\r\ntjVpvRAKbcqS5KSKQ+wRjMy9SXlMsHlGuC0=\r\n=TXAp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1c92da1448d4274e8f2728a03f8d6eed9d3d5208","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-1c92da-l3x2xat4_1654178109940_0.3934602818744941","host":"s3://npm-registry-packages"}},"4.0.0-feature-1c92da-l3x4bcs2":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-1c92da-l3x4bcs2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-1c92da-l3x4bcs2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e9741a6a6877c0f37f76edcdafcf021a3c05e23a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-1c92da-l3x4bcs2.tgz","fileCount":153,"integrity":"sha512-u3gNlM6xRzW5zLUIYLFFJP1AcJXzecaXppTOQarscqNHYtxlxobOL8ra7RaMWkGCrXwzFay6pmZvMVd2ZxmVEA==","signatures":[{"sig":"MEQCIE7p0gqkgY+uwhBMFDv8jX14QXHTUNzoM0xlkOe0LdKiAiBWdakeFuTM+sP1YE5FZY25Pni0m1pnn9EeGrZKp2mxug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimMpfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEmw//SwUH1rtsoUTHUb4ru18YQKPE80MaCJmISSNgrYdW6Hm14JlJ\r\nLlYbaLsujbyM6SCpxzLrqAG08ppuYglVdjPSpVUCnJDN3VABmGZ1LG+d4SxO\r\nwvme8nvRjLiHu7BBbQvd+Aqvc0jRkISgHUqpuu4hnmoGV/eT/vzBoedD9qLL\r\niIFucoLG7Z80Ouw/FVoayHfD1Tn5XbMk6Spj07OPw64lPylmWlW4w9K/oBiE\r\nsMMJiwXjgXumJfzbATS8IEJOR3fXBG66+3eOPi1katQTRWQf24ro7t8F9pTl\r\nTfSrpEwKG+dIux0Hhu/xgPOBSX15Hr3R8I+2afKQkYtcG+kfKdv/MnyHhrto\r\nKvqo7uiaR1d9KaripyymMbZDBzglAVF1KIEbM4Fkv962KtfE2odYI5vUOvkt\r\nxSLENu6d4ZsUqTBy8QAmDTa13j1+0UMPOvPumzBDzE54uRsq0GwHvSL1wGYD\r\nJqxDC7NX0WIOQc3K7zRxP0Y+0i+JkstrA9Zc/WwHUODJ50GGRAEeq63clDi4\r\nlWAqlv/veYld72t5jYBc5BNduD95FKFU32d97eFpT22PBSzz/lHITAqWuJLz\r\nEvS7zyiQlZJ+nPj0+3s0vgKzU8pgsxtfjDywky2ESglLlOyKKbDJE3sXblHH\r\nUYoEIlyiXR1Iw/AIr3kl316/T6mkNYx4Wis=\r\n=5qhB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1c92da1448d4274e8f2728a03f8d6eed9d3d5208","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.5.5","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-1c92da-l3x4bcs2_1654180447166_0.6360062688802495","host":"s3://npm-registry-packages"}},"3.4.2-feature-1c703f-l4cok6bx":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-1c703f-l4cok6bx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-1c703f-l4cok6bx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7f33271e5614f228f2980be621193e8a9fe056e3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-1c703f-l4cok6bx.tgz","fileCount":153,"integrity":"sha512-/gsjr903j9z7936n0evVNKZBWBqxZklIZt2Xc4HG0/vXanY7V42bBQovmlmLkSBrVsGt+tA4B/Uyo8hV+2STxw==","signatures":[{"sig":"MEQCIDBT1GgggRfQ6DnSY2YdmlOgFyIn0CVw+llTVR2LjjUSAiBNliWzATr+54plUAkvt5KnrcHNkTE5l+63waKSV7ocog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJipyYoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotsxAAkKQap07jPwEOs5D7nXEiYtk+bYsvUXLvxCUg7vRVtwdMFQX9\r\n9Tw5wttl1bRfckFz3bCyCyYJWV1G1VPtFK9sk9eqI9AG9CS9QLHInqASB3xr\r\njg6P5xAv5xVHwTqxSScCW5xFEBvjN/yEPxkA4rk6lgYVzh/aJ6+Km5pr9gTQ\r\nfOVrJwAhzrgnCpHHIcQmMelNzZFq4DI3yPx7NUUGjWOMcLN5CWogGUWN0Rbu\r\nGKiSUGDgPs9vudHXMnhd8M3Ogl3E4Qj4pLyj7b+vTTgfZ5DMM7txiYeFVAoK\r\nbHagCSnF52ocySozOaUTey5p5ZPtjp9E+9sUtvmRaWsZ9go2IWV5suIAAcOI\r\ntzrVj3e7DLGa71Upk3cgAYa/DqDtZhHzKvf/WPBJMH6V+hoSArH0CtxxFIGG\r\n1uHDmGwx0w5XhhU+uN17vfazOZdWqm7UbW5Ed5AK7w5yCWiF4VEWkqF2t4D1\r\nP0/zzjjNwfZQ/zdoX6lGLhCofsD39U8j3Z9uDPmP3pHD1Hy/MkinyucZpRQ7\r\nf4AX3GlJwEs/Zktdq7cn+anfdeynTZGVb9fxjIdDYrm4xE0RyumcovhACQTi\r\nD9UA8DVhScYnr6h1kEng8u3ias+ZKFIqF1WQDsQOfbYS81a93u2o7WqxCrKf\r\nC58F0j4GYDDAxOjimUTe9vQ0mvUcmwtqIcI=\r\n=i0QD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1c703fae626ae2954c79bbc13f9c123d065fd1da","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-1c703f-l4cok6bx_1655121448663_0.8380883840111393","host":"s3://npm-registry-packages"}},"3.4.2-feature-1d46c0-l4e4uwcw":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-1d46c0-l4e4uwcw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-1d46c0-l4e4uwcw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d67d8dd8360a2f3b1201d0761d92bc9740097d07","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-1d46c0-l4e4uwcw.tgz","fileCount":153,"integrity":"sha512-ymyfuXwV9yDQMxfTC90Jq+9+P7+cQcKpRTD9urx8qNQSNjbc8BjBJP0UFpKW0SdhligqYLehHJXJchwcqKUDgg==","signatures":[{"sig":"MEYCIQDqcEfZ3MmBM+k01jCXsXcR6qnn8YR+m1MMDeZQld1tgwIhAIsQ1bSJe/hYB2KTI/yCbsKdu7Gqj4+LZ1XZmMgalnKB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqH1CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+Og/+I8JKv+Qw3TfCxH3jkUg4LSyweDFpA8z5BOKFRJGjWWYymmSl\r\nERtEBiD2Zr0BNYV6POrouOSRhsb9bPvtJdJu4dejcNzIAMwOtCejFreJ7FGo\r\n8TJu1i1XJOy/+jVbekV1ixNCjSle5u3XLCB8un8wdKi1N3rzg94QGlB4GTzg\r\nSU8A1ZtLj2Jxde4NDG121LjNpG3owFbiIccccHbR9hAkEnRdt5nVoT5DkFsi\r\nQpU445PML47TFEoj5gYay4MzHZzhWQZOrG0XfyvpRnHLqMERuR7b7TrZ474T\r\n5lxeN9REVsGfmBLPe9gaUV+EbdoY0iS2shWF14949T6MgM9AJHcPdBqWyXW6\r\nw8u4BZ+lhWh2/4QIXFOGQV4C88E2W+fx0WRzf2NgxJvK8xqPNdideYnl7pOL\r\nG6Xm9bYdhzYsQ8+m/VY9gNXZKg8E+gU5Ay6Sse2s0z9Ep4w/YJVdwTLEnB1Q\r\ngg7zNlWj/Gm5SBgx2YY50Vqid/B+jdes4oB0+chHVK1JmfxhB3LU4grsk8T2\r\nvR9KeJe/U+5Z+mmMMGq49Ixo2/CeYVZad/V/K44eDwFpksEaXfWND4/PDN75\r\ndHXjRSZA4rVbOOsRRjU/IVS9dO66qhjHUAL6MMyns1NxLHIRtsZPtRMLc9Zv\r\nRBvZi+uhcEmbn5/fRHIzRUuBaS02jfVlQ94=\r\n=j+1s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1d46c0353e3c6297d4041aa51fe909a223929dcd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-1d46c0-l4e4uwcw_1655209282600_0.6425602000727089","host":"s3://npm-registry-packages"}},"3.4.2-feature-9f987d-l4e68vs4":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-9f987d-l4e68vs4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-9f987d-l4e68vs4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"08f11712c0882f80b86109216297042c965811dc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-9f987d-l4e68vs4.tgz","fileCount":153,"integrity":"sha512-hHxfGQ43samyehAZKdzJM3DU7Fhn+RBXGeHsC+LnKbjDz77vHVrTmNqwZCrVnnScdS0G3Nh0BfXIgKoVW4/A8w==","signatures":[{"sig":"MEUCIQDfjGZl29y8MTpDpNDo6KEHtX5/KiNcWgZNu70AwlGt0AIgSdp30XL3z+gc7DLACQqqzyaBbO0bvDsINRfPjWOdB5Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqIZlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWjg/+P8ynlQk+LZ5KJDCAbC4+6RaX834lsh4SS+AXZdOlBwGD/8I4\r\nE/5b/vpEdITgKbknU9qjoFq+tnU7FfJwuit3AchY6TjQ/NXjRmuO2KBXDYkO\r\ndCoaYELFSLiV2tfNBJa7mN/6WK/KgYF1BDzdtJvp+/NTBloAKYykIYvRuPV7\r\nzqUJBSDjxLu8181iiYk0KArtrwNjh4EiCpN282B2MjKwexpjepVjqhOXz+DI\r\nPJSpgXPlgLJV0pbTLNoICua1m+b2UvAydo9Xzg4iOxQTLQeEH4Z/Tcs3kxUn\r\nK2rAhVNJRw4eqpO5i6z+vtGrE48i8jqIIGrHkT7tN1hQu8XBqvvJ+wOtz/L0\r\nsq6osHCqs60X6X5eP13qBm8kR2cX8Ht7YPCLoJW7JtxnxXBLl+BI8ql/3rxC\r\na66NRt6o5f1NvYXmx8AbWfmZDS/kL+t4VleqsMDpXproc3XBLt0auaWsTcaa\r\nvWF0gOUGPzbAs7KcUcRqCGAVuLVCpSZYNemT1L8Y5uXm3hqHqcXTU9VRFl3E\r\n7J7VKG/KTIdMSfVLMG0ihJe1FaH+GDBtFBP2UtP3WfCf2EME8bquuteGzaTx\r\nMaEKKco1Pgy22xfav2MAPabWXWTILAifxdmwTWdZvaUvWDWYKiZjMnKXyx+z\r\nOQlflhikfjjMCmv/Rg+4KAWWtt8npeb5dLo=\r\n=nILl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9f987d95fcb012ac9edcd396631e9e44947a01ed","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-9f987d-l4e68vs4_1655211620784_0.30525129904388293","host":"s3://npm-registry-packages"}},"3.4.2-feature-85dbcc-l4eb2xmz":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-85dbcc-l4eb2xmz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-85dbcc-l4eb2xmz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"72a600c89675e938bece8be5eb58e63cd0b3bf39","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-85dbcc-l4eb2xmz.tgz","fileCount":153,"integrity":"sha512-ib3bm0Jp+EVdtIRqKt2FFm43l1nuiQ4lnj+9eCEcg+5NsuNZzKSa+9jTc+At2/gwFI/5iJUzIu7L7Lugk10kYQ==","signatures":[{"sig":"MEQCIG1XFkpdX4G26UidG0RGyyP1gjRFPF6f3LgoJguKW8eKAiBFXhmQcE5AG/GUWmOM5f8U+hcp9LthVhMRn4hatgDzBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqKYYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Qw/9EyjwuK2TO/zbwWzjPUjWtrQqOPTt9zme3psAvZOxu9ikYRMw\r\n4AikHY6pnTfuAlQkVSuXnw9lIVUJrdyMuUiU3KWAYrPOrxvxGZeShD5j/lNe\r\nsorne8s0UY2Gj2aDpn4Y3ThfXIKbUhe69u4LmQs0kJXOixVrXi+jSzgZN0bZ\r\n+3H/pesy0oLXrNk0EKyZzVzya3+j/sKrXcX4CHwAz6Vbq0DWCnA0ewkUO4xt\r\nKtVK9PSzww0lvvlFxAiVfx949XNeFiPOFaYi7Y5egOdp7vQJsNCyrKLn0rYS\r\nC/xK69yVuu50qY3CFRJaTbiBR/h67dcBQOuZiJJC1wr4zkRZmDRIOZ7SjmXI\r\n6IF8w2I4ckF/U1GcIboum5vJFs+PTZkXOt5MHUFcvHFiiQ2joOmtcw7yu0pn\r\nD4QYsxy4ANFZ4gmnxJ/Tcjux2wiHCfOtS3ggpPDcwc0VU30f/9j2e8U593n+\r\nSGxHbPah0VEN9yeY6evYT/eFmxwztqX2lBd9WyyXwG3C1muhAUXkxxwu4+Ze\r\n6xHdPHOUb+c6Mg7aL6WT/X/GdMCI5aQaaQ4++dPAtcIwIYNOlSoVYIyoMYtI\r\nTnS4IX6zePzvf0SqLEQXRjShBW/T1NuIVlKt5bvuWZueL8BejQ/4s1/mMpnt\r\nRD/RcGYUiIa+wZbtKgGqM8AASAsOh7YwQ0Q=\r\n=nx87\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"85dbccd62060d4bdea9389f5122c9233abbf79db","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-85dbcc-l4eb2xmz_1655219735940_0.5993122491116765","host":"s3://npm-registry-packages"}},"3.4.2-feature-eae38c-l4fdeq2i":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.2-feature-eae38c-l4fdeq2i","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.2-feature-eae38c-l4fdeq2i","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27aa3107406e1d9f94418722e47613119d62dfbe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.2-feature-eae38c-l4fdeq2i.tgz","fileCount":153,"integrity":"sha512-QkuZldu8LoOf7U3thfmZhQlsE7Jo8SXOVLrjhBn/sCDRHse9PY5sStxvt40bPl2XCkMRyKw254V2SHzzzVNaoA==","signatures":[{"sig":"MEQCIEngFnQ/OnDaRZDDijBbYEt922Tqx5rLVeLcAQwJT7p8AiBVzG+t3FQmtjLdkaLDbLOJ20TmKLXSAzAAJDPtuK01Kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqaGOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrxnw//XRrGGGYAzvlw9d+9B5FBNklYSmW68eyMDoxblxIFt0r3Yp2a\r\nluM/iTuGprMmF3EsIipxKHiXtFGv+QBHDmcB5vZ+RZ0DAJ9d0NwSAK7td1Jj\r\nMnCA3FY/O8BCzkAXqHpj8LV44Knw2jkD4c9MQRJpB2jLTJowv3BXWazTwIpc\r\nUYHp3YzjjlRdgnRl5mBLq3yUStZmpEhNV2a0mztZFOXCn47ufY7I+C1jOajV\r\nHIThxXPymjavXc1FREbmyKCwraqmDr9Z2Nxtxw68aDK9ZtmchybX58PbK6Gz\r\nlF5iByu+FGNTevEBMxjZ7OnAhhGYexHIYTVyT0AfNcGz1BlsV+NP555tWJgh\r\nXfEL8IFaI18CYYcARpW/p56ZBLQmAbM7Fru9uECvQBUSiK8IGfwowQiohRGZ\r\n1LxrEhqmLvqAyvEWQCEwBLUjHbkgLuIAWhAoslKWA0owMGXhJGA8AbC4OlAn\r\nZLjafNrICbOXKsFl/VMrOJqOircsCtiU2XLQ91TGnelqJ4NU2dmECiE7hIpW\r\noH117QnWk6OtbYzKQ7RaoPwyBT+vqNtgHb4nWTBwq5Thhe5xZTIOwkiw4vj3\r\nppiTYHgq2WR60Yvoe5up62iIFZg2IHQGH3gOwhhxRDXfwQ/mAMWRaEXbneiF\r\nkzNqdOXGTLExfh34241dUBRVyQgYzhOSPK8=\r\n=5t0v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"eae38c831c97664b6ed23c462201f94180123a4f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.2-feature-eae38c-l4fdeq2i_1655284110436_0.4402684646834878","host":"s3://npm-registry-packages"}},"3.4.4-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a1f521e7923e0b4c259c099f3f34e06ac625f139","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-alpha.1.tgz","fileCount":153,"integrity":"sha512-XxjabdFDnA6S0kumyK/i7v2Au3NalZlJ8zsng6aqxYBKEcKef5WlQS4J0dvCmz8eDf/dIlydTqsdAzF5Epd3ow==","signatures":[{"sig":"MEUCIQC7k45TSd3+4mkm1rNCAr68Zr1ws7LyUHLmBkMD3AAqzwIgDu+4mXIeh7zmmNN84A79eiqEXmprWYRuqdAk1VrEuG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqcLXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/fg//ffomBtsc9ekA47VZsSSwVfkLli1Q5VQ/W3XoPBrzx5QWSs2t\r\n5k1XwHo24ipfew4KewLfqjY6XaNImTp0zbyVDK4yC0bW1Dfby9Y4BSjhkn3n\r\ntMlKxaSu4qnPcm3SGZkcznDWi/fCg+hPXUN9c+kPnYrJdTqN6YQIwzR/A2nv\r\nxL+qbqUIdDkfJdXg3Cr/7Oysmm0Lr9QYmrPdLGuKtYbadxSzj68nvxUbYSVA\r\njyGdGhLkp/Is2m016FuHFl1+jONz+p5C+0sq6iGQOodpYRSEpggzqniHLpap\r\nmwVgtnxFYavSJbWl+eGI/IJUAWw0TN4sUQ49rrahc6O9vA806exw1m6rYMnt\r\nMjao+Eb089FvGCQx5ISRwh7HtqhqQ1q2uDNIQ4r4logfFlttd4iKfrOp9Apb\r\n15RtETqilgov4d3oEPWYT8U8UgJnVpMQdX/bheRLXj1Yw4FQ58a1zuLFIOlt\r\ndPsqOkvAGvjzzGH8dcksectXFqG7jqqQLAzlBFJQFoIxGmJkl1V7fZC15yBM\r\nMKw+jZueapyTqJnNZC1Fo1mRH71BblsmAzfL57JyGbi5wI/OrqJkdM+twW98\r\nw0n5ySQF8NLKpvsl45hfzMlVD6GL93H1u/di/dRIpvm6q1Hzstc7wBSFCy6s\r\nxQNmjJlRjAIb3ycQ8HQEGr+vNDlcXxxyvwk=\r\n=6QY5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"00ef3b73f4de5c66b826b10bee8955f6e2bd06e7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-alpha.1_1655292631282_0.21697148923649445","host":"s3://npm-registry-packages"}},"3.4.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7aed4b4af5aee72dcc5d970b300bbbea5ce9fefa","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4.tgz","fileCount":153,"integrity":"sha512-82b9d1zXwuNHSCRMQ+BBfTyHwEbh5XTCnpd3nYs9TISH3WRkOewvlixayU29HQx0drY5k1lycgC2gE1EGvyJcg==","signatures":[{"sig":"MEYCIQDnP+Qaaex524COdXn8Fx2dx0XZM22DN5gw/NsXVmWNWQIhANHIzqK5QkogEDMnW2CM7e5x9bFf9OW5CphO6g3Agdvz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqcLgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEow/9GX9A2/lPeUGoipwECK2zAeAKnTFRfF20GGtsxpWvFfQWRvSO\r\nTMCDlMXiaVwaD3w63qJlo64JdJgtZkLFcVPCAI5pu49PNdVKlI93hh7lbptx\r\nzjTG/KsIL/AwMmKKaj5CiReFT4OPZfM1ZK0rFN1KNgKjTDHfTw5E0aw8gmoy\r\n6xaJVgiC66rOvO2lhXmr+F+/yN7pjjKd0vRI2WTcS+VOxVu14BfsnW0RaJ1E\r\nnXRyc0huKIwBbKGqWIind8HULQLUstwKVrEvdkxlN0TlJsdgFupvyodPOYJi\r\n+sfNmLNQOtehA8kozE1aSH8+mRqd1p7U5nksMAac2Ah2l6WhjmGVobGyjPhR\r\n7XAyy1+SG+ADJgQfDNkWkRHpCikFrVg0cq0jMhCk4AdFBqDl1hsVcyfXyGRv\r\nqOM3DzvP8YjfgYJD4q1pfVWgIw6AmwawRX7PwMKIBdfBDcLFs7e4jBPEa3q5\r\nVI7RSLCXmV+wZzdByzKyTt5n0WkI1DPhAJ9PN9STngQz8v7QTFbttD9/P3Wx\r\njfpWBKbnbVOKEPB0g4zBc/Ws7JEMTY6njkVgUymcKKTZDQZ4K6kGr6gDD5Zn\r\nIYnbxpGPfJAiq7p44p2V+L3gj1tr6+RuBB3u6hcmexyz0SAmIIBRXUnfYg5R\r\n87+57GxqLGn1anEfXDMePWg/Xnf/Vc7sUXk=\r\n=6d1n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"45b244759e2a3b4b20f890ea74ffd3613232cdea","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4_1655292639787_0.31460835149850097","host":"s3://npm-registry-packages"}},"3.4.4-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8a1cd333c8c5d8b2699cfe76d73eb8e8b9ae10dd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-beta.1.tgz","fileCount":153,"integrity":"sha512-xf/rjiV7yNGNNf5lFzzdCqU2xYNr7yajf2jcm7qYUlhVuU+uYJL1s7jpDysgfaSIv5pmX9VTQZ2Gj/sCMWhsYA==","signatures":[{"sig":"MEQCICUBdw1/xaK+D/8+wzAhjEvfrhA/M4Ic+SgwNr1vWKBaAiBIXCNMVqxU43ve36v6W+VAaOxL+leCd2MUEtRKcsoQjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqcMEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRxw/+NgwZovd4p/CXcN13aFqbdP0a/WYxev8+ep+2+k1svwhBHWmj\r\n2qZXUEuss5FFuAWf3IhmvHvWIwzxLux6hh+59cWNWvGPFLwi7BDtdXMbuCwi\r\nLTygGQEwr/1lj5y0zNajCswTkIpwYWBGuSyM5GrE9MwhKklbnIN7zdLcHU1A\r\nbmhmOqm7u1C5Pk27YHgDjm00rnImd1ikWg/y26iCO4gB6ytP1X/2bDwVMkHX\r\nm+D1cRNOsb0Mh5THODvXAxNr5c8NIgL4rHviNSFWkIGL8eCXC3AZaXkEtCeh\r\nrem6q5ttOwB0jJ1r0mNilemdR5ajg+TyMsRYIYEkmonmOXuQWUCO4V8449Wd\r\n/2EX6CDbw4mQQBPnYK3T1fTncoiz+a6e2AtS7AXKRyVdNiBG09eVuX2bZtsW\r\nf3yHPN/BFJntEvynIDzNBzpAGx42oygVVK0E2J72IsXmuavSsQRrLfDd9B0P\r\nMtQZMMuxA1gvSxCapTYu5Ro4e6W3M+d4/cy61srr+JDSFPhrU6K8j8jpUlKx\r\nKwxayec7NnVuKrAJLK/6F/AAd/MRaye2Db83xjNyUJik4QdWxRd3YYGfI8yR\r\nKgSbmmZ+WdloToQF8/lh4Sw3Nst5uEcgDNzV/ZvxjzAKsgKurM6bDFByZKXH\r\nDQmHSTDcPbyJEQseSsl0U57+edWhKqlrCVo=\r\n=ULgf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7b28cd201314bfb9ddc6578f6f5f081fe0a69736","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-beta.1_1655292676228_0.7657155928515895","host":"s3://npm-registry-packages"}},"3.4.4-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"82c0a6788ad3a392b934ee897d87304d61966208","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-alpha.2.tgz","fileCount":153,"integrity":"sha512-3HXlhZHPlT5G7eprzXlEaGBvrXuVdWnGsSP5ib8wHDxfV1C9LC20trirkRG8NG3n/t8Nu/5ti+9Tll32pYmNAQ==","signatures":[{"sig":"MEUCIQDCTxwK19zexr/cOzPoQIKd6SyFtFgVP9/KU4F3iain6gIgRXESgvnd8l49QKPr5BdS/ET69hmffjNXKZ/BG6gppCA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqcM4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOcw//YhS5KrWqO4RRexU82ZhAakWFKQ8Oi+12en5vYXxy1gulLxVi\r\nUmr3TVsmEuEhSFKBoAVMRZ+p28bidSgJf2ERj22lcHgfnMfgpB7Z328ueYL4\r\nOZODPHIPgf4GOkpCYWGYlFxiPkv1feqVh6v68iG+l6RdwuJPPRt3iYB8Z4tQ\r\npuE8iEjqBT+EFoURNgntky4lXVjYrhJjTTWw/9EP5HwffTK/o27xO9smV0XM\r\nClDPQFJxW6sFYEPyEQw8ZPFPGr4u0EcGCrFAAdMBcSLwwFolgA1OcJSKyoyW\r\n2YH62yx2uXs5OLwociUT+cC3HJy/y2x/mSKZK1jyf6sylhYD0hEuhcakTgDb\r\n3phESW60Bbvs6N5T5dnJFblA83a2fbzVbGWto3LbT2BCPWAb6aNIC7B0Lwfw\r\ncjcmHxWqWp8o+OP2EdlHJcR+1PY/PtcWcXDdhgecdhZzGsdf94T5+UPcA9MO\r\n4rKjihp30TeioWuBC4EzXb/onmqqOD7KiuDgo6t+V+u/34xPbPl21bIvsAuN\r\nWZqe/Po3tuuQo/3HYM2VEa0xAd02giogVwA//KkRuhZ0dJKAbsFyrUgOooC/\r\nbrEk/0uNABYUevcaTt5khaKtq3bFfr9Kk0/baoHtFH5Wmxc0svxiX/qIsikb\r\nReKf3iFWsNOka6oBxdWR7nkxKvkfycXdfa0=\r\n=hEO6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d34536a88658304eaf1be9d1b2288539cbf2e483","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-alpha.2_1655292727957_0.30879661107205214","host":"s3://npm-registry-packages"}},"3.4.4-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"976a3dc1ea978298fbb159b47af2626ce149cb12","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-alpha.3.tgz","fileCount":153,"integrity":"sha512-ro1EIR7sOwUd6KF5BzYakY+q2tA7mrlNhsZPo+Oy32QKZB3Q8OXgBar6z0DAqn5N0kUZFmiVWeBduOX/3vM49Q==","signatures":[{"sig":"MEQCIDJThJ0HjZ0GoGXAcFI4gJJPbVJ2O3ir+ahF7+afwlmyAiAUrNb58LJknOKiIV/zVUSfKHobq5tYQmULvRq1G3UsyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqcSrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUaw//XUqs+qCVjCzk0cH/x2rVbayrxCl99v9EoHr6FDOA1wvbVLkp\r\neaiotxekcFQzA9Afa3JyfoaFk/HFw9ug5D4hhmemr2KMw+5Rop/mqUWZS8G0\r\nCa8WetPkZLnKWJ3nYnytjSaNj+B8Mx2qy4AgBStETZqRCpXRq48b+SG5PdSO\r\nDOsFrBGXxWiyMATeq5b0kJVBHoKlyXE3L94MXxAuIH65vlj/11PnRd+wMjFi\r\nKhtJhNAZaBeT4El2dCcGu6fWLLurJXYtPRqZ7bdWuPn2ACleZOiMDyW7hYUa\r\nC09mtzi32xX4HctTb/pzH6NYI5nuWbIZySduLSxI1KuFrIDsLxrDW/OeXsI2\r\nyTKvcPqqoug8A4Ypu38KVn9+WhD0uz2zxaNOurha4Hnz6S4SBmkuO+ULUoo8\r\nI2ccNRsr8Rx7EMwJZjeAwx1HMbcBwPjcKKZY2iAzzbkKBseeH/1RYqITEa1n\r\nWetRNl6wS4TEJ7xrjoW3DR9bh1X+iULN1nE+SvDCamjtyE7NnLxg8sWgBnsu\r\nJSlVYkXfYMhBjYpStrLiRfNXNtkYujwqczLd+z7JxC66cXy7DBM7aDBQSMSc\r\nj6VUBbsAQGtm/e+Cs7RAhG2AlNP36LWPPjcN28tZsql5Z87eVb7+XHafpoos\r\n6svRTQR9d+pPF4rdx6el8X5jD1xVA9MBPCY=\r\n=BeKB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"899fce3064088dd4f7655c600946d8eb67d7e722","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-alpha.3_1655293098745_0.5108165792503085","host":"s3://npm-registry-packages"}},"3.4.4-feature-b8e0d9-l4i7lwtf":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-feature-b8e0d9-l4i7lwtf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-feature-b8e0d9-l4i7lwtf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b17705870f0ba2094833a977edba499e8358ec53","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-feature-b8e0d9-l4i7lwtf.tgz","fileCount":153,"integrity":"sha512-ccAaO7xZlYQ9bdjMsiYqD7Tq6bBhRLyDRQvfloMrbSXva4RFwKevVcl2F2JDcS2eu0VzlopFQJE810ooMShpjA==","signatures":[{"sig":"MEQCIHtAMk3HwM9A9kHJj+MUGh4Tesz7easttVsPgsRln//eAiB0GvCMsKN7Bau0TdgrDN6/HX4bk+byWNqXS7FQw37q3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirEAXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrxqw//QH3kbTA0PETkERmvsakVnF4MrSsj5ScbsbZg4NksGiOiM6hi\r\nTGTbJwbRkU+0TajZZs0MS1pi4DChans1qCuQbUAQbhWSAL67FEJm07g+FJn2\r\nMISSzaynGCx0SUkUyrMEsqA7V/UFzXknEQW45HmExRdgx1tYuZvJNnjAHJCA\r\nrxHqIOZZ9/BUTbJy0FXgITiF0fkGMBPy+ih8TSwUD2l92aQZIpTOqOC4nuPZ\r\nLBFzdTddh5QEAvfF0uZFgJ+L0Esh4t8rSfeo7Zz0+oy/rOTN6e+vXlA2jkvS\r\nYPFqCANcY/9ckEcvdN1zotCEieUny/1/XFuSUVRJxD3ejWGPt3vbLsFvxTir\r\nle9O0ap6HgnR+2hUz3gFerPQzVdI6HhNhZ70Hg7wyG5CApuCaUSv/f0Y/P9p\r\nKFTmW6hGUR9q8Uncr9U5fy7iU2s8L9bAevTTybcW3L5S24GUtjv89L86GWhg\r\nhrIQsjuUdpEU2I6+DgJzyM5Uo1g34FDpFTM/57q+vE+JcuwGojjl8INGLVYE\r\n3Bb/5WCab5+qZVH+xroDn2xDZBwMvf20X7ljMuBltHJFvOb6qfYp/FcNjF0h\r\nWRiTj3ZtARce57m39y+kMpnVqz8nwSVVsZmBiY3lmhHdSZ18od8Jc+YP7wji\r\nt+4drEKIw9HJOYyPLCflTZicdV9o6liGlkA=\r\n=Vhx6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b8e0d9a01210604a0aef4cffd6aa803718e8d435","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_error_details_to_external_task_bpmn_errors"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-feature-b8e0d9-l4i7lwtf_1655455767572_0.329621631097309","host":"s3://npm-registry-packages"}},"3.4.4-feature-e849e1-l4i96hjf":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-feature-e849e1-l4i96hjf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-feature-e849e1-l4i96hjf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5cd01061b262ac18725ddf09a27387d4b03cf113","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-feature-e849e1-l4i96hjf.tgz","fileCount":153,"integrity":"sha512-RgIZ54acLy6lWxN86WufhooXgiIyU5KTgvuZbBe1DQUWXOIv4LpjmhKjKOg2DXw+7r37qw3cTuFZFSjf66Pa2A==","signatures":[{"sig":"MEUCIAQ1zJXYJpyNc/fPN43obSRlqx1cCcRh4KrFYIBwnmoTAiEA8cWVnMBRRMCzWZbDtvS1HggK0CFXlKKjYaXQEun0ZvM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirEpmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDzg/+NheFFoqn5IAObvrU2SYnj7cwZiQgnwQXf3dXGv/FU/DF41x6\r\n5ZItDPSeL9lNMi8jMXfyk0F2CBHgS0DuBxyZrp7WzbTlpAIojou616+lkEKj\r\nR99uylPMmErIjrjg3bvcQrAO/k89wHUfv1NMPiPXCK0rC/oCHHyUMBZpLDpV\r\niD9GkvYePs6sAFpUjBKk8b8eRQRYFiqPg4dTKFANJ1FEm+31OvoRgPFlbDZn\r\nLU6izp0AYCcJ1AILXAUZQ4QzM96RyPjnaQi4UBi1E96aP0I8igSMF65FNJtg\r\nl4ukF0rsAC8Yy+dZdm14YGx7c5GVl8oc/+GTeX7sABWS1OVDfXQqTPywpRMJ\r\nCQpirKG7IxYAVObPMDIbKSuSyeJTcYwIx1S0iUddrf220As2i4ok1uN5RfJj\r\nzDovIqZeaBDr6zAnOsLvZjK0Xhi7SxhLijpljnpJP/w6xL1RpOT7lcwa4+/F\r\n0l2PhcLE+ETCJuHPgtdtNo4gTRaayysQxZdYFqC//l/ytsbQHemUaKwi3CkE\r\nP8p430pEfdRfERD2/IfdU6kMZF838OxRIB2QBVWGB++ZBnSjCDa/RZmBI3LS\r\nsYhirln8znqPYr/OV7MoeXVUvTuNgE+lNNjYS7RrlwvZRcimLnUo0Wa21y2w\r\nUat6xV5i4Bb1DL7YKSsLtBjL7+hmMLQkD1w=\r\n=77H3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e849e164373eb560d6c8fab342e194b38e03a153","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-feature-e849e1-l4i96hjf_1655458405894_0.6973506607573328","host":"s3://npm-registry-packages"}},"3.4.4-feature-4590df-l4i9owk7":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-feature-4590df-l4i9owk7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-feature-4590df-l4i9owk7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c153b9cce45344a0c9d3e8b6e99740c5cacdadcb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-feature-4590df-l4i9owk7.tgz","fileCount":153,"integrity":"sha512-FNG/aKrzmr7fNr2gC6Az/lPZsfLQT5E9Zj78kawQLOslrcOkUcHmzKAPnxFCPGDYZEE68jyIFI8YsZXg5F4VMg==","signatures":[{"sig":"MEUCIQD/NLt9kNV1GSH4DDlH+C6fwYhf4GMBxdGYB9NQlW96mgIgKrKK6MYEpdEUSJgYGWQ/a4iShRxXvbDyLalPTk1XA2g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirE3BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2/A//dj/DDQOjwCcH68JMAt7UMiOuj95vNcyHU5zLbzOgw1ObeQ/N\r\n/nCsCkAIRvf1H545SizeUY6d+KH1G5dHhI9ydVU5aZtAngTkXWTEmCJImjMF\r\n2vnJjuh+AoynXiD544huKu8Yuy0QCv/9aP79qLs8NKoWPS7mb0EPYmYTrM0/\r\nxV48014d9MMXBT37nh8rp7VeWBVI4l2EEexnzqK4b6S+US5/WAzsJRGSEIXo\r\n4GV8wqFZ48HKNcPWPYV02LGHqngYL3qZ1OyNL+1fv8id1bQLwbobvZpBCZ1N\r\naDQEPB3E+6326H1MCsncIsYsrJSdkxQLlIsic5KoB7FU3ZKzQHIO+0KsKQzE\r\nzWeihhxvri79mm94bQRioG9EzVUbqSqLGx1JbEC9KmkncCw+NylDNO/uVb/Q\r\njXcstW9sQV/7gWFle84I/rmLmQGXLdrHtJOomIG3uOuPIzPjXjTaeVkyKfDa\r\n3QPt3jgrRz49HuZYH/o1o15F/Z4p7CtL3NgUvLxze94L4+ksl9+8NrTpMdJv\r\n4yee9v/AwJTROmtyqlaSKnIFKjKkWeB+N1JQNEQpHKilb1rmdWVS1mfrpqOQ\r\ncPCOwd/GoSCqZYFko/maWCHduXY7gd1ZsNHvRCGou/xdoRL+UpATMP2gNkc7\r\nxooHBoZeOcz8Ska7L9q6fO9pUvBT6ZO01rk=\r\n=xT8G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4590dfd8117ff0b5680eff8a79b536e3fd0dcbb0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-feature-4590df-l4i9owk7_1655459265664_0.5051129984229239","host":"s3://npm-registry-packages"}},"3.4.4-feature-21d69b-l4ib29rm":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-feature-21d69b-l4ib29rm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-feature-21d69b-l4ib29rm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bef15e8cbcc532ee7efff31f2d85d7d9e97f3678","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-feature-21d69b-l4ib29rm.tgz","fileCount":153,"integrity":"sha512-Zmtk072cnCahP8WUR2JDICt3CUHmyVkI/aP4RjCFp6BFYYuQ7iigDfw/H/Kt0hYPWPKdwF76YnNOlqA5dNhO9g==","signatures":[{"sig":"MEUCIQCT95SYHqckct4bMWDFY25UlQ+yyf2MUTGLhpTFKL45cQIgQLAkkSSQgtp/tfysjydyFk9+v72jWmDTFqujApL2hJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirFbEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrc4A//fGywmlPb7/geqWE5IrYJffaKgl3GADIc5IMRRY1nB8r41SYV\r\nkX/QKhpWZkU2GMZSKBIJ6kV7KUAS8hx/i4yvnkzmTXaN8NJkszCp4IC62PvD\r\nnofNZyJ5xjCPWrztRlFLfHbhOLnk9nX1wYYHg3ZneyindIRluPbH8PUand9y\r\nxKwROLW82IDIgkkj5+8OsZsfEzSl6UnGQCslzKqcDh0ReXi44fiTuEQigeYc\r\nuZX1TWKvbqMW+qiFORDRJsomxHQWrS8c7JqBabQO6Q5v9Ux13H6ds05CTQkg\r\nvHj2lf/X357c9gY0ccNv9xpKYQJqS7tHP/jwknep2cOeeSADlcqAYTs3H9B2\r\nOPVcKvH3PAyFbVoaPOzYaXHekpWTIeupZ9KHQglrmDLDCKrV/iyi4NMi7czL\r\nwZt2kyTQk24MY6ESw3HYOTxTw3VWJkRn2+Bfgv+Kkdf53rCFMZ4FTDpzL4D0\r\nv+9a78d1tRF4AP/HG1cx8uXxA/sMbW+GgCnkMkenNrATjA0SIZMnXL+TrP55\r\nLBT09jsMqUe+7F6s/7k73dl6PVgR1s9pHN9Oedgeh42B9dsA5RqjTnJlCCg3\r\np8lz6szNshadOlulxODRcsjBilvfrTN8Mpw0OkkpqJre44xyKgXk/O0LekuV\r\nn/o3sOxXb+/5sH6Is2YbyMxd2vsKoPGjOJ0=\r\n=gFsE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"21d69b200a96ec4fd7ab098bad1ff7151f43822f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-feature-21d69b-l4ib29rm_1655461572544_0.2555880627296907","host":"s3://npm-registry-packages"}},"3.4.4-feature-893523-l4icg445":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-feature-893523-l4icg445","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-feature-893523-l4icg445","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ec2818420ad56046c35b9b8e6f4129d5ffc08475","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-feature-893523-l4icg445.tgz","fileCount":153,"integrity":"sha512-gGEGO3qs2K+AfSRLPOefkc9Eipi4F5n4G3JLl2rWBEWBKv26w8hRTTBCePGTWc5YGfPm3EoZTa9bRm9v0dAiEg==","signatures":[{"sig":"MEYCIQDlcH4952zt0qKyYFc9PGRnR6Hz3xPmssaG69b+4Gp09wIhAMNHqZvoPmC9BDrtWvqyFQkxwHkfPK5WWkhFys2lv9Lf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirF/ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6Aw//S+UwxE38BXrODPAMo9K9YFx9tThdfsvheDni4QH5U/lFMb9h\r\nkENzknwPqA3A2j1ux4oSG7pNhDih+pIF/lbI26PXR+l94NZcrfl7WeIG4m82\r\nkDP1zYv1oDuVA/9CHNIp9a1K5/LOTGkYF5YzEv3OwEttR9IeLcJnQzI6p2MF\r\nHpmdX4Km189k7bY7fKl4aXuTymKPpPFNckZVGxgt4F7CTk14gQ8RAHntQgg0\r\neLdR+Lr8bcvCdtrTHBwlOp77AnBVmPnHGQXM5fH7WsjaUq7TORJCOS2T+eu8\r\n5JcAkLyiOAmTqvHQT0OBUIrytuPBU5dmSnM9b4DIuxhkqHEC7GaQO57ZVz/3\r\nHHOUeAaQaO6VzsCufZpy3VtBsWDiyQzQG1E4wUsPo2DLhpkQpsnh/ntnIrbj\r\nIJ7q4iQbdriPVjXF63BNFnocJY+FfLRlYnzXkHmffzQ5mWp1YQVe82M9jX4g\r\noMhBdkmanGsE2qhECYbBSuiO2MX7PUs1RY8VKmD9FQTcqghPawBTC/0MbpQ+\r\nP8Wzi0W0u9lny9DkQm1PVHkSEgjy1iEfkmRbF16gi45uoqbcxQgAuLAusLbW\r\nVIVLJMRuKnj6H0wvv4ok7wbjpK4MIuye2FJbMrQY56p1hNOISH5eMMy/iWR/\r\nuQrFL7CqRq5SXpjLC9tLXwGEti+/4LGxFIk=\r\n=vgZ1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"89352324b2437919d304c5826f48d351b6f438ba","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-feature-893523-l4icg445_1655463897140_0.023589533714551303","host":"s3://npm-registry-packages"}},"3.4.4-feature-9c1a06-l4ijnrxi":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.4-feature-9c1a06-l4ijnrxi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.4-feature-9c1a06-l4ijnrxi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ab8dc37e1e4e0e366fa8b4980cb65dff1a50712d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.4-feature-9c1a06-l4ijnrxi.tgz","fileCount":153,"integrity":"sha512-/hqbJ2zQCSDTrWEKVgv/XMbdstVdlxw5zfdCGmYJzTJANGETggKjrBduo7gqcwpF3m95CCYFiFd642y0brkJqg==","signatures":[{"sig":"MEUCIHDTncfBnFnqo97/9JS5SlSDGUpvGarAFyyLFVTIwk1qAiEA6rldGW38f/9h7Q2lQSkPVJ/X15JurU0QOjgELpuQD9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirI8pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocrQ/+K/2xY8ue9etZ0RvjyZP4vZsbYxsbxzIDISvR6ZxH64j/Apc2\r\n76EFEDcu2RzgK9lE9jQjROLMpBMg93tSo9wG9G14gTtTwTEVk+UYm+JECKzK\r\nVV4Sk6phDUrx8Zph/iyjXjIYZe9B2+WwQxXotrFzCpVgr617Z5QgMlNVErYN\r\n0LLACnoQqecfUPRTl3QVxV47O0WeqR5fxKF3gNK7jj6XC0Zdwz3Fi0TA16Qy\r\nO+q6PNjADCfuid3dmHzn72HwpVyKXpFSfqEwSI7F0gxmEEW5OF2+x8S3epp/\r\nOKPEnRm1ytAOPuqupYUoAcutBiqvoirbJTnq+qhhciHZjMA8+6P4uGNoGT0f\r\np/5DXj17Q/GGnWk5l2nocFWmo5UyL2Bp/+6WVO1+oQuZfDLNfuoYwONelSV4\r\nxIVG39aWGb3W1m4dMcjs6IvAxUsIVLbpb2+XhA/q9CEAOTX6wNFptUbrhfSW\r\ny0uHwQrsKtEk9Ad5pWTZyLNOpUjYhaIDIMX6umv+lsErq2nFWSy2orI60kXJ\r\n0roA+j6r4ti3YsEyOdfKasEFRhmYPobuO6ErHId3Lb4z5cyLdvJsbkrboxlN\r\nmQweiOwwYozHWQBARS0NIgsuzkbhNVJBouRiurlH8rAuW/zu02HPZQ9xXjJI\r\nvsmxxdTJvM1nyaVkSuFN277UeW2n3yjOLIU=\r\n=imA9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9c1a0692147699b64c8f10edbdf4763a1a9690e5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_process_model_name_to_middleware_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.4-feature-9c1a06-l4ijnrxi_1655476009291_0.4385202120814877","host":"s3://npm-registry-packages"}},"3.4.5-hotfix-ef6186-l4mf7kwy":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.5-hotfix-ef6186-l4mf7kwy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.5-hotfix-ef6186-l4mf7kwy","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d91e83e25d049a9bfdeda8e1eabc6c38236f76c0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.5-hotfix-ef6186-l4mf7kwy.tgz","fileCount":153,"integrity":"sha512-hriWF3E3c7MXGFwAa8HL/T8RAnKpdEfl7X3YTe5MVDnQz0NngOyKzQd7nGlf4+UhMBzGI5PUz6Vjq18LWelD1Q==","signatures":[{"sig":"MEYCIQCliD6m4dDbcIoAH/ibMQp1LtNaxA1VoQMTgSz67LB6rwIhAOE6oHbvwXGvFQ3MK39DGFkrqqW/vl77tK84yv/yCEz7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCK/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGlQ/8CXs5qtVaYNJ62PW9hdK/ymsGrCDr4oUx4O7FMG8BKaoHX3n3\r\nq3+asMmVRqBwc5xEQASz6/jXdUrc6j1lwXdMPzuaE7LpBU5cA3Ar7SiHnrvt\r\ntQXFAeiwF9hAmqdP6vrK3TwGOjTBI0fjyl5PM+JckOjwPenHzWIMyY4aO8AN\r\nMHIfUVCTPQC2PtvJJHl3C9xrUhUps7O/7Mf1fXYs2aDpn/YbmOeRhYDajgUV\r\n390nfbeAhrJsh/rNxdGVOFjCmmGh0YMaoQoqO/r18nCgc9MrOKl/koYba4+5\r\n7f9zrYWjYLpwiuSYsnaaoUv357vsZVLxRilOHgGekIPWZzAFjRtIdedTUdXo\r\nv+ugjnR9W6VK6SPVuA3WIjP9/UeB1xh+7SPKOqefLRbDaGcLHvMmCt4LF4kX\r\nVag4+/F68lGpjVvY+GeHgqX93qI781UkrGgrCWgNvSwF4PhIY8NUT1NQAt8f\r\nLK7z2U3vdj8+Eu2aZ/HEQ+UXXzqkUIpOM+PkiuQ7MgaDj0H7rRdpaB11SC49\r\ndugW8mvJS7pbigl6ocPlJ03pGeuiWiuAB7xaSGI6ndAYgnKZ7ABKM+2PMLrE\r\nrA3XUfoN5SUuo29R44J+/uRrE6nfoRdqQL7PoOmBiLQ0IftMtjuFLutDCxEt\r\ncR7gfb0vmsngc8FbrfTqGLhu5ic/AHhOi/A=\r\n=+WuN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ef618665bccf94cabf0aa240ccd754d49bf0d38d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.5-hotfix-ef6186-l4mf7kwy_1655710399183_0.4974669392087867","host":"s3://npm-registry-packages"}},"3.4.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.4.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.4.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fb2ec8fc74ac299bb143590b27c882b13d9e5b56","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.4.5.tgz","fileCount":153,"integrity":"sha512-ekINIydD71jjPeaMC3ABi4hBiiDZ5l7RMXwWkAH/xegWz4u0kB1V3dDSaptkrORyZRIddRSHjnFWt1OwINHr8A==","signatures":[{"sig":"MEQCIAymAOFVMR27JDZ7VhixmO94jrY8AOsqasPFYo2AfLMQAiAvxQ0/7pMa414XUZrfQ3qbwRRqncIgOn5G7yIOwhptpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCNNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoUhAAmEYafUiCC/OGWyGjNiSgWoMEiMeEUErAso2IeuUWmqZdExsD\r\nvUkBmU5I9qrgjEJ0EbtEDG/HJUf05zACoulHf/7tpICu1O0ZXfJM5gc6XPj1\r\n+uZTbzZ+5IUzdzp8ncED8t3PwwDztMjhL+r/qzIkBszPoJTo0UxMZ8L6MzIo\r\nyofwR0MySdAZVGqOA8qMXE54n1e3Cmv2U61X7jjZc0X9AFiKBz4vnoPWVFMk\r\npCMC2PwFAE+qoWhbJLfsui6vscF7IcNzAI20mCgD8qvkWA5mFwxKK9ckt8dG\r\n028I67+BHZghS8Gb6lynL/nL9MNh/YeutiV+cAHNbxNVy66xOZs9pMEuZP/9\r\nHt/skdkVpTPJP6NGYtZ7+124O6jCsXrXMG72TFZBr700tbaVZAyYiNzgpIRM\r\nrojiaS+rCybXIaguTehifMMS6JLo0kPDaZn6KLmMJfqk0feavRrSHUntQl5C\r\n8HRFLHb/hiTZpGdKtsh+ZUu32nyWK6UP/9eArYGZ4rVk+qH5zZAlowniVF1I\r\nOkhRp4SfNzwfV7dEUWPOT9KuyfisYWMemjjRer6bL7zHPxQOX00pSdZ0qcjx\r\nQqOZRlGKG2ih0s93hGktF/hANigX64fv6EohF9PmEXoIYVIbaTlSRVzLFUnX\r\noRETKZcqfbCsYUtu/KJvBVck3EJehxaDwnw=\r\n=ZuQb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"750e84feee5151100b0d034d120a9deb1ccbca17","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.4.5_1655710541277_0.24065822880001075","host":"s3://npm-registry-packages"}},"3.5.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3be83bd8e1d54ecdf474862ad97ad93b85975379","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-lXI9PdH1cjKk9TUzdAOPdNFn/h13ZdqU2JK8GjrOVmculcNMeCathpVeoBNMMxIq+PaQrD7y0Tk06/X6NcXLZg==","signatures":[{"sig":"MEUCIF+KSYXQeBnXvFfwdJE26YONS5JWS7zZVyJpXpDL9qmcAiEA562m9tY8UnKO2H6hAPexWxFTWLbVOA3xwzFFKrQ/6I8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCbKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5JQ//SpjUV8bxOl6f9FpE0x7EqF3VQ+2EtbHPytXC/rmQrGR3eUfz\r\ncZyCQ74QVU9ejwxNI8qUiqG7WcepgPRTy0CiuTRf2DaEHf74f0a9AA6dXhp8\r\nDGPNCm+sYGU7YjTH7teSXZCE/bGseCTFjDSEwj7IcbFB+4VnkzmlOAIJEQUm\r\nhPMs6S2p6VgH3JuuTOA4FlvD4hFNeaTwsGq2I8ax9kvuGl/JlHBhck35SX9h\r\ng65dlMqwAGpl90U4ykV7IEB8zb69RoiTvlY0GIwCnsMPA1OIyr9yYGvuKerz\r\n+yUsEAHUTdtqoaI2FyvE8v+p5mASmM+Cd+NZxXeqQt6KOYR8sgLDQKnLHz+P\r\n06/fqXHbogOToVKp4jPLNXDSLflh73j4/K7re1h7WVkdAUo3m/2Fzh7OC1e/\r\n3B2TADG9TCnMXrJw4CBSGU5iN+KpRp9FVgwixjcRnQNmU9S3Py5n4RzmWYfy\r\n0P/RTCNJvLvXMjfFGTWKPYiJDEH2izgFqdNX6JETM7dmb+M4zDs072u/VtMf\r\n99m1LA3YVQhCbydn5BriYAZKMbabltKGnbOhUNOH0ZDncc9aipakyTQVLg1X\r\nUWrNVW02wfKTfQsj9HcQ9h5Y0KHoxo4lbMQHEEo0qzpkxWbMyvfJPUHJB+Jh\r\nyMN2NvgSsCRlEbqw73v0xlUeWKx2tAFoJwA=\r\n=xTwm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4cb39de09e97745a8dea6472f9c8884fe6c20458","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.1_1655711434488_0.9323413408299317","host":"s3://npm-registry-packages"}},"3.5.0-feature-9d6ac8-l4mg6ho5":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-9d6ac8-l4mg6ho5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-9d6ac8-l4mg6ho5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c389fad9b50dc88a093b926ac2c60417cef3f1c9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-9d6ac8-l4mg6ho5.tgz","fileCount":153,"integrity":"sha512-DVKJ2gOYI4hJukgxc3L9YPvzQkIO4Lfm8Pg9T/n8Tj/jNUpFoIIgRX7bH/2UV+Ds++7/B8uXkBbAUrD43gn7mg==","signatures":[{"sig":"MEUCIQCu3+O0x9JZ6uSKIsMi0gLYeJRbNAtdE2uvkFEcgNl1qAIgWJP6sl9nkY9bjVvK3WS5jK/HiE1J21f4E9ZMEjGy/Jc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCkaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqE6A/+KpUmy9mGiC5owA3SbrAoangQVhYbXW8YmGaJhGPAeyUhAmG+\r\nBhkjEhU+dZ7nvza94laNpJ7n1cwsvNIGIqs8awPm0oU4is/RrSnzbecBke+T\r\nmO9bsdhGqQ1z5iHmRDC/uf4P6n9TWw4plKONvYclpbUvkhbKO9g9eHrFSGtg\r\nPwpZCKpnKRouYL7YPlBiQuNVN2w8m7hAHU8xGoONjsenpD+t+Y28Lq7UAp9L\r\nGQ3ZeYB/IRmKQqrpthY9gBBer7lPFSfkYi6gqsGWiHZaxZTvsla+YaB2lb0g\r\nNdKwQ0n0C+Pf/fe4XvilgrBvU8+wBdR45zb737PkV56hVEc/GqU/2KmXhz4Z\r\naj7N57OHjei7xHRZcUpRcOmbqakPqsTn1eRn8t1vCG75EAS7L4CEKiaXws8m\r\nUdB+TbYd4pmEQcdK4BEQ8UAbcKHsJeI1UPXv+UU0AyjFFI0QDjY9PRND50G9\r\nHCJhQzGIIAReqn8uo7bILwuc9JdnI2X6KSJvhviQFrHM/yvNvte/53isLYHt\r\nmseC/9+XJYT1cpO1U17PVVIUubiKgO8W2pZIsO6uA6B6197vORNRPDmTu1y5\r\nwBVpYikUh+aq8lC83Y/5NQ6Ia0gggKM7zcj/QbTJK1sy1ZkDkPWkRaGcsTnj\r\n6n84hdWQkEX1VbabffPrN8ZQlAY7tKTrtAE=\r\n=b5q7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9d6ac89fbf26a65242978bd47aeeffea4c1936cb","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-9d6ac8-l4mg6ho5_1655712026770_0.44086665984168527","host":"s3://npm-registry-packages"}},"3.5.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"164753ccb9fb8bd327e0ce608e366720cff6496f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.2.tgz","fileCount":153,"integrity":"sha512-LTteJDuVrudHzC+bFrg8OR2AfiNy72vDsWcnu6ZMZq4LJyp0sMrvkFbE1GMW5qySiZi0/Jjo5ZgRScLzvHDLyQ==","signatures":[{"sig":"MEUCIFoNdGtoB+9K4VFJibp//qzxHqfOfNo5En23KWT9XeyhAiEAgnXnNVzD1d2oojBkpsvsBOGoEXMVfSCW6SqLc2KgPPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisClzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5YA/+JfSKbcUwQwreID7AmMFbmpo1VC+GefUJfqiMJ3meu6ogpgqd\r\nSJW9K/JPFX8vmLWOzicwMP2kZXEZH208Mp9yPKLLKvIbU+ag5NWeldaFqar4\r\nnQIlNtc5mVDSplyGaVkCiatVxz+wG6a7hFKSZMF9GUTPd6YVXSBcOGxmkV91\r\nPsqSlsxjAZroP+BdFeEbJQCcQ71/x+9sCLYO4IiU+tPyVtMz7vENVEvwzpRS\r\niVkX9EFcxa1vOodDB9kyq9gQqt8TRSxxlqlUafiN0zmbojPV6k0aKs4uLHcB\r\n06MEXltidexLu7VmzJViujPsdlujsGcfRp2Og8eTuVNsnOCwAtjX3vbahoo7\r\nVk6l0goTjrmHXt6D0KAY0p8p97Pu1k5iSCesnJoXDMFwnCN//+bqW9GD+ilt\r\nheTTL+6BkA7XgPfslD0Hvp/KO6qF3uMkGqvfdy4jncKWYvjDG3AL5k4U7OrG\r\ne2YjfN43eDv1C1CAialcmklGZONOej0wIX0SBYd1gJwWqBlcnbQsk82r/CLV\r\neta4fkWW7hGB3JNlKiYBAjSBD08x5l/n6G7CnsYm0aVj/q2Hp0zO04M1V7bc\r\nCihcuCHfGmtkF/NY0miUsgt2JTU+QGGMsiCUAef9QpjSCxYXmKyl7T0OUn3b\r\nJ2FZfMUudsp499k8GmZcWmK4MCi2TMFeDYE=\r\n=9hSm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"90823761d1dfb2ddae35769e456d70dc1ae8fd67","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.2_1655712115168_0.9335607722270689","host":"s3://npm-registry-packages"}},"3.5.0-feature-13e482-l4mgnqj3":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-13e482-l4mgnqj3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-13e482-l4mgnqj3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fed69dd7dd18518dfa6f6f80fc1825638f0e64d9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-13e482-l4mgnqj3.tgz","fileCount":153,"integrity":"sha512-Rc6dozJgVCg92fiGmu0EIfB1IuqHTJGUGHl5zOCn/JCBVUwU+GScpkVs+Rv453tIgXBL1IwPed5o14mKa5VuMA==","signatures":[{"sig":"MEUCIBjAj6oZFv+XE6VdI42/x9g0Ch+oDPcsMgBjzIBk9q6iAiEAiDozayBVz087JgxsN8GcmfBzzy1W6RU3CeHdQglXuQQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCxGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKGRAAgqXE6JqQjj2nKayuuWs27mRAMYftYo1BfIYrDdEdbBGeqWvP\r\nxLBd1ENxSmczg+uU2I77RmGFULZ6SAhI5zikvMRw0MAN/n4JU53AgVMDGB8C\r\nuYn5tkjQ4ETdeRSgs0/2seUSu356NspLh6EMIPftwgh5O4w5WdVvAxzXq7tB\r\neGlKrdH26B9iqh58zZ/IVozy5YdWd+zNWblt28PlAkPJlYQmeY4kjD5VZAI1\r\ny1ePmeN9lsegLQyOpn86Jin2/mDNwdwdtruTqFkDgpaOivNCACC8DBO7OHNB\r\nmD8Vr9D4Dz9Jjyu/L5sBfF8F+09OmCBOYXE1H0iM/Q2/3xL/5cHGEH/O1Qxu\r\nSKCkFqf/K9Mo13IprpC/7bVHKXaWP8nrOHgswBjQb3mzDeEk+0Vo5uSMBL98\r\nXKir5Sr9JDoAF67T7pCKWKLs3CzMPtddgIV7+OIJ6TC6rIpS0yWz36dhAw23\r\nIPn6ppp/QvJol14W6eWmBMSIfMS8MjK2thsAH195pitsZ5C0H6BXP2Retfjt\r\nTNdT5PnK+Z5vEg/2Z1afiEY0ATt8eu4ZYZDI5uHqwNm5PnCmvAHL6CJU6Ifr\r\nBNKgRTQE9ziIR8X1pn5PQgLvi9L9bGcwPQAo1K4I1/Ev9El387jIQrz/OCWx\r\n2GgUe9fO77VeJvMT/JdhzDgVol5HJyP8mxA=\r\n=dxa7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"13e48235c1ba95692734d95bd78784cc0ad40dfc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-13e482-l4mgnqj3_1655712838132_0.09446824687639577","host":"s3://npm-registry-packages"}},"3.5.0-feature-c2e797-l4mgoiux":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-c2e797-l4mgoiux","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-c2e797-l4mgoiux","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c7a1113c6efb7b57069a25630f829cdc871eb8ab","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-c2e797-l4mgoiux.tgz","fileCount":153,"integrity":"sha512-mEYDyyiNUAd7VkDm2OJlu9mP4teWgXLH7+vH7mzCJ5wRnD75zEKwlLVKBlnkqtIUod3f7+c8vGAGDezZwLVhdQ==","signatures":[{"sig":"MEUCIGTZTxMXor5O2eokRWQTSk+yetQ9u0iNlMNEB5X1nqRJAiEAshyWSJnOooV0klnNkhAll64THO36Eh6UM7txC2Jiep8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCxpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3NQ//W1kP/ti0Pr4pAgLRcIGj3kgQXqd4SvgsJjcvnEMCWoRpd6Gh\r\n2BYhPBr8twTSBw4VMc4dsYVIa853kMmwF5DsZBV/s5ahi1+d4SJj4OFCFsTv\r\nf6aUotMWkff5gdk7xewkHGH/X6UruYTEwyvdomuQK1iQrgbTWGE5Nx19qX2s\r\nKyPQrbVv+3ScCZCjyzGoxvAait87uVIyb23JVeSErMDqWrpZ2Kx9dcXnZDqM\r\npnWTigrHvdJ6VmU1Zx3QYIv1rwat1mKERnJ0HXUn8oHphOaUnBhJsRDLfNDp\r\nXE1cpef5SNhhPdpzKcNMQyV/JH8ZKKzY8c7lqzopPbUkayUnvxFj/xRgQHdh\r\nfb0+8E2BxTaRXfcHXpRTOpXRmy1ZCHSVWH1nI2SHkmFmuApU4paEQzB2NYYR\r\n6wkhwrHNtWNrb7bjlurJjLDTcdL5PnsLydB+bN/wqnAg911F/YZw2FMt4HXw\r\ntfQCmpmxl//Vf92E52kwfquA/rVjsDZVWOekVw5G9PgZWGMCWlS6nP8LZN1T\r\nakcrb6R8XUFWeJSXZRDa6cLBtfanmW+k56zYESUa74POxvcpdQm4v9bd38za\r\n+Py1ZCpprwYo0Z4tgavP8r/RW0ogZbj4Q3tD8d57w4cF8nAmCAOkRzlnL+06\r\nnYHLi7cWJND3RuDS32RqFQD3/9q4hLoyxKs=\r\n=Wh/f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c2e797d980c31f591b8acc157d5bb2f308ce0787","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-c2e797-l4mgoiux_1655712872957_0.8561785875603969","host":"s3://npm-registry-packages"}},"3.5.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7cb270441767c257f0b9f503888cc74c9516f68e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.3.tgz","fileCount":153,"integrity":"sha512-Qbel43NAPZNUP+ad8uqbH6uF2JxWlGt/IcBztktYVyInKz8wHkfVP0OLPO3VFrDOWAK8j/6VRfhsaQ2QvThgEw==","signatures":[{"sig":"MEUCIANZvvSlTU2jOiEOWgwCwZHHP7rf6xY3t+E9wwbEApTpAiEAiOKDv9Qt1CGoSxJPEeuRUylemJIZ9xQVJAH3h7+2u1k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisCypACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMNA/8CDEL4bsVORYQHZRq6J3vjPrpu5V8YCtAFSksR5K+hScEsP3v\r\nacwP1btFZLLa+UZppAoT0h1qclfz/pXU11oa8CAN6t4Vgj2/YYjAeCNjBFm6\r\nK+owrO21LDNcQyXWpPcOgOXlvpuwcMX0/7JCx185p8caea7wGkN+/0FC9JHM\r\n80fcQcIEu7n2CLty6ZmGlnakoXSX41+A+7uEz36UiQNO+ED58nA7m7X2ejDj\r\nhWZNr5Icb5LsFqYK71rYvne8dryN7FfUPQznf611b6/EEkeolzf7glMS8ebb\r\n3Eu96sTr+oQiytpceVZ3drjY1NkpGWnFkoXOOsuU77UcJqouBsY14DKYvkor\r\nR+rgLaNrSftIQ7pkHwgahHdmDQ0C14rUekCjnIfWje8Y9R9F+Ze4v+Q3nh9M\r\nnZg34vVsoMXb8DIqSQaQ6WYPns+3e8RRGgUukE7c6/LS+k5UP8cCeQv2c1g1\r\nvvvltZoxrh+OfKHWTnrTGj4nOW86nQD9VemzrG1614yUnoUFYs4Qo6MzW9Op\r\noS/L5jSQlxr5PoTIKYQNaWJSH7P6C3l1oJXmUAdFA+YxCCV0M3ivYJQ33w+p\r\nPXMKgXnmmnfgti92pQn0w7dDm6TBYiLkVkoz/MmlXnm2SaPhFEqmZJmMZEix\r\njOVt6kOqPRLdPtkQ9iofIElSoVoLsq68k/k=\r\n=KPvl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"12e380324b13f54dd97acc67d7591e8dfb194d66","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.3_1655712937377_0.6299954007260018","host":"s3://npm-registry-packages"}},"3.5.0-feature-e23d59-l4mh1bks":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-e23d59-l4mh1bks","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-e23d59-l4mh1bks","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cde892871608ddbe5367fcab10269e00433c3662","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-e23d59-l4mh1bks.tgz","fileCount":153,"integrity":"sha512-3DIC0bd6nmW6gmUnFezARNmUTMvYgyD/fwYOJkDSMKKPQjbeO6kYPy2Jvz3r4mNwxTfKW3fX/97lt35o0fctTg==","signatures":[{"sig":"MEQCIFZEGSKnZBuwJoNYET2w3r4SMel/1j8EmfmvQpZxhFaWAiBlc0MZ4ea9P+gAIM8qplVTlp3R8UzH+InudEvVFhb64w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisC67ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuNg/+Na7lrEFW/DEaf+27VtAjdApvMb+dDBX+HcqzzQ1h2GHZjjF1\r\ncSevCYvlCt6pYZSMyEdG2sDm2je+GySbyWo02uZ7+kpwll7vc5FIaqLUNogn\r\n4OB2MLEBY/FyY7JrVX9gK33IRouerbCYL+oswizECvDi77SCPbPU5qk8JBal\r\n6ng/eHhZCwHywQ2zelgWNw9nvHyWUsapgwUDTFJ+9RP1KnStwd4/235vlJJo\r\njYy0ZMGuv6+gFhNWDOmLEr5G74OrzwbhPNwsr3EZ8raPiKgrX3OP3UJeAX+r\r\nMFL1eklAyfgFoxrKaTlCWzUC2vN6VRmRXZehqRSY7QZFfO5RfMqJKYdVVcTx\r\nbrM1Qm4D/18cnPsTeYboRV+HQNJU+3f+9qJnxx0ZhcwGuv0CkcV02KdUCFLM\r\nPutdqcMR1QwyBUT/ygaSQddKrZtx+yoA1EmD+O2sa1/D7BWar0TCBmlvkGv/\r\nJk/8SnbHfGHVhhBP2L4GwjvyW0/yCaqF+g+goHqmbtZoA3fIUlJrC8CrEBiF\r\ndSS+nvYstLEwzvg2o9punSmgjHAbLPz5wqzapT0paaxJtBrFoIAsThyxoOtL\r\nSlbnEgP+fpZN1IOZqK2ixaJel9yw/XxLv3eRRVUZgpkQei3qig+iZeJXKTJB\r\nQnwqZ6ictqiP+ijenLKaciOnrBY7r2MpS94=\r\n=FWUl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e23d59df26e37153873958948ab3b70d8dbf757d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-e23d59-l4mh1bks_1655713467282_0.35367121983811733","host":"s3://npm-registry-packages"}},"3.5.0-feature-c356ca-l4mhlg8k":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-c356ca-l4mhlg8k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-c356ca-l4mhlg8k","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"16848b64437094994f9e599a2f4c3080d6e9e564","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-c356ca-l4mhlg8k.tgz","fileCount":153,"integrity":"sha512-cxgSbsHd5epNXFaGu2egsSHlP9toaryCNwVlJjrSxS2IiyGhL7yVeAUU0NezvzBTdargbaBw+6zPWKtkxf5POA==","signatures":[{"sig":"MEUCIQDX29bkBVjkR37Vz8G5igiSRVzmb8Hiw3iDNICRFRGFRQIgQuaanvsbrFbiYzOMXPeL5pwXsTG7+nPGF32LHaGUfd0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisDJrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLaRAAiKX1+AmNN4sYfTL/NVW2VAsfIHC9eFT7kmdDWiqbimGmKXb+\r\npQGzOggpGW0oA/OGgxQiKpmO19QvvaE4HRJ+YycRzRuuqW4eGutGDomgk9V/\r\n429QaaMi7ZwVa7Ctyb6/rRMi32eyRGuiJky9SqKBonuwoOnR01Lo0tbWN7ok\r\nMn6hGlhhtT6lPSZkpgKMq3+u9HA1CE+uZ+i78jdelWHb3EDIqolXRcI7ltfW\r\nE8mqan++0Ei1wwzYoxeTEJRgsAfMdvZJGdzu/xIbeTI+TmI3+b83nGmK2mPv\r\n/ofBVvdX9h3TrSBiT8/skQZVAZXzGyeenGH5+9rXFiNLCPPAyWDZ4TrQRU31\r\noQySUsoKy+5L+UulEsEznFE+r1rLS7gMXhB9OxknXuaC2w666YtZw4JvWhBH\r\nCw19eT/soMDJyBFb/3FX5dczKYg8qCP6CY26CjKCOio3GHVvv5Wl0qV8nYrh\r\n4P62A6XLJrx9tFzsF8DZ9UFZBT9AsTZvKGGT2jznLm8ch2Yu2jDr4b/vjrb8\r\nWDxqmkGKJuogVqRg+9eyVMxapnUOpk8oF3iH9DpjT1zq4v6CHX0KJ470R4Sp\r\n2KXpGLJwCIsB+/EWMY6M3jjo3eI79TdtIyHUVnvFd65r5a3+CFAG2AjosgLH\r\nmxj6qp47LL/2jijyEtmF29vn2nvxpko3GrQ=\r\n=BiA+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c356cac8bac29a2fea5c68ecf8272d6f0dd98cc4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-c356ca-l4mhlg8k_1655714411634_0.8438882522086901","host":"s3://npm-registry-packages"}},"3.5.0-feature-bb44fe-l4mhsymg":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-bb44fe-l4mhsymg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-bb44fe-l4mhsymg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"532b9d7258b6cc8e180243702cca1db1bc60d97e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-bb44fe-l4mhsymg.tgz","fileCount":153,"integrity":"sha512-+OF0Hrq4IEZ9y2ekDmez2fOpqQhogK2gU1ITp8Imz4yFGIc/4FE07kIMxCrii5IdWbS41S+/Jyv+T/903NF5Zw==","signatures":[{"sig":"MEUCIQDgWB7fCjTjIgmH9Fo6RDLfU9icGiGM0uuHPHzQu7YQLQIgUyE8fLVbniw1dp9z438WW2qi2MpgHP+yNSriEbL1Ncs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisDPEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmox8RAAoATcjUuuhyYy+CvZ+ouc1FR/CpkGlAQzxYoHfQ+vstiTe3wT\r\niPkwlsN9QuyQ25zYsJ6i8uQzRA15tSDFHcz+/rcnjWkUc/fdpshSu8oSgbMS\r\nc0mMHQ/NMIxgDG0P2eAsKNoDI+aNLTp1ydxP7K5sVzC2W931DK56A47VAiEU\r\nFAL00Mi5CAUMYBLSoVFBFT2j/xC7tiyfeZOzo4kF+byT90cW9gol9wdyPlu8\r\ndt9532X0rFBm8p0F3C82xaSzv2H3K1PQZvNjM/NWlxqXfmK7i1ZoC/MhQVqB\r\ndhccWwe1GdW++3ohi/ZfvGLFDSZw3z6oZm6raBFnPpAJNQ+8qSldGQuxvBLT\r\nU1EwRTsTYy7w1o20Ae9h5GF7SRFft77zILAX67aGA/5FqT4XVc4z+SXXueME\r\ncSvPTLPSitxc6mK4PujynBVaaE34tVoM9RX6Mjw+aCuuXr37mRFxAveqzAF8\r\nfPM7OefncBphodEvIHFie0xvkLbz+ZnEM9rmKZcNNkLPQ1S7rNq4UZbmjVdX\r\nmm1c30H7vYCmQwAZiWO9KctYZgpXx/vWc2wCgz3O3Evu16iFZLqVPvN+A+nc\r\noAZf1MwEYKupbMSvM1MQaCiJRrgbNF5aHns5h1OjAnqY6Q9VYkkxCecTyEwa\r\nnELP5wX8OkwBCLPxSql0sJgCUON/rHrfm50=\r\n=Fm0U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bb44fe96df58938a31c2fc56c156929bfd7bb505","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-bb44fe-l4mhsymg_1655714756540_0.2590729370745619","host":"s3://npm-registry-packages"}},"3.5.0-feature-aa29d9-l4mo06vs":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-aa29d9-l4mo06vs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-aa29d9-l4mo06vs","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2d943832f2ef0783c1a5b44e2948931a286adc8c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-aa29d9-l4mo06vs.tgz","fileCount":153,"integrity":"sha512-YjFDK47RUtJgyB/Pp71K+fhavM3IqqtNOMU700sohyr9sj9FHYqxfo1D5KKKd0Q4Bhk6yor3eAGCF9JSdAeiig==","signatures":[{"sig":"MEUCIDk/9d6ezj4bHO+RiVftilDG1G2A2kmm57OnEV0y83thAiEAzzxxNmLOL5iV4lFLDaQDL9OsO3y9ruF4MMhURLsGmB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisFx0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHnQ//ZjgXvLAkbA3Av9bHmVF7AQS7SLXMd/MDZcAUQhKJzs0Yv+ui\r\nokK4VAtdNzEKHpfT89N3VskyjW7DkoRh4k4BoBAitWlvYLRD9ueJe2sWeuq7\r\nwEWbuPx7ytzgXlncaJrwtNFPoWfECIq7U3QAwGwtDAYRfZAqXypHQHUNSbLz\r\nn75zhpcIJrxjUTW2Xk138C7ihALLihsUrjIGNlnZ9zG+cjPGXMDbDqO02yR5\r\nvLuvcmEeuLXF2d31sVzannTRk0MJAGvgxBoCBjzytCxSpYL1wWVASt9JHI7W\r\nHksszJw6jzms1PWpDoI4vo1lpJuyabmV8A1vHsHBgF3+juk9ZwCARRusg4Ho\r\nFoPvVyRs191nj90q7O2JxoHnZklezgTzXT0XSqydoyc31QcbRZg7VBx8zgnL\r\n1VKyy6gzwonnv3u9klPMy85KEHc97kckQVwLHebIvCfkMZy2NjjzG07il4XW\r\n0K6ccw4oNStyB5AjXitqVGOBP+CvfGBiM32YmsNM42JVtg3BCzubt+SzIC4m\r\nhGnTymwBxfGftO0hQffUoIr4DpGD1I64UkwjIdx+J45V9Wm3DJCu9aJWnldn\r\nlG+rqdB9IYjDAmI3LsG0d69CmEuVFlAw9cgFPi1CudVm0unwEc+62lxlfxxH\r\n5AG6PB9Z4mrLGcicBF3vWSmkWIuX693Iy24=\r\n=GRJF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aa29d93f4298b6816fcca39ba42e23c8dcb85e02","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-aa29d9-l4mo06vs_1655725172577_0.5198829477583895","host":"s3://npm-registry-packages"}},"3.5.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a43c5b8d6d6129d95c56cad629afc85a73b7f632","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.4.tgz","fileCount":153,"integrity":"sha512-LVK5dM/b0cN0wVEkUElMdgmQNKmYyE9MjHqHct0VofBhwcULgZUEs4Kdp+E/LUNPRUMBzprQNa1yvDE52JBoKA==","signatures":[{"sig":"MEUCIQDXwHwt5Ns2dvJ/RfQPsxSTYgrX7PX872tYowJEyz9YXwIgGQ6z8ZEovFdyhmgFBlJPmWtcRTC2w/cE10yZpxyVs0I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisFzQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwMA/+NBYcJV5Gg/Jzk2giDp3QS+ESpU/UgZj71VzUjwIslS5IzVBI\r\nWcGwLbsVORSsdnK7F3aKGUVitUhgpny5ruP5hKP9N9ctcx7Vxh71e/gEPw4b\r\nZmzb9CWwfUfscZLFhy1ZVrexdZr64nLwHybraz/EK2onl8xgNXrQ9IszGAGa\r\n6gd3nnMMw61S0jafIDe7Ns315oJ/b3yOwOxUmasg2H55hosoqLv8V6uoi+Qs\r\nUpT8+txwH5ZPyOWjM/kFyBO+c2+JKISe2ViznChlrh3tXCXeDmK/qsyRJuAb\r\nAEp0hqCGz0a6mp6w41prcIPMgxXWgjTdvL1JHcPT/NGlOG52dnLE0jpkDieP\r\nqryfTytrMUldPWstGNzwO65AWe4PwtGeOwMIDVn1VAP+NM4yueXqBdc9HZse\r\nCxFUB51QW9I57Vs46QzC9GNp2fNR4ZtCj3eM5iMD7uYoco+84Aacm0icUsYg\r\nMgz3qYM+KyGumefI8T1FvGVNBwsb8/gpI2l8AWfofVjvtmZYAaUniUDpMEiD\r\nh7jCh4CoHNB1KBNEM9xemoJL75iNfkL++KF/MbsA2+mZrQ0bGCnkSVHFEJpA\r\n6VdatAr2EeKOjawHHyojRFIQERBYNbenXMJgi5R1gWeZpfgrbwZViRfJDiwL\r\nSC3AKFP/CcP3l+aIDbnf7ItHSMd7tfP9s5I=\r\n=7ud7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b43c5fafd89199521e0db6da8f1078f08e2ad51b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.4_1655725263767_0.11235875031713127","host":"s3://npm-registry-packages"}},"4.0.0-feature-92cb17-l4mqk50m":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-92cb17-l4mqk50m","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-92cb17-l4mqk50m","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9bf0d2668a6e18edc5d6ffa90920fde8762dfb26","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-92cb17-l4mqk50m.tgz","fileCount":153,"integrity":"sha512-XMv9ZkIuEQIXyqlxHSKm6bwiJLe8sm93lsDF+0N4dbTB1yqf0AK1kS7G6MBulkwmM9huW+zCNcAfumfjT9Rxew==","signatures":[{"sig":"MEQCIBmiGxKC+wSyAUwWoaaP108ONOOmAruUGT5wFFdURUqQAiB6addJI16qQ7XhQm8ChvPLTjXjJueckFbSkwIGSRTFlw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisG0+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDQg/9HsVFwmLm+P60H53tsOKQ2cHIouJ0SVatq9vNKi3oqt7+GwMF\r\nVD1AbyqkDiwUzAjI25E6BvcDB57JRHiEUeCFW8tuLifN9ez9Iawj7Vo2Frrq\r\nBxW40k+shUNWFM07AfXcyDYW+3J9CHkU6q9KWD096WyQ/6rcmu8V18EY+4kR\r\nmZ64xPgqhGLzA0PkhGH+FpYUFAJNqL2AJAHEEz6whsEiJspxRqxA0cBXRyGb\r\ny9Fjn+up4c/wC63X4xe7mXYOWOCuMFM16AOTAs+PwLB1rEGwUNZZ5SQXcz/j\r\nxlznyJADydxKlJZrGvpeb+qKpiHvzUpdfIYF/hj3iPZLK+S/n8zCI+tCaGVc\r\n/uYcERssAGzsG4vb8y7nBfbn3FniIQnP9XcjgFUEsHp2Mt2qLViEIAHBxA2Z\r\nfjUyxw5ycp1rrdXM8BrLWmSuV/yUqZ/YUyj6Guskd2536EYR2h5YCbdjMIIy\r\niMIz7h9BQBZNOZVqoMYeKxoJadkPkVjcKpxUDLH8p/qQZy94XM3T6A/UYZYX\r\n+nE5hnHdzoBDg+tgv+m7VrwzHNoYHDEABeVxsfDUNW2P4k7/vwJU7JrV/Ut+\r\nuSXpRfnCFIRU3VNk/oni0vc259Gt5Q9iTtt4ZRDQ1gnpqmQLkRevgpPpW2L0\r\nfiNUalRbhSlPBSpR7/zX1e4KAR5WsOZbs7E=\r\n=+cq4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"92cb170c435e749312ad0d4da836b26745e75636","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_reset_to_flow-node-instance"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-92cb17-l4mqk50m_1655729470692_0.172176904267888","host":"s3://npm-registry-packages"}},"4.0.0-feature-c4a014-l4mqkv2p":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-c4a014-l4mqkv2p","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-c4a014-l4mqkv2p","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1197c5a9d3d7e6a3abde7d709ccbdeaf4b03cc71","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-c4a014-l4mqkv2p.tgz","fileCount":153,"integrity":"sha512-3VKauozkPGjRsCAHJDvr4tfEgcd1UYzzkPIKVw3KKxStTGlLePkhrQmd7OeD8LhZQv6wdJlHE9jMnqyBjMPM2g==","signatures":[{"sig":"MEQCIGUcJt67ZAIfKfsQ/Wa1XcmLKN5sBYLyE9VER9HR+evwAiAvl2FM2WWaxsWIeKWp6p/j+qS3cFIgUohqhRU/ifF3Lw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisG1XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiqA/9Hhhvt87ZQzxZztRoK0w5Z2xq+vT8LKL3w0lFbxqbnhHMJ8vb\r\nxY107+VeSYoUR1iJTft18xk5ZIWNGbr3eKyyfZRnq6phi99HuHIgkYBJn2Cg\r\nu3RdHr+dUms6vr5WbwXv3XEPTBD5Uz6qBryZyLoXQIroFfoE2An/KXRUBE0g\r\nI4Agk8jVnoGB+qB81V/0/T6974yh1oZxz3OXH7cp9R5ZaiDwZy4zFOrI7hKr\r\nzLw06hzXMhKJIIno9Jk956w+p9XyO7R7oP4edu4AjsmFUAKcl9ZdzVv4iu48\r\nd8L7mRwnU4PzXgB8sI3SE7kE9P5bk25AnC1I9WfzXW2IxfF/s4M7U6BBZY7g\r\nmkooNLrgy4lldulB8khACQXqIZWWPfDfdzZE66Thu7TN0ffUgq89ZIYC/uQP\r\nuNIMyKIU0xcs3/tCepc6cSR9o+pQz56iM23MJE0z3fNadtDBXbtWPLlG1wp7\r\ncRjTwhjF8qzqklg5s07sK2MnS+3sHh9+lRN2oJqPQ1OJOYjVzFupFGmHp8Ny\r\n0T/NZ52aM9weuwLcHwYVorv423cJrXxQ1xu9BFU6oSH7FeK9N6hk7Cp8+//s\r\nBkg7A56ynbUPiQ9hVJDcvL743jaFE8l+Ap3Ys3qMHprozHNhH9yFZ0OwWfz0\r\nmYvBr2KHSplbDnT1GIWPlIuhj1YWUbBgcAY=\r\n=excv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c4a0140378c707610b4cf26b807ffbc744d11a0a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-c4a014-l4mqkv2p_1655729494993_0.5074226923645548","host":"s3://npm-registry-packages"}},"3.5.0-feature-d55cce-l4mqkxid":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-d55cce-l4mqkxid","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-d55cce-l4mqkxid","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9f10589dcda53c91f3adb40d5f9e4ca322688ef1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-d55cce-l4mqkxid.tgz","fileCount":153,"integrity":"sha512-lABNbFvj4VbNw43cfA/DIJWJVxddQ8j3zrHnfUzkF3giL4jfNlwYIPqjWWBn8cFaBN+V1HcxqthiDLOHM3VcbQ==","signatures":[{"sig":"MEUCIQDZluer2VPbYo/AgSX8gl+vjeOM2Yn7aTGHDiCJmaPnJgIgRN6iz1s5irrzFIVNNXIqSIhJ3Q6HAhQh6B6yvMNTTrM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisG1eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoc9Q//bs4WbKvWc9En13w5OQmDgojd21j1DN1uNwdOdAYekhK9kZ48\r\nt1mvN7SME0pLOY3cXIBl2BWyHAyG8bv05dMCoA32d+4lQYsrQFf16ax/AWM/\r\n30OjX1Hhk+8LVxX7mkKvE7vhVo2HEPmExbWL/0i8E7CV6Xop7JaZiRinBosz\r\nhSaRZwTI7XTy49KPRYk/7bQZ6HqHq2zxSbFbmn3A3P/6GmVryNBDHniJLmhQ\r\nEv7SzRC6d9sskFzCrp0aPxn6T17Y381mWpASeESItuTA3EKFcHvu/dVSzT0I\r\nICmdVFdLCM3m6jU0B3vOmHmFR1XV6hS/U52KgPoSEcNAZfE3gMCU+k4/SSn4\r\nGY+KK9O7uvZuNGms5ytAEL8HpY+JWFd/gcNYRh9ec2xHHqnzjhmlgsVXEnYQ\r\nYw/PKxVuW5DHDE4c88zwFOhm9QZofr7lcazJuL88SLMYus9oyby1DdJPPFLT\r\nhzB5xtpPRAk+Zmove3UUIcwIhaXLWio7nvZirBkv431pmjTasOBcZHAVct1M\r\nZzIjyS6V9YoN5Lqkrt5SYXpYpza+yDzYzt44EH8kOfAre2YU/mOTOrPDCl9/\r\nLcQUuY9edXao2yZUMMSpMG+QYuDFAvlmXDsCkUy6IZOlIUKHdedYXCIGek69\r\nrjl/Yo+MpmDL7Gq8ZtYLE6L/kzUPsq3nYek=\r\n=5LJP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d55cce236f42ba6f649bcd47820ee8088f5c993a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-d55cce-l4mqkxid_1655729502625_0.2784108915189114","host":"s3://npm-registry-packages"}},"3.5.0-feature-e74d9d-l4mt3dg8":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-e74d9d-l4mt3dg8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-e74d9d-l4mt3dg8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6e56ac7b6a5b50e4c6d9c02035ad3361c91ce134","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-e74d9d-l4mt3dg8.tgz","fileCount":153,"integrity":"sha512-RBBmiLP90gqjLq4QxJ8+1z3G3/JRUGU2Hd5ifZuGHBXTW2Ipm68AFFS3vL9ocjXeiCShpYTh66zJBKS/4KnqKQ==","signatures":[{"sig":"MEQCIGMnLFQpEJjw6ETTduo6mDSMdVlCVIhYoqSmr1QoGaETAiBlmqNCUocBAzIUSvPrsSu2eAB9+PUR+9UJrK9bcxmaBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisH3WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXjxAAn+UapfMuZeri674hOBstXIeYnedAw9uqmx0jArTNrd06jKrP\r\nX+wZmy/nLhMNMwQ9IwrG0m1yy0BqDDvApVomxpaLM9a0yuEEq5zWuQm/RHsM\r\nXyUktBMhLZo5WCKfRIhqfp6C+qB9ch4NwVJku3p8PZRpiSoJRxBYQm03aRLQ\r\nfN1ymCCqOo0fduBjwVUbzMw0Uqp0gYbkYWVGhX55k9QAiGgt6RB8KFFklqsM\r\nsnmYOpuC09YpQ391SUc2Tj5w5XUUq0j2KDUf0a4f6068FYUlcP3Os08+uLkk\r\nzSP+7gTmxvkiAwhElNJ7fwtBKSQDrH/vOj0/nUGVEw/FbBNgFYO+QdXiecfh\r\n5iI2ZspShPIKyuaVglgWRfty1oLmO6ZoW+LJEoMhV2D+feS7F26U0DkqK2pU\r\n8o393djxj9WMWpbdUQmG+gGWbF+khSAH/xz9Wj9sQxZgFnP194a/GldpX5jo\r\nBCbiv0x+SlRonJQrJhUzvdlju24sy7Hs8Yhx3+DlK5hw3R0EuKJESY19S/py\r\nyuMCFTuWTVJi1tiMi8k1C1x1VEjcKqphoyCHmoMGSVnTrIo+AaHlFYmx/QyL\r\nOlI/mtdW6pR5NmV0L3OdnjnyyiVxSf3imoTp0iPtHdp5PoBG756dOdkyOR+X\r\n4copOlMEfr2ruyDvJrHxgDRTj63ADbRUxJU=\r\n=GF3I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e74d9d86960501cfeec504373dde45c3b984851e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-e74d9d-l4mt3dg8_1655733718491_0.37814300919714783","host":"s3://npm-registry-packages"}},"3.5.0-feature-2ef82d-l4ntne76":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-2ef82d-l4ntne76","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-2ef82d-l4ntne76","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e3258fe77e0ec7c4d9ab7c74633d8df98306d3b0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-2ef82d-l4ntne76.tgz","fileCount":153,"integrity":"sha512-JfsD3spDem4c+5aA1U0Q795Hjdgobq/F5csZJouqA2+f3n6mMz/EYezJr4n9PM7Yg2ftaxCFAuPI/NkeMvsaGg==","signatures":[{"sig":"MEQCIAdUidCtNekyslkjfkGq3pWEt6W1s8WtDxXEOjZjoaruAiAhRKhhQ06nC0Yx/NdLmJj37I+kWruhVjmAiwFeeqoTZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisW2uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJDQ//X1vHzAUPwPMHVX6A9lQU4isOE721MGu7UtNrZXkBHAYDPC0/\r\ny5bhU5bpmHLcXW/7jZ4N5SLMyIL3AyxRXVOQER9Iqbeb3iEhilaDwAZ6GRJ9\r\nORTnZfxbCjWAnTyrrTNfOlAKD3lrJP1AYlwP8IQdLn5WZ7hqQWfdAiX0XXnu\r\ne92oNbLkdVGaT4/KoPL1Wt+PUDUJh7k56jn5koir4z9zI0aTPMEt/3Jipne7\r\nNrUA4sh5FOWC3UBzDoKbnzemxfLfAH3nuHAiImBII6KZq+w8Hr7x8orpCmj7\r\ndkQ/Fyn/6MXQU6buwf3vu2ltYYDBPJHrjEZsH6m2dRUjZ5jFKmhHo67Dh6kC\r\nd99xjlc22BZCPUXsFdFTniqvyA+xQXU1wZPxRV7bng6Rlm1S2p9xK6ia+3EG\r\nx3WLcUE98LTZiNt/e3F5pYuBzsrrt4SKgmPLvhb5G6uaC+1IcvhXIR1fGag/\r\nQchH2bqSLYq/Sm76dZQwxjp1nLYzwXFgy/Xk5hVFEHsM0XmV+Q6lM4Ybe+o6\r\n2yIS7btCTbr9055tSty+Jb6HOMxQUFeoFN6ejVvL9kzdtiDWMsuCGLuBcuGV\r\nXCyHksgLpDF9lxs6RyiqgeOwwpj7pB5+cfIEIHk/DmKCJdz2cqD7NSGqCoOp\r\ncr/YU++Ny4sowFnKrmtIz0/lLPlyhPMKoDA=\r\n=zC0j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2ef82d8ad4b6b211d3ac00066b8605cae68cc847","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-2ef82d-l4ntne76_1655795118475_0.05839267044678276","host":"s3://npm-registry-packages"}},"3.5.0-feature-39feaa-l4nuzhcs":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-39feaa-l4nuzhcs","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-39feaa-l4nuzhcs","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"acd60bb51c91df556f3eb48b15f02c0c6c7bd9df","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-39feaa-l4nuzhcs.tgz","fileCount":153,"integrity":"sha512-mhWqKIQkwvuhvsqP5rUbKg1Oixmc3nap7NCma7d2R79IovAXQCoY3MKsBishVEPIRMPVVpjU8AOhx2doJAUWaQ==","signatures":[{"sig":"MEQCIF4xAyWvMF0tO+kuVK3LvjaSxiOn8r3TI3LeELJei6ICAiAi+IO+LM5zb9izMTMX4uPHx/4enGhF/A6qIa0ew2ab7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisXZyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdlhAAhG4eecqqW18Ewwk9OIR0sK2Yv7jN9SGRfy5bM7E9jiMya3Q7\r\nEa9cvo+6s89xwmshskalZxIEUtzVXYordxQfDE48U+rqRRUEXFYkjGJRrMDT\r\n5kh25cdbfLGWL6wZ7aOEEqhlm2xYSQTSwlCOdHntGfGmKPAJiLcImiNimI1U\r\nB2GPuT/efh0hk/o6JWmLClXL1TJzXjOV8NoeCsgvzWcx6bJTI4miAgFey9S1\r\nDqczVKANsozMO5e/NtaFd7glcNZ1p8PctRn5HgyqOyDQ/SQIYqMMAlszz6WX\r\n0Z48BtLkbaGSZIBE2TKEhb9ukBTnokiwezKDMcWmph9khZKoZyLQqF309Hdz\r\nErSlcYCKly6bycBc21WjPHaROdAjI7W3QU6LLJFHaUvw+cdak4SxUuXiiW19\r\nANfmRtOE2ou8C2WWomni3swV5K9VaxI/Z4cjf9N5JRL45/IPitqZVIZ02zTE\r\no0CA/KZ+QbGarc6Gk8BimGtBaeGcaRiuI8GY8iwh+5d/HTRLbVz0wI580huR\r\noiP1d+7zu3zhqudEOwB/ZZ/hCF2l0tdtXWeGJTui4Ui7AThykPQyN1pXDP90\r\nCQJJ59Ho+qqzO/aBUJf+nMZw/nhgNZYPbvjQp6ir1jh7+HsjM5UWcFyqXvSU\r\nUSrmlX/+f0FTh74jOmAg6zJ1u3XzkltkQWw=\r\n=jZdB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"39feaac4b93b1d4a7622264281bb407b47cb96d6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-39feaa-l4nuzhcs_1655797362701_0.41303675821481445","host":"s3://npm-registry-packages"}},"3.5.0-feature-4b8fc1-l4ny79qt":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-4b8fc1-l4ny79qt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-4b8fc1-l4ny79qt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"eff517774b75281ac086073a63432b046f8cfe35","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-4b8fc1-l4ny79qt.tgz","fileCount":153,"integrity":"sha512-QcIX0RwBwQuuBtBMccAjjgKThTzF/ug8haq20V03JR8gz2x8o/MY75KO4VZIjA41ZYJp9xuGpOGKcZWdjK4mpA==","signatures":[{"sig":"MEUCIQDrR5RR27GTrM04X8Mwc7RwU6JYV2CKMbHivVBhM5ijhgIgcYTqKvYgIfpDIbsxv455zrksKJSEkw4l57m6MY1MpSg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisYuQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOMg//QM3v3at12br31XcEb0YHjN1w28xSco2RWx3rpUEx49NAV+9I\r\nCOTKVwvBofjOFlHfzhI8rXm/p9vrOIE7T0GsypVxJ8GNRG7HzvKfkdFu6aDR\r\neUpjsVdUhxUpPFTq8v9tfp245VVEHkXb1XdngNVv7sOFn3YoeEdgATYJNwOE\r\njDySUtSiqbfvEPdcB5NE28Ti4mbKi+NoMK6HKoWhRjR6cYuqhqoN3O8BDosM\r\ndFIRjzKQVeN3cAUvqleZ0SKgUqdtPOKPxaBUcL8w/+//KlxSAspgd5yDgM1y\r\nMVYVcLOxH2g3fgQAngr/iNMbn6yXplRhEBg2IeQzmtPIrJ9ZJNuVDUXKiCe4\r\nzOPfsn6xZHSfsRd9y2FKeTVOpuzAtKKdn6UicDVvNWM7HRlW40Mf7yvDOTYg\r\nv3AD/91+BSYq2yox84gWrH/fCeQ5BcF5l4Agjbt+OPn5iq7GqeVQRlgA+qL1\r\n98Y7bYVAuDD0pjAjzaeWbXfFo41JdoewxH7W6QjLyFkSnftM6mH2mAiGKvGt\r\nXrgG6wYcpchRG7oP1nNkwCdo9ejWArXxW4Gs/qeb+RsJVY6dStn30zGBe6Zr\r\ntSpRjkgoODxeHdYBguFqKBAoK2H5sImlpZhY3+NqBcWL696XPRd+Y8em3b1F\r\nE86NfVIeY+RAt2EoSrqKEsHNMwCIiOgmrp8=\r\n=+n0k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4b8fc1970e157333750a2c24a29ba9c1df84a953","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~split_api"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-4b8fc1-l4ny79qt_1655802767974_0.7475572751314534","host":"s3://npm-registry-packages"}},"3.5.0-feature-0b186f-l4o6fbh8":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-0b186f-l4o6fbh8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-0b186f-l4o6fbh8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2392caa68f6fff5e61d01f964232c497205dc6d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-0b186f-l4o6fbh8.tgz","fileCount":153,"integrity":"sha512-WJCIX0bebQwFQfbG7IjEbqspR7M0Xv8C6tomBpvYwZJ+kIMWOEpravvUKjumxkNleaC7ItYkW5QKaTN1rp3e9A==","signatures":[{"sig":"MEYCIQCm4c/0KXOPTeFaKXQbQfw/4dR75tU2YGpBCZ6UiWSk2AIhAMVU/SFzZBXuCti2kpVTlhW268/St32P345xZNoK4gfF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478525,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiscGDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmou/A/+JLXyeX15Z8Y91XVacRoz8wuFP/pivbjbmv2/VfwQYvTvp8ho\r\nCGjpaiUG7dNZdyubuW3X0gUwtTeFDuCn6i7doTW/MgUER8mOAJEr37oFxbnq\r\n2978qjal1IyCvcKvuRQ1LBt2khL5QOL4Ci9qq6RFYZRsc2bva1Xgvn7HoDBp\r\nJRKJpxIZKOwtdvR0VDvc1qS+igq0l4G97wFGjMqcfCl8Xu/uTuYCZCVh+ZEX\r\nHKdlU8vLa7iX58ZOq1Qv8pxOh7U5/6giYxUcJM5TB8S5lFdbMNFTX/tOZ6eO\r\nrEOTmZGUC4Oi8CKjOMSQSYwhPomrtWQui/0E0gLAvNTfQrGQJVMbnnOCdZOU\r\nndVZufcs2ZQ7CRPrRURRQOPaa47nnQFlAwX1IwOSF7ZbcHcNcFPfQ1zs8kzM\r\nfQadUF3LeSmH4IfOjtGj5F0w8QwNZ/Ui78SvjUxE1s12v542oGApW7pkK1Hg\r\npIeTaY4Ce7Msape5J6iuHhSA/16S+OOmZjmxBhSf22HWof8hwANDcGevclad\r\n4Uf3tdzEn2mjvVLr9iim3nRPECQWmCQufyjUJxSVQaLpJZ3opxdmgrtWlPTp\r\nYqEJY/HwzoZYroLDMbS3VvF7lOudxUH7wfQ9ze2C+yEqCb/aU3yguI4aLzrR\r\nLbqYwdeKQCqjjiMRh26UAvKMrxHywq2knbU=\r\n=ath9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0b186f2c8dad2b0a03f4176538790b903a972626","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-0b186f-l4o6fbh8_1655816578817_0.7876340703263136","host":"s3://npm-registry-packages"}},"3.5.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8bcbf23cfcee83b801ef49959efea0d873d9ef15","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.5.tgz","fileCount":153,"integrity":"sha512-6+AGqs+8Otgs0pMn1rAaJCpXEbt/Mub73zhw7E+t45o0F6XC2w03XAfSJ4O/2f8ws4uDsdVeKWRCrdNpHLEx7w==","signatures":[{"sig":"MEUCIAXlKBcsjMz0r3weaKr1TEbSb96iALCxGXHcc1WPR7rbAiEA13Nimcob5d/vQ5+XlfdWHCrhQDLf9GkrCXEfKUX0dxg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiscGbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqelA//aX5DGjoSC64MCJXBa/3z2qsm1M5cqPjLR/wvr80tL3yNrOB5\r\nq7c6CCN2gtUHsRZDEHB/TRTvpld1ILLp6PkJMPKnORXCT5G20iwo1PcK/Jqn\r\n/m4wAcn0/sVYkB/gcKwUAgH2b+zi4NnQawk7PlDimSlFb7vqysz0rwsO6non\r\n9rDtOiAQWpaMB0HyDkn6jTU3qngY3eh2ViorKwHX/BtshyrOo5HrWVBjCmmG\r\nRUEW1xANc5mDyzxkVpdVRHqk8mrxkYgKWqO7/OVESvRQNfOi9M4BlBamFn6l\r\nsLTBXppsZ6K1YHrjipxnVN7uMLzesIBqKoJ4fHggjOcPxJcHUuX90wVDZX8I\r\nyifnHI1S9qu5YRl/1KllI+VYDTlwmK2JAlQ1Fpp6ewQ/zWEhWoWOaCXZ1iME\r\nreOCeBNIepDRF9NF8pkVVhD9QLAsC3Rkmq566F5OjSlwv6fTvqlbk9ZUnXMn\r\n0+GqdUg+AghDBhWsquNsutAOX2MCzvIkQtNejyQGD24gMKnKviJIwFyXjO9h\r\nwUdOGydcoOA5iEUlBNLYP2GKRf7mM5J9e0TuonF1Ozx38jfulcpg/92NsN1P\r\nJKQLV+JdfZxcI7fz20X7T96TNy8BtK16SejtRruBTMieE3qdl2UWRb75y1Aj\r\nzD4WN+yy30BHel7B8VscK3OAIYsRbg2KQAI=\r\n=hVZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"96253dc9f6ff80d3e5b627c6fe417b481d5d4098","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.5_1655816603103_0.46566044734324286","host":"s3://npm-registry-packages"}},"3.5.0-feature-139ffc-l4oagzdg":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-139ffc-l4oagzdg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-139ffc-l4oagzdg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e4db46917b031575769e777d892521b43627935f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-139ffc-l4oagzdg.tgz","fileCount":153,"integrity":"sha512-7wrOFKb44kQnZ/zry3DD1ibcjy1z3/cF+ihYqUE1+J2Zg6fgAMmsovwhjIom+C/oQwtHSexFqGe4nAHyt3ymuw==","signatures":[{"sig":"MEQCIDDnIDiSNDZlHbaKt99UFOHD3T3cOb5S8zXxlL1CZgAFAiBwxvkc/7+eZ1yh/mtjKsGyPul+FD8uVru7BIUDn1QPUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisdwNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp69w//U/H/fxT2aNMzhUAcmC6jIJGaRiygYPehfZoBUR9umkmmuKJW\r\nKafp7Fah+6ozzx1seCOe0NPtlRJ9frdAGP1zFKXhi/25wrVY/92pQ5c6SLCb\r\n+K50ybKOg+InUjI4dA+hZSVwpN/BKZAJRChDRNY08p7feJTKX1CiZXyTNhod\r\nMsagL05mJUy2uM2Gy4nw8rY7J7i5uPCZTAfewRyc5IJMrvgXyNa+Es/EqQkP\r\nblS4Ld9GpYEP8jgt+AfO8aj0CWI40WNmzqd7jomyP/sHYj5qlqHKP10t6+gL\r\nCuvseelVc3Q2AYsDT0Ow1/6K5MCY5YD0x5du04a3MX+kZPBaLdo3brCrg+6I\r\nIQlLOEZXuh4OM5G7OScfVeSyuAP3Rttlvp1rbo/v/gWbYCwYXxcKkeL3Xn6i\r\nOrPeth2nmVdZqaQIi90v5lMqIaLuAPX8VQARvu8Zi93aPi4smTIINmLzkj/J\r\neZMbRyHMJ0ADJPzdEjW6wHwSbcYJIMcBeefpLr6NGHZuNxVOxkXdyMwk99+J\r\nGlmMQ2p5//qvjAFRYYws8/n7nBFf0FWfZoZ8RQkRywE2dmiiPQDF1xyxOLSX\r\nDt924HLmIQeo81jVQRTdhQu8+mRShSPV1YRpHMJAvgQEtBvhKrHbe3abLZ8J\r\nNPPYjRLrw7jozIe7seF+u5x05zpGMQ/8t7M=\r\n=xDOn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"139ffc08fe54645f553426fc6ecf560cf47790f8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-139ffc-l4oagzdg_1655823373286_0.6362403881339971","host":"s3://npm-registry-packages"}},"4.0.0-feature-2af349-l4oddryg":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-2af349-l4oddryg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-2af349-l4oddryg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"086debfb6a8566eff09b7b35fa465f4ca558d1ad","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-2af349-l4oddryg.tgz","fileCount":153,"integrity":"sha512-jzvxEdoDfypDHPy0coXxZsGa8/kStu91rGb4sF+7D+pAyctpeNpDpmmzT+eye7r/JJjO/ZhM07DRQtnTTcEWSg==","signatures":[{"sig":"MEYCIQCxS6L5jE+9b1NHgsBbfmb6AbwVOgFyRT7OgmTTNP4VfgIhAPMwKKESVHTcdG/zq5okTOsBdWimM//Q2vsgaFE6HKGm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":460153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJise8sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpsaw//Qrpd9kYuUBJvS5ZHaPoeprmZaUwvZaK745ucB35gooihcqIm\r\nFIh+abtkUBuKRlrED/RXcFVkkhSfYpN5WjSv4UhJT7fO4rL5CbjW/AO+LUHe\r\nT39Sg3TfpqoYdNoVsHr3Cn95i8+FHMWlWBTEgH+xUW/e+Cb5CikmuwXU2jyC\r\nWfdt1LzjM7GGSns6jKrl4/aQzvAH/fG1Wktlx68zeDLjSQyymDiUg99J7Hom\r\nR0UqvDt70MefeLDajRoK6J2WZ6ZPMBFCAfSghx+2esxNrRKxF9tpGLUhS9TT\r\n/etKpP7DpavnYFgKsjysaSR9wD/4HvJ4YGSsnVQ30OhAfZDhqjNof1r7QI88\r\nzBJ0U3jKqlsPq9DAt7U4EL0Q/AD7x3ZZNyNcXV0xCr7cRuDawUQYVAQ43FUM\r\nDGm3KAjqWtw1SvGiJOPgycuiTeneWS9Ce5WamkK/pXOFK1TTrsVB0WdLDO6i\r\nLC+gcCSLE9GG/qwVWj0TO5dHl9/RFpHve74zQUd3ZR1ePLwuILi7G7n5FT89\r\nSNfVxrZlDDu/ba0yLIFFImwqRZYehfkT5EGRqQ0q0KZl4kLrhAz35OfOdqYo\r\nhkeA+UvLcN3jR0TeZ78gerLEK0jPowUBSyGNMaqCRPk+MNQMsly3ewALD+K4\r\nUIYqs91uxRKbtu08uWMYInaCodq/RNGxVe0=\r\n=C6m3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2af3495f7a5104141e93217d1e9cd8ebb9b4a445","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-2af349-l4oddryg_1655828268307_0.5003171385061027","host":"s3://npm-registry-packages"}},"3.5.0-feature-52afda-l4pa1q26":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-52afda-l4pa1q26","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-52afda-l4pa1q26","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dd3392f7352ef0c8c131af284a0f9eb889e89591","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-52afda-l4pa1q26.tgz","fileCount":153,"integrity":"sha512-ZtpjL/OBz3MxPAO9p5qPH+2R/d9wxfIzWkYWxOb855wh8SwWxJ2mp4UD6DUlGETx/ZyhUcnguuddTKa06ZoenQ==","signatures":[{"sig":"MEYCIQDw08gttLgYzIV1JHejeU7P1LVylNddXA2rGu675pyxhwIhAMLSVXNwgTab3qBat0sjHPUq6jCSPu7EFpx+iHMB00W6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJissWAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2Uw/+NZaRLzRyCT0BUmcfY/I2DPY02AewM/PkISvtJbCC2PIXeqRW\r\nybPbSK4HSNaZLAtRzBGMkMOQTdToGFlS32VSzL8pW2WA56XTQe3VwFUZj7s9\r\nkfIDOkTU3zUbNzoOkvkK6arn0aDbs0zW1DgBq3q2rF6gOJjlgzhg+MmWG8Dd\r\nU1KJsjfKqdT2obIA7wiythDo4KEeIWrc8qbEFnpv12mYYme8VCHYCw3IbiOy\r\ngYsO0xuQWpYOrq2cF9q69wznx3iY1103pAcWClulhGzodfiUhKBqIHIfkbL0\r\nsz6C9unoAvs5as7WPHtr4UAUmMBijizo3HO4xjemEETGqsNA4d2LZqVueIyi\r\n73kAk+42NIXDmx1ZdTHESa7A5n0IGwOVb1y2rsDtFSF6cMsjCsbOtTThBv2P\r\nbS3iwNqPSTQPrlIr1+JOXvXriasOtbNQ9SS6pm66reWsOIWZA7CWYGlNafF3\r\nj+9e1FMtHE42ycmzwSCoScOAwcMq3uKJfNfzq5CtH8RAjPf2UHWEy/AXjKaB\r\nBf+6YI7fHYNR6G+1YG57v/3VmR581u1YsgP5RjblB7ksKt0dDdEpFZIuE4a2\r\nZdZ0J+NM8kidoZdUq1h/LCvB8/1R04mO/KTgSe8YF/eo7kvyXcQZ7HH95wOC\r\nJCcWO5Is3qg1SMBYO04fkRON6sNmRMP5TaA=\r\n=Hgw3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"52afdae255221301253ef98f70be006f699204ef","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-52afda-l4pa1q26_1655883136624_0.49663171372981574","host":"s3://npm-registry-packages"}},"3.5.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8cbbf90b9767571aa8feeaf94b10b7c27c0777d3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.6.tgz","fileCount":153,"integrity":"sha512-BNog62PwZHOtgjjjZ84bN5Z26dAmq/plWG6NSkOOaKzfJcdIlEn6YBB4ufIHHEojvPgNLyCSffTSUxgbImX6nw==","signatures":[{"sig":"MEUCIQC+P8Vm3y5Ad3IDDejsLblevDqQsH4VBLh90Y7SlMruVQIge0kJ26DcukSj1TQ7gblg5rYktE9Mss8cI8XUwezncEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiswTmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjvg//aBRjt1wzqNvdTwrjhXYrfSTC4C4DubuVD8QtO4VBa+/Y0xnn\r\nEJSOa4KcAm733h/97m0sEVK305pXBtzTq75mrC7Sf+DrwSuMCAB9vDKCwIcT\r\nHl+8CIsgJFvehhxJPzo/EKOZveZurUmzn3VJTekf8keLN4KieO1Pd7C1GHGb\r\nQQT2PbVxmmxEodj9ueATQrNssfPl+uLkIiXSe2O/u/kqTCWJHhQmnO0azgP8\r\nZ/CO7pRVRCcOL7S6XRegOmnSHg9YFEhuPeivglmmO3PafvctICkyiYwT1Q3k\r\nsu1lloYURrF/FyI/YzAw7R4NF5DmmTogfVMQ2U1SmBT3J14IXSXaOQQ9beS7\r\ngc7OXuG1vr2KbpKf2ASrR1qJlQpr3EZ0ndbtHbiJA4H5RL0LirsTeGHsVOc1\r\nYRwpKYHEcSwv+jIfBWR8Raarq9gxfcrWLOchsJxV/yPYV8j/HJ298GY8WaAu\r\nthbbqDo+A+8uesfJ2CZKSlBF0LC9zyCM4z/N5GEGAA6NHIkXgJtrko7rgiI7\r\nhUAEq2s/XhoCaBVbdjV/qK5v2KMvE7W3i9tUteeW66PuHVp5f9oYNZM2bQbZ\r\nkB63ftIWFoSS85vQfxgB99Cva7rNZ8cqT9pzRSziej8ctDH74uy8Xw1pawZ+\r\nUe8ilAi4KlwBgYq3r3O4rSkxdwifczg1enM=\r\n=fMSn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"53100bfa946a8716b2dad666c9b0d99d4f7177c0","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.6_1655899365751_0.3375696545414919","host":"s3://npm-registry-packages"}},"3.5.0-feature-dfe585-l4pjvlgn":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-dfe585-l4pjvlgn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-dfe585-l4pjvlgn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f3052fb179e38d89cbde46fc62a43f68ee8997cf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-dfe585-l4pjvlgn.tgz","fileCount":153,"integrity":"sha512-m5HuLHcdGucYkjW5fky0xTad40u+xJtDycDa/LElYCdUflcnNpwzOEtyqfYqKW2Ya4hiC1CUNcRwkBhl+lQq1g==","signatures":[{"sig":"MEQCIH3sqZ8/p6MAAOoDBUjFYUv+0FVX/a5+kevgeqw2jMdWAiAIRGBSFm5vhdsrLb8ckSw+OB0vVi6hJD8beF/8NRA1zw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiswX1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6MxAAoSWtA9qnv3ljLxdbPDPgqAFB9ZGbiZH/RZrlrVwmVv84CbzM\r\n/fzXzXmeVjXhN9x1dESFzxFv49CB+f2zbBmwtadZ6oVDaJFySzzRMN8E7+qj\r\nCQti1qv3aMlZd63TLQFJ7o51DErcMVprPvCByKKBKfH6BNw0ok6l3JC8K+K2\r\nmoF6RZOP5aOqLIPoCHpsheXIxAjNAulh9/EC2TEqh8SMBsI4rkc9u9r2SqDN\r\nCprSGwV/26nd1g6JA3AhdkqvME6j/kxFCGCnb3e451w7ssEaFex2l0wpOW7x\r\njQ6W9HFhy7S79en2YkPlI4xxOiAbyZBfMV03E26pKWdgne+gniDi1r/N9tsO\r\n6qlyPXSdt/PmI/hX+zNlbWiJSq8duFciOwcG4A+eyDtmiwq/Ehd+Da7LaXNy\r\nNswjCzYuAytN7sUTih0aCMQcuM6ZoR2klPwzLwOKAlghsoMqUCwnEHiM8lzI\r\ncQ/Jk7e1Nm8vr6bX+n3C+Nd+QeUsFPSEC9oZ12HRlJkHzB1NviK0UW42L07f\r\n19dckTtHSIWKiaiXYJxnj8KnJJ63Z0r205T0frVcJFFLTI9UZd0ev0o1mkbz\r\nEJgNrSmTd8yQjHVhVcZae+jZjVcNMtMTjRTCzPVRJ/u7pxi5EJdApeVvWwyc\r\npnF8CEjJgffHvjH3wCPTPwkcTXbig4UYNJU=\r\n=C7PY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dfe5853108f311d059856d8cbc61165129772cce","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-dfe585-l4pjvlgn_1655899637020_0.19967792429407827","host":"s3://npm-registry-packages"}},"3.5.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f0d598f5c72aa0e38496bea0457d01f6ce4dd10e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-beta.1.tgz","fileCount":153,"integrity":"sha512-JB1E8une00I0ZRGJhuY9JRr5AOnvUX5vylcbx+k0XZQdBnsRbqw5SuJc2YjtL6dYuRXBV5Ehee1S4Z1KgcmUDQ==","signatures":[{"sig":"MEQCIE2PpTLNjUzJAi1Mm31T/XY6/DrQHCDYHLr9aDpnGxelAiBNGsU/BfSM3NNYCGlaM6gqO9xO5SfaklVaFqF/ku2z5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisxvqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoCg//bf2iD8kCJNeuP5hYtu+l6vT+398/2oWCca2Q4B4RlGEmrsTl\r\nAI5XkpNDFo/dCKK3B1Mm8/ez69rwTBl+PFkRawrVO7iMOtTGR+RpjSJQBX/u\r\ntpnrfNAMS5SZKQNrmMqQuXDGeFDlPKIVDXRRO3QaYFjMUdpVp9plZDxKeF1+\r\nNdCH7jcDt6jMUJjcz1MxVthhfPoXAqfkHYYgVCA1n2+gh379XuCKVU7FhTCN\r\nm1DcKUYHiuYx3T5b7rVwUULJcr0aDKJy6btBPAUfZE4vlm5y7a+ZnkEmHP7M\r\nPs+40332hK7vou5tln3xIClgW3zfG3gl8aSwx0rtNFNhXFCZUz59/W1Vtbrh\r\n3qa60imnS2gRM95jKgagv9biQW9819OqbKWsNl9GzMqC3uUG60DsTc+fD6mC\r\ntRocS0DsF+fZmQIiqX7b2JWdoL8ZzHlfZbatZyedpJO4LzD9mhrZpDpOUDZo\r\n23/Awhsj27Z6LZfRv/HsvrpNSSHZ+m94g9QCvPXOMq70piYUpZDErvtAadqi\r\nVF8AWNAVAn+hbys01MT3fbe5f3Wq3E19hX3oRBuEB40YMvcBBERtf0lpMHez\r\n663zM5sZ92cYD5F9DFlD37KVKom65TXS2J3yhQP10I2HTOEAODAFz9bkNPJb\r\nW4lhVs+ffxn1w7DgHd/N3lKjuu6n7+0Qg2Y=\r\n=0XqR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d96d03bad28d7eaa725c5c7b6334d9ca8a4a34f8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-beta.1_1655905257970_0.23150567917313403","host":"s3://npm-registry-packages"}},"3.5.0-feature-080d13-l4pnbuxt":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-080d13-l4pnbuxt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-080d13-l4pnbuxt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5a3e84944e120a1901499dea3149747937e2e603","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-080d13-l4pnbuxt.tgz","fileCount":153,"integrity":"sha512-8wcthoFY3Pcu4IcxQ1u5GBxRaw+g/+iJ5ykWEjybCJFPH3GTAlHmKxnj7Dgm7l9NrJc9ZN7nR+g4lU5EN1/ynw==","signatures":[{"sig":"MEUCIBkS7+GGjV0K2atbqLHFlCnnPp3hLE+Mv2ru6wc2ksD1AiEAtN7c/9uismKj0ol0/lyO78wPOC5VkJHtTDtjcYxlKS8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisxycACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozIA/7BemW1s6oc6jEoGY8mlwjrvRBZhVM/yWRZw0vRwTU88MzaBN9\r\nzGURd7DMvdejTMZAFAGT3EybflpAv0SNMC/RVT9XkLvmNpO9RvjCZpY0g9ox\r\nlZsP0BQ5BTG0/uD2hvbegvi6a/LgMrSX5q0M5IRpiLhnY7JLP+b1DZHkVWoE\r\nSH+4HL2BkRjhxwPQpTr69kYkJ4vZ1PxGipiGLsVDeY8s2wRXrEvqeLAMXRil\r\nyCU8YNU71R40LX17pF/PhXKRAYPvPEK6RWdlRpFXfssMwWYTpGvRgZS2IR06\r\na0eX4bDOdbwQmgyfC7qlkQABXZd1PLC30Ejfk9w0p4gYx+qmHHVfvxDTdAAb\r\n7aH+f4rAhOV01N9vGpKR/sgm1WFbTclLU+YfaVgYhOjjU/cFQDXXnZ1BmRPH\r\nNdbdNYYruN6qHhYi+WrRx0T+41dmVP3H7HARRKSnzkKUJ4pwCJHHU8j15v5Y\r\niBv9Lr2ZO35D5vaXjkBtEyjpvnEcYCJ1zv6qFWV9Brk4zX1Cq1fdtb6vJvpI\r\nNDSQPt2jCQhj+Rx96nIWKtMM8MMIIzuYByHIxFCxWlOtoR7YpA/y1PAS2Ed0\r\nuONYZpp3OEFgmD+eAjqm+2GlkofYjoF4TzxB4cBuYG+IiiqRrldJE36B32+/\r\nOseA9EJPZm6ucCVlgfrDZGfHGSyBnF3JQVc=\r\n=Ht9V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"080d13e3283e90d454bfb603257a4f1e2f825d9e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-080d13-l4pnbuxt_1655905436072_0.85132661694162","host":"s3://npm-registry-packages"}},"4.0.0-feature-e4413e-l4pnsi46":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-e4413e-l4pnsi46","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-e4413e-l4pnsi46","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9760242d6d6d18b22faccfae518e2d341d86ec09","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-e4413e-l4pnsi46.tgz","fileCount":153,"integrity":"sha512-xOAasnWKdE45RNSzWRCLT0prO13FxUC5/kHGGA5TJdIx16jvR0q35hivkQXcSE5ZXD2IbtZZw2Ng7/vKAMjj6g==","signatures":[{"sig":"MEUCIHe+SwyxMd6XLptalSHv71/P18p+kxBGNJGVUIS3jJ5SAiEAtKGQIIbFMqSYbpcc1yTKzts/DIqF2IGnIHVF5BflWJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":460326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisx+kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpP5w/9HHOpaaciT0elnGVzNngUGoumm9xIx1IJyf+zWZn9YCUoznAQ\r\nDBQFJLqATe9pp+sWdmsz4hReIAfVc5UARbhuHePvWWn2S76ZcD/eClz4CnNw\r\nslCmTpXEBlI7v5ko6C8Uy+DMO1iKftAjjJK/9nOAb+nhxczwu5zw/63N0Q05\r\nwEgcsNmVchc8qhITWYgSqwOfq01z977SWtPMSaECVuiYBPl/Xo9OPRxx35/b\r\nARbYembNNb0e2ahrJBKnnoheeRAGKB3vfErhXVsTaFSlKgLp/26QiuUuEWqq\r\nBlOC/ObmlSzKMCcNPkoMlhLiEZV0cBrlVoJIzHt9cVheBNOhnMHgnwioQkvt\r\nFWwIiCQfX8gx6UStdVudo5rcRLp55G4sVBTshKAgzdb5ajiaeT/k175Xh1ZL\r\nKVs0I1Y+ZK4TyMQR0nb6JbDZjZLB2jVpJoyTX7Sedybpe38pgzf+x71dqWds\r\nKCTqcd7CGepc1R0ZlH1Pl9VJIcaCtpeQc/xT3aO1Sq6tT/2ChkHZNtTiMeNz\r\nUsY7pHWZfGH8h5doSB79etv8Fv1iLTwqVC69tYjqey4UPzTQmi5Bcm0k2aXd\r\n25iGR5XGVC/V9b6IKcYMFoGACt5qul3tFhA+zSo7Bs3O7ydgQlnVi1pa9DaE\r\nbe4Zq3HoCYARwg1l5VVBCzvQpI/RVmTxAjg=\r\n=wj2f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e4413e703caf18259975a95437f3c951aedc9479","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-e4413e-l4pnsi46_1655906212226_0.7859568174094038","host":"s3://npm-registry-packages"}},"4.0.0-feature-473276-l4qua1e8":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-473276-l4qua1e8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-473276-l4qua1e8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8293e5cbd6e66e418d48bc510b75da7aecd7bfc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-473276-l4qua1e8.tgz","fileCount":153,"integrity":"sha512-+6dJoJ+i0xPRV3MMNqEgjs1OvvWhPlQ0PNACPq2PTBdt+WrFhsGbK01z0RqhDNC17pVl4n2bi5E1ZuwwurwHNw==","signatures":[{"sig":"MEUCIQCobrHHvXmvYbuxZidWt85WTc6Tg7Z2LbowikfbQamMMgIgGpvuWQqoAPU6oyYnxY+sq5K1+JQwkwD1z2r5qsIRPbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":478435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitDZnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3yhAAjS5+dypukA/NiqWA4bx3hEUdUuY+h9x/v1rxFvo2Zl80irZA\r\n8n6ijK5wBfNNExYZ1djt5y3SLrn2sidHD+bI17+CzGHLX2Ibju5/kj+Ep3Fk\r\nkakI9FWm4GO4Jo6sCGoUklqjLVCoc+LHBF+RJn/eDY2/kHUXG6TAH5h3wNn6\r\ntyNsKTAYXNNXm1H7jmphEVtUT5M+XWXw+BHJ1p57S0ZZbl9au4O0ORoT+kxu\r\njwTpZ42x+RYeljnVpjItJRGLSYXUsTIoz15nrcCOs66vxKDtDhCVNsXTLyD/\r\nFySLJ1TKQFYTVQlrwYTPEx584CKdQ1TlugfxE2F4Ich6ey10ZqDQRJqP9Mlo\r\n2KH2CJkfqUAVkukCS/p3FgWjGwqCC2bN8T297bGjOCEZhgO1Nqu50btP76yg\r\nOEpwwxBgzYEobhCQoS7xz0Ou4LJ0Ab+SVQbzIQ+ur5K4n3T17nCVId5AgjjY\r\nPDHotWAlEk/xGJsyTozk+3XSDrb7OHrEJ6VMdwn7lpmBLbRsmr1Em1q2ZU3W\r\nA0UHWf5CpqWhz93kFUFnPpOU7+hWsiNR/RPs9lRiW5+2SD0uQjukkXMLq2Oq\r\nWpncXXycHn1anxxTaqKfoeg+I5LCwO+/0GViyA+X70gKatdksiR4FzbW5tTy\r\nJuDn3NGeEC2wET3qWZvZqZtp+uQ0Q1sbWgM=\r\n=0bEr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4732762a3cd2b95223ace6552f24ecb8a764261d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-473276-l4qua1e8_1655977574940_0.507958295957319","host":"s3://npm-registry-packages"}},"3.5.0-feature-59de58-l4qwogdv":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-59de58-l4qwogdv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-59de58-l4qwogdv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74d17eb9c360f2cf03941d958b9e610c12693530","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-59de58-l4qwogdv.tgz","fileCount":153,"integrity":"sha512-4lajhr1CyFG1ZUtQlUQSwtBeH1OaUtYj2zr5WlNBrzYNkkDe9cKVhWbfEwRzn9FaNzRJx24SEPmqyFyVp7/Z5A==","signatures":[{"sig":"MEYCIQCFdb1giwOwVKhK+bU7nJA4SxxavZAaK/SZn5DrSmeY5gIhAMJDd/mKfgP1b9dwOzDZeJwUJYPFd5DhSrToUQXV6vn0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitEYrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXjw//U5JLC/WDQU2ABUDXmNrU/wLQl6UiTqjBb7wTcOVHe5k4oSiH\r\nYubK3XSXMUiuURZlo3XheMFfDHQMTgXE/TOx3NTja8zkwuKPQ9g3kTXMOEF7\r\nuMGtsLhHJX0jYn9y7R6WLu+RHAxSGRkFrGB3VkROdhFsf35yaHf0c2iFh/4v\r\nPqd9TOU7vhG0OT2tPxG3ama3xBg5WC58IeTcUG+tIHLOZrLDdrUoIvSquk1V\r\nh999oXwdgHnf1kYf11G0SAKMfpK2vcl/O9ryz5/QK5I0+62XQrdhWrBZB/MJ\r\nJB8d2D5rH5+rQUhMtflWbodjmM8AqSQm7jh33Xwy3WcYnZpFXL7zEgtBopw4\r\njnzPxNzj++7G6QcMVIKjYTia9ds4M38kZrSmF5Xinn5W2BdeDwYSC9V3rwJ/\r\nhAoGFxD+EBlKXvgpGexmxvzkSZLbg8iI0k5zW7Pdq+pNLZk4gtZJDY+WHdr2\r\nLtSLbKPKHta9efcTfUu862KnRZCoLvAU2gkj6VH1TyQpZ6Inb0stZf88gZfN\r\nEEnevBtUmbZUoHsnhrajxNzUQd5BMIZKbQe+x5mOzYEx0mFc8B/orO0VSwcV\r\nhQkxIDAwJktmwB1V+j+1TbzNKpwWqBJ0lq8YVjNNxM/U9AEOpx/t6OXToATp\r\nXu2jN4W3cX4a3pZ7spl1SNlO9IHZH8dhvag=\r\n=Xn5k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"59de586a973249416e29bf5765afe1986ef0969f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_correlation_based_trigger_restriction_to_catch_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-59de58-l4qwogdv_1655981610869_0.7698773083959471","host":"s3://npm-registry-packages"}},"3.5.0-feature-2e0d29-l4wv5813":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-2e0d29-l4wv5813","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-2e0d29-l4wv5813","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"54c0a290027f7c646b11430c9c7cf288fa2b664e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-2e0d29-l4wv5813.tgz","fileCount":153,"integrity":"sha512-DCEKeWVycm6fM6LmHNNJtnyyFxBwzakpPyUDjEcPXZ/idLMQv9j2GJW5o0hDLMUjOaept/Dtva13Y+WX7I0b9A==","signatures":[{"sig":"MEUCIAS50xvr4twgz8uPNfdbDava2UJ/7hTUSKARzzewKyJeAiEA+IOseofpvN0FZDIeaw8Pbfhmmm9zozZ+3wmT5h8/OT8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiucVBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmooVhAAlZe19QgHabziVpTRXGUxEK0Lk94zjnd6lrNkl7RTWRD7t0rr\r\nVLqIzS4NCjlRph7kggatbvTuEHCqDz7t1yIjlUubb4Z2OveBQwdPwaNYxXWZ\r\neaP7bC9exlqTkqtAYlbAlFkRG4HSkQkF7VYgEC8o6zgvmy7zGAJLfvKiPaAW\r\nPQWkeZBJNzukBOM5FDP+3NPi9cFbcQK+v00CF4TdUOP2Dzmi6AYveRkrWpch\r\n4bqyQtYKCKDTZTSnUP/g8o7/ZnGY0WSUQahRekunn8CDqcebBh9szNnH/x9G\r\n2bRHfrZqeAyEvZHYv6wgVj/XQ8+JuAOX1Al6690XVaWCtu0+KMU7/HMHESq7\r\nel1XkRBNlNecko9uQhHSllp35wG3aeSckYmRuXriakHzudMJHchw942UVO5X\r\nDbUT+bzq4kS/QqLJrOAwHojy1ULQCULfxRdFya6EZG9kslHyTzMg5tAqwJVn\r\nc+RQstSFOaXRcbRpjbX0VkrEKWPwNgxHt2JIBL4U44m8T5wpj87V3VTWl4CX\r\nF6Zg+lLCf4UftBXvDrw5G/ZM0tw49bHTjQKvLLbGnWm86e1FnFRxrI60Fx4u\r\nOP5Isww/epBT4pfhcT7IUrpQDmFoU16Rn0MTr3F4CMvkQtiLq5LeLel/cwxZ\r\n+Hpano556SBCSnwjD/b1sfsPwaETSx4/xHw=\r\n=8itm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2e0d29b6dbb31b36fb94d441977b11781af8e50c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-2e0d29-l4wv5813_1656341825656_0.20366612307217902","host":"s3://npm-registry-packages"}},"3.5.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"83ead7e5db5b27603b36390133ad001093bcf7e4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.7.tgz","fileCount":153,"integrity":"sha512-eW9mkyEhVvzEq1pUK4H9CQvQz2dZwyqSaPAamvLBrCrGcISCZYzEwIS++9pr97JcDQQmdNbFMA/n9GRKZZ8G4w==","signatures":[{"sig":"MEUCIQCtXyb5QSdIxctFZkYdZ8T3CsuMF6S+8NPoU1KV01DgCwIgKgkG23+WRLhwdgEnj0w84kEQxLKiNInjD+8kLKkj0J0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiucWtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLjw/+OaiVe64hkgWmlW0DEytR+J71G3shlq4ZbSVj5CLPc34ogVQl\r\ndTqmFKTs5a7H8neVwiTnwuYLW26QNJHwrQT9O1rTREXXp8wmrx6969BBPtJy\r\nqrB4DvIgmBOqtJjbq8I/N1rtURWCWVNHvzPRsG+zByL4olRBxEcuPNosSWzi\r\n7CsTm41HOjhIc1nqc07vAq0vGMkUhH932zLRZIYiOp5pMa0H5aaGDyTOQNZg\r\nacynge26kW3kHl8M8XoWfb8JEq0OrZzTIyrn1/BCH882/JQiWCK/MRPyK6v6\r\nZuPPZ/Qa44PjrLi9UF2Ch9cSfBGP4hUFBKWc0E6f+Vfu74J9JTdfTkTS9jaV\r\nBQyE13tTUBCc0VUv3Qz4RS5XGbGtzae1ruHmEztLAHgoinRYfpElXr0AdpG8\r\navm4jaa/Y+f/K8UWJkvTOyTyC9DG50kR5d60qsBSpNh16VEE4Cn/nBNZYPK2\r\nosnr08ZKKvPTsYP56wJcjmadvTLPx0qwZiVKHyYXL6xK3OPQ+FTfyBg1UewO\r\nnRUUuA8ecNpI4eBzdpp+k9Cr7CLRyxxKp6thyKAAmKtyd87vgmpP6EuJQKQy\r\n46IdQb/4Aj6wPqwGVrfkZsAOpr7V/dz4wRhLQNaLvqjRbU2ZKAYvzI1zPCFP\r\ntlgyteUrQRh/X9j2G1Ls5wcyT8kFyY4Djw4=\r\n=rel6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a4ab20050cfe17d6f76dd27cdddd03755acd5e75","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.7_1656341933688_0.12792804609269326","host":"s3://npm-registry-packages"}},"3.5.0-feature-d199f9-l4yccscd":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-d199f9-l4yccscd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-d199f9-l4yccscd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3e3dd02d2ccfef62a7ef2f84828750ec06213754","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-d199f9-l4yccscd.tgz","fileCount":153,"integrity":"sha512-oZS/lP+ICPvMyOnWres7jtHAHvDMJtLEifvuHXxyMbG9Sgj52Y0J8f6ozFBfXtoGzXsfa7GgTuoj0o3WihNZVw==","signatures":[{"sig":"MEYCIQCvUYpdBpxsfif0oJTYWpraEEaGgaWsLFt9FqFZgcABXgIhAP1zhpwPaLF2m9BrdRJwAXxP41Un8HOUBVSRxgSwYLdq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuyJeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5RQ//VovdZoOTBPwcNYvnVhbJypiTDKRQK27aYJ5mT4RfvuwKJ2sJ\r\nFEsXOjlsYev/qqWvm24DLLmXb9d5GWysaRvXjOzbu8DroA27YrKE+NC7ZJRc\r\nQrzJSRV9YqtdTeFrO8tRZHUhjmvQrD+DkBNw/a9GlZ8aEudFBHnrcv0S0EVE\r\nnVGlhYVT+Sr2Jng8EnYquqGEC5ieEjvILfXWaDI62srZp+2N3jmmKS5JUSWr\r\nDyyj6K+onVWNVGTO0wmyyIObg16pYRahf6bnU5PiU5QLZLM4xqfl2dZGTPmg\r\nMEyJf7bSVoTHVfcKK8awPRUhMTR09RFszVtrWxCXiUMSCtqD8gzqzch9bmDM\r\nwOCDxMCGZAJ1Z25gXi141Ue2yL7+zEnAhEvxZ5bTyINCyGr9upQb+YfmTe3P\r\nGGCtdcD1HAZiNDZdt8BT70zOxZ5VmiXE0ToGUni3DYLbcw/RhYEC9CrEIpgt\r\noxdf7i+RA8BrC+cabzW0EugOcw/WmTaQT9T5zgrX+gOVRx7gUKcdOeGk3Faf\r\nZJ1v4DeFc+FGeUJK1QEsJd3e2Az7Kyn9v6VNYQOEGghpCpxQTVr2Hx0may/j\r\nhLZAUq5ZRV6g0s978pAYxEscjlLRa1kZfYcNU48hWKCnoItvwJ+aKW1p4FlG\r\njafPeeLTU3HVPseUsyKKl9du4Xt14es709M=\r\n=Z09a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d199f9f8543889a314ae56bef0d6c0a73fa016c8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~runtime_expression_for_callactivity"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-d199f9-l4yccscd_1656431197865_0.4065213721158156","host":"s3://npm-registry-packages"}},"3.5.0-feature-267302-l4zaybsm":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-267302-l4zaybsm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-267302-l4zaybsm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27ad037ea0264ca648729ebdd13242def1dbc51f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-267302-l4zaybsm.tgz","fileCount":153,"integrity":"sha512-IrEH1ybUm/WoKR5bum5jtVvKBvVh1eWKcbsmZueeTGSHOwT0pCaB2lqTHAuAXa/QDK7T5NXDecFrjkqG3GLEHg==","signatures":[{"sig":"MEQCICtDYzZwjWH4FcLIb3Im1WV5qq3GoA+NisE7Ku2eAvlAAiB/C3ApuMEI3MCekvitmYuFwS6A/iwPuVzVaAO8++Gdaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivAVeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcHhAAhIQMZJnTVjUJgvN5p96iJQx23TG1CU9IvVnRJpou9KG42p4w\r\nS66RR8dpjmWBgObuDMRQKFw/VLFiTBRtV55G0x3iYWOeNeNKYczXU83n7KS1\r\nWLqw74HSDffhPTN63emVN5sYYvXP/qEzHAT+yNlR1eSaMCknOoB6Nl9igDiK\r\nb0WISmyq9M590bEbk1r3IPPXrNmjXN9I4cdhHEz0e7/SJnn13s5n88wl0wB+\r\nOkxguoboq85PQPCZmasQ+tH+wx6zP2oxw2r5+GgO6q97znmPXwYuEmwNNeP/\r\nXkYH/+HxI3P7D9jhn2Rq3VSDcc5SpaLo+dsdHkTrf5aRIbWNKj+VDdcNoZ5x\r\n4PsHnhuk6yJwxm5gOJ9Z4bR0wGfcJ4qDFk71WywrhUGrgO1gWujQBbn/UQap\r\ngOW74Uq9CEQ0KBzacldW5+dM0KJcJLYNeN4I9IckkOn9dnHHKH0Q7bsUbUMw\r\n5+p/lRqqMgJjqstf3tfDmvSoBEbLdPO3Lrrqv9MwTXeuP23XK21i7gmSVJ6x\r\nZLA8/HkHfte16J5Lc5oIWiMH8M0ePsrOO5KnzgL+ecOs2GIRGwc5urRx9KOT\r\n2/9U2JQVbkaMNBEepjdf5BQtczuWAcLsmLO5M4VQXzCWjiHH2UMyVGBKDlPn\r\nWPni/14UsDsqDUQeGVPY+wtps8WHazUD/Dg=\r\n=72hq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"267302fa7d050a7660732021d054a9ade5f84588","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-267302-l4zaybsm_1656489310349_0.7958504868350738","host":"s3://npm-registry-packages"}},"3.5.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a63c012f6e89c3d367b7faa444c13e41c42a9035","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.8.tgz","fileCount":153,"integrity":"sha512-BhiuuX73zRfrMcmkBgd5z7P1gAqR12qbmEUb/UrfHpJU6V6PnfypkX4nQYo781eKjZVjUkLBKedZ71k/dfE0hg==","signatures":[{"sig":"MEQCIDGwms6Bh7DO/eln3IQMo8iXMzJqJlV8a8gwLR8UwN5wAiB4/NE4C5Lx7UoKC9NPl13r5g62ZEAzqy22JRgHL1HAvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivAWfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyMRAAg3i8XSkdelhhBpfQuZtlQWuFRGMCLdnkSEAndXbaPx3MwAdM\r\nauV07KlETOA3/up0Q2sYBzrZVQoIPqT7gz0XUKdQGFY5WDu8AEGVeogh71bj\r\n51Zgu67dMHnEAFalW8Y3nxOAv/CUgpKv7MBrjdWgsW1KMvCW3Vj9xIKCtSBi\r\n9xzT8CgUxuEP8y4FuLnta6ujNw9JXOkUe/DzuJYngh7w6bRVO2KAf/EkvNxB\r\nMhJRCj/F7ujae3H62L2DkNVCI/toORyEYwNs18QijFOkYlhZEV707ZKilip+\r\nUsOVHkCI27Dsu8wYOTCrvs5Z8MelgKP/im+/hyVYIBLg3H1kP8y003fQPidZ\r\ncJU/k4rqpppzqncCYToz7L3638Nkcx9BUpi21Dn+80eVs9HEUKMmfP8UGnXR\r\nIxGhLD1dMTh9XlJWGSv+lg3unlYBV5bKAqHZfKSWfkSP+OJOZCsEwmB8IDoq\r\n8MuSOc+QWwOn+lFMTnOSzmgv4Pu3Q8aMc70iiA28jk0Yu0O3RffkNCUMj/hs\r\ntDKtIx4uV79gh0wNY+PpxMX598ACd60985swIIOabgDjSknueAKtHUkh8cax\r\n4UIIW4iHIQW1Ueeiie1jnCivwWCUuxQk86+jdDhgJZlW0JMhlDT1GlO3I6F9\r\nXGWUQUivJNUxdfOpE/0uRUpKuRJ0PQX+o08=\r\n=45Fm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3a7f40c09c8d542052a532259ad826548e2ac5de","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.8_1656489375319_0.10908274492518943","host":"s3://npm-registry-packages"}},"3.5.0-feature-2e6249-l4zf1t8w":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-2e6249-l4zf1t8w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-2e6249-l4zf1t8w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6e2898b3ab14a86539041e4e9b1fb4a39622ce45","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-2e6249-l4zf1t8w.tgz","fileCount":153,"integrity":"sha512-ds+cfEnXHGAlyVgGk1Fblcg9SdkIiSeQVSDuWA2G59NgpxPC8tPr9hvhJWoecjahzS6nuXZOUYqgMkDGHwE71w==","signatures":[{"sig":"MEQCIAuDTOm3DmIhjsvecu+cR6jn+VcxgOkUfUq3LEl8HeBaAiA/jSPThZYKjSiSNrCe2ul5utTfdr/T0esKzP7UQI8s8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivCA/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr70hAAgS1wP1DtboumifsmkWGBgo1HttwOmac7+PViwXXYhM6MtdJv\r\nrrdaDSXsflW2cmsfUcFaLct4/r5UHDE8hxgJcWGjZCPvTlYiK833sz2xeY/W\r\nffXpPuQKlvqnQa5neSZUWji+nv6egUVrK5aH5BEBP5KCRloBkx/zt0Y9XgGa\r\nrs1YDsKQP+lz9uvOWsxkl0W6QsX1ewcfGLjYW6Th8cYSDB18EWbbASQKG17/\r\nXjKz145xRpH3cnodDIT8/6QiLdDYZiuWA0rB6+h68vCrHS/ETltPVrzia0iP\r\nLgD6mGCerxKrVsQ7+vZ9nXv7kSv4Ilwe2B0kAX1/BTxbsDhkU2JgptHiaJyd\r\nTidQ2oCmwJZjR39a7moERkVt2BNQKSV251c9WWzPaYkStfJx4oPpbVjIdyMw\r\nkE/4T7Kz24CK2h5tB9Kv1ay5ei3TnOXlC+yUD37RKgWVcjRhNIhXZ6Dx0wQR\r\nlRdwi4recDwFGje7/+5wySITGhN1XK71zngANNzdPL70wQ/R69XlxMdxkPLR\r\nhC3pdTm8/FVzdhw6aP0JKT0uIW1VIKCtT0uNkMAoYwXpAwvLVD66p9UuMXnI\r\nxTeV9fi7oZTNPWMa781EXlfM+zLv1h8SF/DNoOsu4CcIKWWq/yAuaT/Nh2W+\r\ndZ3v09JPBEBnJmoDCgpb1KGnjde3W1XbGOQ=\r\n=+bip\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2e62494ebce995ed4a9f130a967cb5655efc8dd5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~fix_serializing_bpmn_errors"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-2e6249-l4zf1t8w_1656496190787_0.001053505997716142","host":"s3://npm-registry-packages"}},"3.5.0-feature-4a1f27-l4zfmko9":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-4a1f27-l4zfmko9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-4a1f27-l4zfmko9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f0d24dc73369d09936a978d6148a4de1bee306c0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-4a1f27-l4zfmko9.tgz","fileCount":153,"integrity":"sha512-Iv2O+Gj8smVoPxZ6S/XrzguT6p/HTMFyH4TqnFNqGA5afnFW8A8Op98vgoeUclHXqFD75EyF7zX45emIzUfOWQ==","signatures":[{"sig":"MEYCIQDGVBvb89zkKxR+pE+/9o0YwURUqaTV1d7HjL7xmofqSgIhANaeU9zvn0hi/6nFF78yB5Rf6iNPT9aVOu9SaH8JNosf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivCQIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAOxAAiqkpbXRrquLK0oi+MdPH3I78RGp5eKcmS8Cb/CSnV91dnKSw\r\nJ16FTIsLaC2jmkgioFBpNiZeut86S/iDor9bGUXyB5XcuuEnPyVGh39lO6db\r\n2VHQYOzFmQii/58B//0FNu1Azw1kt1z56J5AD3LSJiyKfi2vbHazId1CG0uC\r\nl+JXJYtJtOD+sDTEnxpr0YhfzuIG21PgJ3KYR6/N5ZbzRPdTlrS5fbcjrXkW\r\nOG2PbMiCfZPRmCyfKyBAcSJOn/drzZH4+4Y56nIpS9Q6r0GgBeIz+hBu7Ahn\r\nCKT4lBfNJ91sI6J0eLbhdECcZmZyPQlmrRk66/3MysCtn4HIpwJDepf1xcli\r\nlPnnyxGFxJRdsPJG2hQP8AyVBqmr2OiAbdt28gaED5XrF5DAUbJAVvCN5GUx\r\nKkzZlbLyLIpIcFgMOZ8zyhQSj5Vy77wbAe88yBijfLKO336Na/sF20zNq7EF\r\njZZu9JyR6Wuu+19LAypDy+Ck5CZZPZh9ikP3lOsubi6xkMh45K4lMdJk919b\r\n95qc32w3IMw2+pCNjlWjI5QM2kY9pl6STunSPEWdDIOAIpTl9XPZdmuQS7mo\r\ngB0G8kToRhny/id8MfrNmYUt3nUUhGmUxOHTg0+LK5XLevOJcPY0L/Jeipju\r\ndz3klDkzaxcqkBwBQhK+Ea8HKPbIteoSPRI=\r\n=oakd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4a1f270159b49cdb4ceb089e9bf86a8c855bfdfd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~fix_serializing_bpmn_errors"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-4a1f27-l4zfmko9_1656497160077_0.48280332739060405","host":"s3://npm-registry-packages"}},"3.5.0-feature-f9d9ef-l50rt2ms":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-feature-f9d9ef-l50rt2ms","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-feature-f9d9ef-l50rt2ms","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"801b92b4dc8c259ae07d1b7a9c6e53da744763f0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-feature-f9d9ef-l50rt2ms.tgz","fileCount":153,"integrity":"sha512-tMrkC96F/ZTX974rLdF3ovXMyeRTygZk8eXjCH/5q2wYwjBl2HAV5m/W7utLcvdaM4LK05nZpK+mKYNaKfiAgQ==","signatures":[{"sig":"MEUCID8CqEsNSvIC1kgVOYo3+gJKGouTnFHjwzeliwwEzN4XAiEArosHZ9C9EQ5R2WlHwga8QIfKo5DUycBq0DU0tZCWgJs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivWAlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1zw//cV4TbMK9yM4J6gNeFQBM33DPhb3H+7oxFKayXDLfrPLWBu4F\r\nJ74Nk9d0QuoHWDZb8EfecSesns+qNBdQ+dagvH4m7NpagWi/PzPkwIgyxksi\r\nOhiu18QEdn2wc6cq7DbGquPqEB1LRPrE9Uua+DSKAWuzr17QElKIJ/P+p9e/\r\nRQY2ZWpR7Pc/tr6igH7Onr0TId1fzERuZjk0rjB8GakDMqgys65UETElLeRv\r\nHNNaC93Mt2nvlTnnJ96byOF9cqnXx+FZGhqE7FHsen0YogEVpW+qwd0fFdoT\r\n/4aUsHfufj6eU/DgrAXcYj/euBRxBmxpYep3PZVvL0UGK0Nq+h2SSFi5imF4\r\nU3zJXcDZTeeIUA5PdjTKfjG99MDr05ok09b2U7ayiopT+BdXyoYl1biRAQlL\r\ntp2sSg26rcUGQ9VmuCskdcxs2mtSbpKnO5Z0bzAqh5JOELSY+xC40MkYtmU8\r\nWqlwjrepGybU9iig1Jp6kgWTVmUJJ/tB9rRRSa0T7/GESr3QNe5BlK40mr6H\r\nQn7FW8M87/QSSFYOoGsmsZlxcnbxnyIEzQpNbgISKQ9dXLmHU9Tq8O4bJP3Q\r\nxgINr3vIDJCU7/EqLo4DZ76P8CzshrtpTInGow/uZH9vHbEt+bYt3mO4bHry\r\ngcRe3cbQoTypuQoRqxpJnekQbVNtdf5qyDQ=\r\n=Swdu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f9d9effc325871004fd180143b982ca97d268e50","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-feature-f9d9ef-l50rt2ms_1656578085324_0.8798651513421258","host":"s3://npm-registry-packages"}},"3.5.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"653b7ac1624e499e40f84dc298fdd9d4386efb19","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-alpha.9.tgz","fileCount":153,"integrity":"sha512-HrlSGYbl+F4/118CbyPjetIlqXNTdsBSLNfKAPYmo0GlkS7heysQO+cqNra/PS8CuTCXknEtMTAVXHWvCdUWow==","signatures":[{"sig":"MEUCIGFp9Z+WuYiqAM7X7E2bsgi3QdrfM4VYwgCGxN6DR8f4AiEA4ahFIjGWojPENIDs3JlTgSTTyCH02Fawmz/Sdz2BvpQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivWBvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4Rw/+KShq8Wqf/KL029x8I2If3sKec5bkOiJm5E5dfoGqcRgDOmBp\r\nF2siF2XWIJwllutnNdehbiOq4ye0DueWAJwQhMgxaVXOGo8ov0tm7pdWvzmD\r\nIGApc7SsXe/2cWYv3EN6nHGn+VDawtKBuSjvxsk6KKZpWoRuAP8xTiQ0DdE2\r\nI7LHqHWvISxLnpzRk5SeHeWb36+bftC1+3VZYKetGEkHJin6Mee3dAitzIGv\r\njQzbqxApaTB3bidouCY+tXOa7BHy7aPyia8h3zQau09nsyGO9Uh/tw4khph4\r\njXATfNH5eNrKfDL0j/VP/+cyp9K9kpcfFBuEWzXW0mlkcmHBuZACGqGZjYFq\r\n6IYMegznlNaRQ8PkiBeSyX/5dKBbGm0WzAdoju/PSQXZbiRQPAcfdmZx0hgl\r\n26SHEGSI5ZwF0gAiwqed6IEt3cI1bXhWhPH2yZQl7TjIdbfTJZG8T+OUU7n6\r\nSjGzjK1P9vo6VEd/bpjSFmFRifpCs6a+rh726BfDO4cLmVYpIejCsLeRfRbj\r\nwil5zK6BIMH1oHd87tXgVnaEEd/qGXoqMSp6TwxhDRj7x9rkfYbSqc91m6Vo\r\nVstU/kZ19BwcJqsYNYUzKVoJbScpThCPLL0/zCqN2JHSYbSWz4YRifIaSUG8\r\niLmD8+/R+4HS6GO8KCiIDSANgIRfR+Ndklk=\r\n=Bfbm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7acd4f6873710769ae0faa7883a167aac08d2188","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-alpha.9_1656578159562_0.3873587659622255","host":"s3://npm-registry-packages"}},"4.0.0-feature-fd9ff0-l50s23sn":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-fd9ff0-l50s23sn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-fd9ff0-l50s23sn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a18573a77c025cc7cfb8cdf35253243f4db35abc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-fd9ff0-l50s23sn.tgz","fileCount":153,"integrity":"sha512-/LWZd1e76d356eBXOuKe2y5HefM84wGwAVAKqrSf24kMQt2pxZaO0p08HxaTYtbHk+rfiKsg4g5w1AG4ukczZA==","signatures":[{"sig":"MEQCIEs7vKgvJPkG9QKvSRckmhNZJqsnmWSTiCDiVPh4VtYiAiA0rRDieVJJySrVPs0JrCiJG8LNOh8+BxfAsKO1XWoksg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivWHJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoiGg//c+ulxW+tCl5JWvpK+//RXVVmJOobt9NMKfuZ7f+XFNC6lhkg\r\n8gpSrLGD/Sej5GhX7f1CjSUZKF/Jlzb8IakocZS1VFDuUI1omi8gAX74QIGa\r\n6a5sS9qYvdzyx2U2CDGjJ17ZGC4c/BLzm8BF/ooeiLvqS+AK7KslScr0FAr9\r\nQP6X+T0kF+/xVK5rTFtdpaG5s9ggTJWx8Pis6LKF3L4rU319WXOqBLFxbcQO\r\nvSoG0iXzvlfTWFrYCGWD8GlIAFp1y9MfV7SfAXs1TbtraaUevBr5U0qEvopT\r\nW5qR+ZkG4l5vTtyzxy542XQVWhyh1+EA/rMhaHC5UhjDXfJOEuPYWhrpVTVT\r\nG89VrKlKjxruTNdYxtsjtiJ+mmz5leBgLaiISPTjfLoQqE7neSmCNf88H8qk\r\n33pL8fcw0+8h6LH9pIrgaierM8ArGA1l7VpQg5u6qAXWt556u5Qjpc6D8nVf\r\nMT7dIF+xwcpI7gqTVOd7MOjByZYBk/0r80Ggt7p+Pth5ti3lvkYzpqRp2J0+\r\n/yUFi0y8zPymK8OnE89cTzN+nOB7P6V+YvZRJGQaZHnoWC8C3BMsQxrErBX0\r\nAPpndN0Hjvh++JeFiFwXuXmIvJMXZJix6KC0lgtYtSCenUgMcd0hJABvEaL8\r\nC+Cg49cGMPBwzvRGndGUVfsCCHg+vgmo1M8=\r\n=shtn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fd9ff057cc14451ee86ed3eee7f9fc4903072413","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-fd9ff0-l50s23sn_1656578505428_0.9241422548681253","host":"s3://npm-registry-packages"}},"3.5.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"29df9ec28065dcc48cb28f11dfce8e357583ee1e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-beta.2.tgz","fileCount":153,"integrity":"sha512-Wv8Y7LMMvWafbDUIcb5WrEns1FrnX5jTZPFDZRW0Gk4w5Jd4FMLK2rSbSlfOfBo8ELEHL4CsC9wtdXTliX9wVg==","signatures":[{"sig":"MEUCIQDzveedVBzCuMJsgLLuPjvtrHeBrbxJKIw4HC98V9cwugIgCJkz86odNtpFmsWeGyF9GsZ5db2qy1N0jU3XtWnEJlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivxaOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJdhAAkqBhAcAYKCbR2vg68qpz9gdDk909HJgNllMy9yQ1xYZmw3j+\r\nBYCta9GdcOXQ3yRyQXdUnU6EtYNCHUVoy8EUKM0I5LA+wFtNv8kYRVJY2u2t\r\neKJl3L4o6mLG+jEGyOOGn2j5HJ8fXDMndZfrTgOeUG3zClJLXON5LzEzMpKg\r\nmAszVmxh4lp7tLClgw4/iTOOmh8xt8/hJAArn5ooBabVNJzJegJGS3mITJUR\r\nNDWGQOlSVF6hO0z5U9hSZ3wSVpvWVpymcvBsAMVG3bpo3TC4YpW3Ti+o8C/B\r\nwTJOMpDbAQwCH1kZBc9YfQ3UhP+Ul5pi48dqnrT4iO2WnQNstI6WknBHzo/s\r\nmz6g6ZJ6UKfpuFIuzaXTy6fllOPTD4pMDhIl1nCz18tJtUcOFYJE/nZWcYpL\r\nHoYuT8FSWbLSaKRKAjfPbyK0Y8/rdxypiWBAfVJ+fq4p3zyvvWe9tDEd0R3V\r\nMQQuIGWsNLI7mHot3MpFCftaWDwbL1W/Eaxg71KHj54SjmHKMIhW2fE62RO9\r\nmeeuKLk3wrGo7OyG/6QnfvAVg8TvSvgFj8Oh4RfXTmtAmlQlCm/V/m+Dmmxy\r\nlTsVNRmE+EhLqXksfoRUqETbMcjQt9sYQCjw1HkCHfOUJRFdtXHRp9ZGc/wv\r\nM9gztmFk4+tCtM934byK64wqFDf7S2d8tXA=\r\n=vEIj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e6dc73ff82d7a4418369e7d087eff767488dcbc5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-beta.2_1656690318326_0.5190423309144383","host":"s3://npm-registry-packages"}},"4.0.0-feature-de3cce-l52oabrd":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-de3cce-l52oabrd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-de3cce-l52oabrd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bdc2baac25e118bf86c16db5c171fa50ad7fa9db","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-de3cce-l52oabrd.tgz","fileCount":153,"integrity":"sha512-WhO4dGF+yBKjEOVYtQmDeH9H6ZsMX6c1ht2Q6DCBX0aS2i7lPhczjwpHMMsXWrZpyIs3XYW6vZBZ7vZgUyRkOg==","signatures":[{"sig":"MEUCIFZpwal0LuTIvpjRu+oNDIxHPsYUT+lTw/F5QvJoHXFNAiEA2pB+oOWk0LTA+2h3GnF3mEL2HWDP0JVn7xIIDdOX0/U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivyFvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGSw//Tjt+4mObWEpPH0I2SCcNppjLprpCOS4CdbevfjZbVspQzQOa\r\n0GOY0rlAg/f3HnHweL+RKgaTddS2XIrdz4mF1qVIrVNFPfsLNB0BRjyIvSvr\r\n3mNI2s70ShKQ/it/ciNbvJESOk5AoyaYUmt/i+MqoknGHTTBXXtmW5kLGOc4\r\nURrogrTubbn708tYYpla0DHXAG/7E/yaJhIzMyga/Ikyc0JlA4V+Miwteis4\r\nV22KxVaQBS1ENSTeMNgXeVg7p0dRkLE/D3JyxwMUckGnNf1L3QuTaHR1/zUK\r\n1NShfI47xS9A1V+7MoRKNMn1FJxUPsipLStIspN4mpUdbgII6A790OziIvZ+\r\nN3+Z+qNI2fcJvunbMHQRHY7EIqp2VNAdz7Y9OOuhhjd+uuqOCZb8xIlPrAhZ\r\n1LN4KbyfikJ3wIzUTMyJBbycsoHMILq2jUYvOoKNVYwg0QX+Ht9sgi97bOpF\r\nskJkS9EfE85DgST4+Dv2pSFJgR5Ai+kJJav3GBGWRW1vGfU9nmIM22tTAN7g\r\nXYqWfZq1J84Q2av2lFeGxjyBYNf/YCRhNCvg5K582mKeNCH/uNipHj5pvUxh\r\npVlXZ/Lcj7kDt7jl4DL/+8RHVN7wYSxwx19y3Br134TjpDMYWalwTTgPs1gf\r\n4rbnk1gUDK62vPtNf28mRLRUm49olMM7VI0=\r\n=db49\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"de3ccead5c3a419fe94ad2af894a1d597050f4ac","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-de3cce-l52oabrd_1656693103033_0.6633140737426022","host":"s3://npm-registry-packages"}},"3.5.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"269f09348e9cc6d18649175c6091453b74a7c64d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0-beta.3.tgz","fileCount":153,"integrity":"sha512-xcHXtAOKOAx2HoK1ONJB3W4sncEVgAadtb1B8J+LgiSNri8V+LOQKO3S8PRbuiMa/A0U/omlXgPiOBouc4okaQ==","signatures":[{"sig":"MEYCIQCWneS3yvuzgtRpMLoJBxVP8m+d/9v8p2GmuogK3yxLWwIhANjqhNf5+1Vz6irecLXeun0ur/Bazl5kAbO+toOcRA4p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxKDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhFA/9G4ARK8khUXd1BW1xee3/l6BoAygK1lTCIoiAGkWzEyE1RDle\r\npojtoUvbuIRpNITs8sAujWUegssHlEesVYYq794jwo7e0wPuyTgxwYmiStxn\r\nZRSBTR4Yz5Q6X3hFDj0dhpa2Pd29pauxIZH5jNTTkHj7JdZe1gpTpBT89lQ8\r\nV2dq6Ht1LWWqtap3QL50mE2orY8J84gmJk9FVs2mDtY61BxGoreUTNm9Fv9q\r\nWy1dgQt18yQd+ex5phP4Qd++PVyxOvzwDvjj7Bua2zsXFohgz2XCo7Wh26EH\r\n+WX2BD2jmOTwa0BDXch2bgQW/+x1sy5eciLGQTDI7OvORC0mnWt2oisU5lG4\r\nbV6QmZpi8WD2kCrZFVbDEBKpic3J9ERIig8ZkJY0t9nyppnWGQnZRjONmDBC\r\nyLMbJqfNCATxpAZQ6fePrR9UfDw3VDuNOGXfUmcCIagVH1WRtzahLkamfgrq\r\nIV4JFSOEW0P4w7cLeQK7eGnPS/rW/bEA2HnTeP+yWrnfRIKBvnKVDeyeTH/A\r\n4xN68e4KhwJhk2OPftqXNqlLKlVGTSXWTq1SxiwmV8+6/c4tuTZkIoK4NGfA\r\nWs0lRdXcjFRYjELgyq8JbLHjXdLcoDCsjbR784DFHNcjViCkryYYMzmcUCdY\r\n59CX5/8nsOglMYrltzEEYPF3se/Kp222CU0=\r\n=LkRr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d8836da1cd6e01db7ab302d914901c022bc2c096","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.15.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0-beta.3_1657213571546_0.7312472222050976","host":"s3://npm-registry-packages"}},"3.5.0":{"name":"@atlas-engine/atlas_engine_client","version":"3.5.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@3.5.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6e8e897e87bb0c7b62e5c46f97c9420ef33fe683","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-3.5.0.tgz","fileCount":153,"integrity":"sha512-Cw+YIpc/8lYmkGyu/vKaO4YdpqdXrAxuDnPKQPz9o0qZOupnj4YZO5crNn/ZqKwYXblkoN/FjumI81IgX5ooxw==","signatures":[{"sig":"MEUCIHggdm2Imnlozb2L2ZRIwe28CUkmvFq4K2iKibwzTFYnAiEAhMCueinPogte43Ejy6G/uCBiCqGgraHjJDJifiELuS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizURrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRug//SeSfrpX/k3/3S64egbhPiyy35bDjqrA6oDL6ayzEIrwf/UeR\r\ntSmKfQbIwkUxiUv+brnLTmLDH0j8OMGYarnZI1vRKJ8QCbXVIZ2ALbmSZDGd\r\n5wL+t3wON0xsYiijCFlF64CK5LRho5Cry6flohtCX1a06P1V+QP17qHn/MZn\r\nnqVqBQAYQdacsc1lGGD8ZzJQ2qw+OmQCZ6SE9pYtanCxfSTB8NeTmhFSMsz9\r\ntDdUlWq00U8JgTp5cU/Y5h3G1GB6asmfuRMJUxbjvcpNy2LYMIMLcdEqJ1LO\r\n5G3xwKS6OtzllceuLxddBYuTIfxIv66hKBJWQKc3yNcwQrh94/pgv84nEBlC\r\noJXdhKqnYHeHaqK/iyO07iLKRtViWMEIvO1sHCNx9yiSQGXerQMc/rsWoK62\r\n+NcAZgWqfEuJ/T5mb4PZbTX2xyBV6i7toJSY3hOVXvmdPqR/s7SGRTg3N3cC\r\nLVp7t/X74ORyx+4Ipn/Mws9R7AmbJPhpFVlGnno34qm3azUJYBrjTJr5XcQ8\r\nGf+xdj2OBzP8PK+RCdg/QRr0OHlu98+MgWZIVtmqzEOLQyFUfjUbG0joubFQ\r\n1GVaGdqlfEdwnV8IZS8/YN9w6cITdQWhDOG740w/oJjNEOA2KT2ldeo8QFx8\r\nW+jWCrG9GFNzRscowd96wEYefsosDOyqJQ8=\r\n=zfW5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"2762a72bf6824bd65269e04b066d9458ce52c265","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_3.5.0_1657619562757_0.1423096874020935","host":"s3://npm-registry-packages"}},"4.0.0-feature-0a0312-l5uxzn2p":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-0a0312-l5uxzn2p","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-0a0312-l5uxzn2p","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bd6d2df6ab45ee43cba6df454686fdb004f51dbd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-0a0312-l5uxzn2p.tgz","fileCount":153,"integrity":"sha512-l9Z7N6/5klD4dXeOBVFnc8YVhdEzir1uQ8SiXhcxB3WnvNNct87hFUl2Oyg5xQrVrbOtKIpLlb5VeYrk/UH/Pw==","signatures":[{"sig":"MEYCIQCM1B+gQNYH0yQgsqdvSHAVMg0at//RXBnzwhLjEE+r8gIhAJFau8BH99QpucpUdRREQYbP+7fF7l72udI9WUW+6LoI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2TaVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPIw//dwJySLunBFNHQHvZgKwQXKAD7I4NyNpHf+fnnZzsGrfs3ArO\r\n19pM8aD5W1UuVoZb3JULKfUoh1iPTjSEghAgheY1TukpPW2yINKbeVCnf56/\r\nCpE7SaqAfHDvAHB+RJ105ihL3kEIwe+EYbBrJkUzQVu8oc7CxLT0CsaZBPUu\r\n7sRH5Dfdh62VqioCP3eDHpPJO/fX21qgjtI52csGevMMXF/v1qtiZLMA6gNY\r\n9NwinvMO/HEcY/knvuJozuDhxgKtR5O2ORCRV4xnrSuShaj5OgvCG5sWKJid\r\nkCjS85zpgKu+MRJ5cF0/PXfeUXU9JHCvdrM5rmE1k6JARBe8jVlfIZDP3WAx\r\nmqljPInqbGcEFGfuzLqmqbo1x8LAnWw2ruEjy2IUvB8KHbT/pcTj+H6LXbpe\r\nPUGwKLYmgwEqoTNpBnLYVY9bGQxzBdR30uV8vcOgVh1HkoXlNuE0KYgqVRS/\r\nlvZ0JOK+tKkfXq84fLmplGfmMDxC28GbqH4vq03S1eLHN6oLUA9U+tBkYuZ6\r\n+lhSagpHmMSqdOQn7/gfrOoqpSdnF+7hVyDHjscDcfBF5QgvNrzTZ3tb4GZC\r\n2kauxCnVPLI4tRuXXtEw8YKaQUsqoLDlsqBFXLoebruZEb34ZemcLsVRoxKL\r\n7+dYBCBNb/uzdJiKy+JgUJ8K4vgGOlK/C2s=\r\n=k/J+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0a0312ca3a5a947d82306d892929e8fc6d662838","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-0a0312-l5uxzn2p_1658402453482_0.014839865207255443","host":"s3://npm-registry-packages"}},"4.0.0-feature-2e6f52-l5uy075v":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-2e6f52-l5uy075v","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-2e6f52-l5uy075v","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"75f04f29d1ce3719cf08a0bfc279560775f48173","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-2e6f52-l5uy075v.tgz","fileCount":153,"integrity":"sha512-t0vBQ6EkgVQjk85lmGX3XmJ2e5lXFtmAz8ewaBNdXcrl7fRnnAxztla+Xv1bKLpmGP0kFKAylsSRdo7Y3EMRIg==","signatures":[{"sig":"MEUCIFtyqUzOcyU90hD2iv8N/TPkG8MxWkDhoiuEr28rb17LAiEAlyVVhHOSCi2v6/hmAdu4W28f9tg025Qlmc9Y7J4ftyQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":479869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2TaxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Iw/7Br563dMbwIZxqNc6zfYyYltjR420AV1Lqd89pZ/hxXou6Z9Z\r\nbZq5pMohamDSz/H/2ew2cde1APPYzjtozm1J5ahHJMtKTF7Qtqvsk+faUhbc\r\nfn88vYta+ZTqUNbo1lD4OWXgrR/ol3ilvwKbFlJYxEbwfhYu4n7xks+Z3D8X\r\nHn9QWC+yVS83LsYZcFBV3YKPzre7cdYptVFN/sSfjCk091fpekJxBWCEmnJH\r\neNeOgr/UX2fgmRFTQQMdphKvwN5aExkbvbgnS2o6S3iLFoXOTKPweyhLbE7o\r\n03cMEnmdcOYqzNCzr1zUMxfdBvrjau8X8ZrWZAGqUvBhUZHCBar6gtDNlWyK\r\nJVNvHxqePW18aNa+ZFi35uofiHLxlMUzn2OeYeZgymYP+DDQJcichJRQ7syJ\r\nGMYGYQW3A7idkSIvvvurxlJi2Wt8Lf6PGODdguzWDihkWZOYHL9s0l3XT1S4\r\n3B/0a1ITDT1qYzMrMJYtoj+/1IsUGznTdqtJKQAWSPhZy6eS/OC2NtKidGUP\r\n05R35UdAsOOqk50i0Lx1ZYJnLoWtUXBObK/MMVqgWFUg1ikZJCQjseIEoyvt\r\nDrOPhnTjhz41/6HCkgl4RcverQUMzmPUO29HuFsglQvKsi6i1gIZr1rwKC7X\r\nIdoMWWWzQ4UfRPx6PCYNZgzdjwBVmBPFFxk=\r\n=tbVx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2e6f525848b1655b8972456be8b670ea8a06231a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"2.4.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-2e6f52-l5uy075v_1658402480968_0.46320563687762806","host":"s3://npm-registry-packages"}},"4.0.0-feature-081160-l6apjf08":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-081160-l6apjf08","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-081160-l6apjf08","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"57012a28b539e8255b04a05bec8c79236b5332bb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-081160-l6apjf08.tgz","fileCount":153,"integrity":"sha512-asSZRQu5quaLEWZu+jxS8SmmFTRNAPenzv/UgUf1zo2vvtWFWNXpn2YeCNWFYT8xiK7h/aJ0pVvMR22CFtkOXQ==","signatures":[{"sig":"MEYCIQC+EUF+5lJHOYZCdNRPfVjcnjhBO+DT8VZD2uf7w2nH1gIhANvbQXGb64CqazMIMP6l7k98sPZDGn3gy9PlEfeBwL7R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":461112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi58JGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0ww//X7/4e0PjDfWtRU3/IxK0zBKbZxrSIVX5nUnfRoMC8NSbAlQB\r\noKhQPeREWW0ooKySmXFRr16dOIAncE09E4mDZr7yd0IrRQlYR0v8K2VHYREc\r\nATESQW1fJaiRSb8Fw/pDfMFoN7wJHvEEA/CBF3FqpW9Sm1MMVIoPuQVmDltS\r\nhIW69QV2hqRt+ycC+HHNcqo3ZlSloZkU/eks873mMiPECK7kCtNYhSNeDxj1\r\ngSq08aGTKh9P9ZNUOljGjCjGYl5hWikumAmr0KRENbCmOIUygv4Yus3zbHnt\r\n6Y6HqGqLUv6UhZJ5sc8DKt/MJpWEo5hgQi1DXlUZmV/s8Z73G28OOnfm/xIh\r\nO2t08pGwoGyOPTGrcFIYhFb20XV+22b9x9jVsJ2ism3eH3KmZ+IZmcvruFPe\r\nRFWZvGMYX5E0owPIyDloL0qmpisbgTvoDaN6BCyHZNRZTmRWqcJXT0f4bllh\r\nijCKjCOI97MXtfJXjA5xxhn2SiRFcuoI/zxHTn1ZOTGyVH2xOb0wUzt1F2c0\r\n/BT+qqvgXlzNco7YVoeIWIgvVe0Avlx/4h7ecwBAxZJ55jNnE9fig2yXBdzK\r\n5Cb+OFaSoPGIl3W8ArT0Z3rCmJQJGGdCzfT1XPla/PSEw7EpYvg/ITKEjYPu\r\n4W8FQGLbuxoO255u+ONlcCXVMNjLnoFLH4k=\r\n=zZk0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0811604a715766cada0ba21d8391b5328515f171","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-081160-l6apjf08_1659355718756_0.9000281786580142","host":"s3://npm-registry-packages"}},"4.0.0-feature-d8b80b-l6ar0tuf":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-d8b80b-l6ar0tuf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-d8b80b-l6ar0tuf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"818449f8c3f5c3e7b7c400c55d4b47cec20d1082","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-d8b80b-l6ar0tuf.tgz","fileCount":153,"integrity":"sha512-O+XBGvLYWIKKb3x+MLLouRzEhdlgxWg8pqYJxFcpOabHkWl9ENXDsWj15ttZ7LW/MNuaKkJyvDJGrwfxjikqEg==","signatures":[{"sig":"MEUCIQCx4bFTWnv3inz64VbXoP487bh1qvrLXTdH88a9B0d8FAIgLA83vAco10RPl8i1dJ/ZRi+rpg57uVh8DbEPVkNlaq8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi58wJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpO9A/9Ew4+dCyUDuXOCXOVrF4Np77gCCHwn8lwIqSyb6IaXS6aZ17N\r\nMIMwruiESpWan612DHL2tPuPxzEko9jTZlgpFtlu4GkMzvOSnuBcBnNQJSKv\r\nHi52wD5I5LztFQ5IHEe/Ya0lOOYMoUyaHwEu5CtY/Ps3pMzLhXoiLYIETFZx\r\nCRcDNid3sLikPRZINw8Ilt7K4f8GtdTbulFKkbQQ+UcK7wTbSk+krv21UezZ\r\nU7SJ5srYHelTst6AbxM0bemp+LYmQLe0ZaJEOPrkcNpHFSxEANSqtB/+t8A8\r\nTgZunLGdJwk8xlJV7xcb9J1WY5AU8ITgKkw/ojhaHDoOjiWile/WzdOgjnr+\r\nkgGs3NhXBjMtg21i0h+PBJplabfqqJgwfxLEO0No4ukJllw2FreYrxkKdwgu\r\nO9Z+ZWtvbzac+h5OmG1xu5n3jrtt8aA0bljzZBTDnRPhV6p0byTrYlmXXZ1u\r\nUxJds5Fntwpsg01vTIR/8TX7sCBemmCM7wk8EsomaH0CxRwYp+7b6Rwb5te1\r\nSX5DLP17PwT94wh/q9MLCmALJcnOEyUNSxFLLSOK//lxFPZQ9dfaILp3nqIY\r\nYpUnLuh7+sddmmwgP2VihprM9vyd+SsR0EzZPu2l9v/h22Em8Lkw6XPG19z4\r\nxq2Ky6pgo4WSAjSMHA0vggMN+bm2tQ6RcQM=\r\n=46aj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# AtlasEngine Client.ts\n\nA client for communicating with the `AtlasEngine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `AtlasEngine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single AtlasEngineClient, which exposes references to all other clients,\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(atlasEngineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {AtlasEngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst atlasEngineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the AtlasEngine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {AtlasEngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst atlasEngineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new AtlasEngineClient(atlasEngineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d8b80b4b4b54a463ed30eecb15a92a9159ec94b9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the 5Minds Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-d8b80b-l6ar0tuf_1659358217533_0.34513246535346176","host":"s3://npm-registry-packages"}},"4.0.0-feature-2fca99-l6arst0w":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-2fca99-l6arst0w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-2fca99-l6arst0w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d05f9d0e80343f5287fef03f9bb341dd0f158483","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-2fca99-l6arst0w.tgz","fileCount":153,"integrity":"sha512-sBAEH7wCnAmsfj6EUXtKjrT6eQsVZJDIAG8tEXMMByHO8xvEkJBEjgfvQaLl+7ajGkAPmylvTyVXGrW+0DRKng==","signatures":[{"sig":"MEUCIEc5iC3l++IzcwTc9HFHAX2kNkfOWhIDoC+ANSjH5DWSAiEApZhmgejEyMBiL5xv2rzAUbQTWdawqUBzvYvbxoCkqzE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi59EdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOxg//deWPEqKLwLwFNt85pQyrkkVwkMmsWeKywVP1czzEqd2YiLgK\r\n4kAmJw/1pJ4vUQzQSQzyCNqrE/NaQzkO1nJh+3X+z2q3C8q0eRu2ksY9qT+C\r\nKMn4Ei88LxWBGQpogZVDpp0ifEhqr8XruuNi5ip36Y99YjF49vUqUV4xmyRc\r\ngjpYM2jOxhu/04KOIlmCMTjX1yIhKmYNddYjxi+O4bA1nVAOQZmpCEfUi8xr\r\nNWgA8N4MLlymg6pR5DM8hlgPIgiOCnYHltFPFXMuwBOLZkYLvfXD0HznD+54\r\nFCoUw6JBZgfa9YPZp4wXNAKbiYWNy6DMLIlfv9WT0wR0L4kDyIjcEdpnaz9i\r\nXVVzf3Gm6t0NZ0d3z1HCXgm22bnQpMdyQPcZ9vQw8UJcs6BIQJUyok+aGrgN\r\nXfdB34qw/EUJHEq1iqhzABEq0Ku9lSYDHQ0WA3rALhamPeip5UXD8vbZ+WD3\r\naapvWnrWhCmeu6VkK+Ay/zjVK/nt1CnsNHowVAVfefBe4CmXEkojRMHuamEH\r\nh02FhyKqEX/w3lzGOEluqcbDeQtHCrEh84HyeDu3PbtLXjQxCTTVjRslxj2i\r\n/i46sf7NB5y1YfO4ZWiVvceOtLMF7YY3LF/xvZ5zlQDuUiPLpg0Z4SFOX/vJ\r\npSk5V0lNaoJucRcPOg7ZGSUU/EQTPQz6fi4=\r\n=H8yu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2fca996385bea67a84c0246bb43dd92d6157783c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-2fca99-l6arst0w_1659359517534_0.23619666288398866","host":"s3://npm-registry-packages"}},"4.0.0-feature-fb70fa-l6c6bre1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-fb70fa-l6c6bre1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-fb70fa-l6c6bre1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9fe9b8b7f26ff3d0fa13ff321a9c63cc7d1f71e5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-fb70fa-l6c6bre1.tgz","fileCount":153,"integrity":"sha512-irc6uRKYus/c7NGIlHtMtkWKVNw9C4Nw2Jyks8D1c56EkGnzVf1NN/5akZlNlQununL+PqcyRPsrFAC1RR5G0w==","signatures":[{"sig":"MEYCIQCt6pY3a2uuM0c2lEaY8jUu5gUa1ZLs6eE3G/2t4a3ZvgIhAP1xfOEWEMGG+wxF/vGtHh0G1ITar0CD953WQUOiP7yP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6RyeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVlQ//ce01s1uJw4Z2QUiQYm8qI90Sq+9uLRMpljdwnBLlej99NnKr\r\n6MZVAnRu3tOCqTfeWzLsV/J48Le+lTmAVrJrhhQHsGILT8PSMFfeSuzADNYY\r\nhG6z+PWdbSLoZ3I/WwlLuuMd3wqZWig/c15pq9zLEReSCFApOFa8+Z4W68th\r\n2hCTD3wt8V5ob7szNNnnaQvZrlIeVAp9SuCuIaKxD0nAXtH/b13wxlhoounp\r\n+7Y/DEWozKqqn/cfncEigCgGotIvDGWvyleVDVGNXfaE1b1xY8P4ZbD4moNZ\r\nD/UTXoq4pobDvbnMaOOn6haOLt0l2CR1flHJP+H2gz7T29KYk94EzMvQnmYR\r\n0qeJC+/5++uFx5At99MpfNNo47rTbVSyQMIeMljPZ6wS6E1ode0IXhLI/hV6\r\n3Xdzq6qGeMop+tlZShx1AdCexHRmVxaWSlHmqV/E7Ur2rADsW5aC8vAfJ1lf\r\naPLWIOhITDhVyi9MjVUXeVaNFDEK25SlU8b/0ZwP5ivKtI2610docIRabxaY\r\nKq+ll7i+6AiXcmWva07lrt8EsVGCoBWns7zTH23oYpP1Lifx3OrXO9CaarZp\r\nppKxWNvM4K4WEHyxuLilfPRIZIOnGFBSsJB90rjyMX9KkLGkvYZQ0Y2N/QoW\r\n2onW5UnpjwaRUDU6+mH9gV9FIzHjINERtfQ=\r\n=PrNQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb70faf3e7bc6da669182b6a7358273d2f13e6ed","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-fb70fa-l6c6bre1_1659444381913_0.3049305015775525","host":"s3://npm-registry-packages"}},"4.0.0-feature-346c08-l6c92kr5":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-346c08-l6c92kr5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-346c08-l6c92kr5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"be270e9acf42fc818f5a265b07fd31c8e617322f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-346c08-l6c92kr5.tgz","fileCount":153,"integrity":"sha512-nRv86KahbrmrqBnziDBPTnhSEUNTnTOnTNu9BVMeepd7oLpT13sC2Vf4l1tjRbpITMSFfZxiR9wkEso5rM9LIQ==","signatures":[{"sig":"MEQCIB7uEoj5cm2R6kTdywwhMANHMHfKpZwBW1FKojzSNAB4AiAOaTKiteMGEaFbZA21B/qkN2iw5/nheCfnRO4ssteiIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6S6gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDGRAAiYPlYO8/wr4KanDZ0x5cUnUEA9hPRwpQgfXsxXqz2zKQBTWS\r\nBuCNx1RCyWNPWW4/2//o+Y+DBKRI8ynGNCaosUoFxvl+6P+F4vo00dlBvRVr\r\nj2w4l7znSDM2F1MS04kfHmQ9tl9G6HnYYNJDAWFWFqQUyPVe6Ap3VTjEMaQD\r\nEP16jpbm8HXV+yv5NrTvV0wlvNfuHqVMUe550vRP5HZetsr2qaZ2uSN89D6C\r\nAaNkhaxwDWxekBaF4CydAs1etzLnizGn5MZ6XzEDgt0SMz/wVKzRSDyewQ0B\r\nw3W6PAn7FdhqG48Cj/byJfrcsdK5AmnDd60e90yH0Dky6bITCbiOeua3WLEp\r\neVN2GunpnYdG5w1xNOcp5G9gsXXgCIXezeqK46mbeQvkHrkhYcKOlkovs0Gs\r\nZtJ6oxtenSRX1txakEKf4+ll+FucsP07OY65Zz34OkeEbHSFJ8oN1a0sUmBb\r\nkOrmH2RgggavAEh84HepsJWqH1A866oZdR36c4YCp8tTuZ+jq/9bGSrW3vur\r\nSsRHsE6cXur7aifC3ZLE372dMWsjjlGiTG1Y1+3Cy8jgfFLo7b1aVQZIuUCl\r\nE83J6l5G5G553QCHgRPnHl/UEvdIWC4okfqRNI6o5X9B183LRwVaernnWmdm\r\nffGG3iD+AqXvhtnnuJ/QF+QH1jGEyt9gAW8=\r\n=1Ja5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"346c0883ba73c9594cfdb6f1c96cd4595bbfc226","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~remove_deprecated_stuff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-346c08-l6c92kr5_1659448991967_0.8752726055357631","host":"s3://npm-registry-packages"}},"4.0.0-feature-0f3521-l6dlt0n1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-0f3521-l6dlt0n1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-0f3521-l6dlt0n1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0b802bf79c8381eb1ff40c04e4c04b5eb582be3a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-0f3521-l6dlt0n1.tgz","fileCount":153,"integrity":"sha512-KY8f1R8ttmPjCudEiAwGuvH01/tE+jDgiHgKI/oFzzxT1+KVc8DZSYgc42VexgLnN/5D1JxYxvilepYtPIgbVw==","signatures":[{"sig":"MEUCIG1ZPfof1h3zofRIg0r2NJQSKSiFEnuieNRpvkLTLaFWAiEAjOCWbsuZVyXjAkrFjLEe44F2R5n4njB1tGR87q1mIY4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6m5lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmri9BAApGZHBGK3g+lrW1bRsOHCECcTMaRmwl/rxV4WIKX1Ts+JO8Ls\r\nblhITZ6UPjMakhFZKo6n7ks2kk18e0ghnw8nGFr81tSrY6wcIkvyigcimbjh\r\nEax59Y97SOw0VxT0r1NEVKYWJVGARUVJwj2Nxs41qfBWW3edD8mFKTrE4Mdq\r\nI9+MHhnt/8f2KinI+ZgiV/di7xd0G0H/68pFXkp4ixKk/PWYwaS2qdr3MSYU\r\nH18tbdDWF6WDR/BfRI77fsGm9fpMdNMe+RUcjHcMZtUe7o9mpkATSTyvpYMk\r\nq3WGa5ejhOd/VjxK4tf3WsekFtuH24RkSxC6auRZuwhBTax+IZsoxaJi5q11\r\nDH/HTnFVAu/OOLSZ2TzCpTRj7Nx5MGoQXhwWFVCgrEHuXXG0XdE/jUXQYqEW\r\nMHTbPqOJnC8t9KWVLdAMjA+XdJERY3OtPAzylLo4wBv2uckGRw4a6R8rqoah\r\nnIY3I8HqF+r9VC9G6zL9dZ0kdTDXWy8Zs3E34wppTM4C1iVzF2Lt391ygBQr\r\nwMKtjn0ChOEz/8JrjU9ARvJgEY1MgkKhK8nK+5v4OPnG7w6aF7jKy0prEFZm\r\nLiipNgmojNdD3weU5OsiPEMErqZWzw8+7TNTd6Dh2wmcJgWlJnyb/v+6AIWE\r\ntSxwjmKwMzgEPIolaF/BR9Efd4VwLHSS0pQ=\r\n=GIwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0f352198937a90db312844662dd1f15fc507fca7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-0f3521-l6dlt0n1_1659530853061_0.40153197265645013","host":"s3://npm-registry-packages"}},"4.0.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"551f438fb25cbc6a132a874eb4b31b3c0325ec34","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-egUUO8+TnlTsdRHrGdSd9zJqFP0V+AKncQuektuwjUGbNcziwaz35co7/0F97VD17n8+diUk/MsL7XsPxeMhRA==","signatures":[{"sig":"MEQCIEfmarkb3Cn3FGtGzVkaT+/nH7sx1tkaW93mH8Uk+y2TAiB4B4Fvy/jWfgWo6qsbbwzj+/aVVdDt9PIObSL/nSWe5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6m6SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3cQ/+No8eH4LWxr0CT5+v7OeokzXEa47uzdHU9dQW7UiIkDmlqzGc\r\nErezV32vUU7HK41IFYmydDFS19usJyZoS07KYv6MASwsb/QDjp7Yh78Y3/gS\r\nDXbtasL9B/A9dqXQpa6YZq0bkQR9w2GumCs9qjDDBl72ShnNK2ruKrd0qnwi\r\nOep0JYZsotNt5Sl5KdYztm7JxMq+OkUrVePysO+Rbdpj0O6He4b8OnxHDOiB\r\nX3lZq4tgKKKfafmJfh25FHdD6S1chWdI7NWrrrrV2WNY9XNC/rljG6w3K5D1\r\n2ZJuR5cl3QBRAmFUSbeJIisQsTyiS7HiJdnhcdMjQbjn4a4uAbk/mv7iOSZT\r\nUUK6vmLVR3iFxGfdRziI+aiJDrwIJu/AyA+jrZAwcQUG3GT29sI1JT0I8vdF\r\nsE5yCyWr5LSS6ug3umYAwv2vSVzxE7JMw8cWmfnZNaTz5g1hfLmvf1eFdnZS\r\n3+PR6+QaIgUWAfpLfBP7/OFA93jTGmafKLmPlOAX7zNR6RGB7eXbVqbWQoz4\r\nqv+DY3vrsrUgUf5DIiwTYnT/tRToV9IjhASY54ONrWCNvJjC1heEjMJ9JN47\r\n2RjKvX+YDGArd8yj3XcekQxuDnDW5geoPPCXzu7/+4dDzMSxICsHrl0Jilri\r\nNeuhUf/8V1RKzw59M+/HnZ1mB8E4Bkb5cMU=\r\n=pBMa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"32ef2ad66b9f498c39eeff63d52751106ac30272","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.1_1659530898569_0.14058965133324075","host":"s3://npm-registry-packages"}},"4.0.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"122068909801458c1e60c0bed8e366a0d73ec630","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-beta.1.tgz","fileCount":153,"integrity":"sha512-cyPLs+QvGBWHFLTTkARZpqs/vGVLbrU8OFLJM5sO6pXFU2Coc/17aJYBo2hSy6W/UPJU+vAipbs5kgoHJ65M6A==","signatures":[{"sig":"MEUCIQDB42aTsZo7OhuRXrqALMODy5DNDHh/NVI9S7XDCig/gQIgU4aVgh6eDVBV8QMJ0rNnFvNbwQHY9t1gCWX5P/m70ag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6nASACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqP+A/+IDKeqJbCmMUwjen4DNCuR+fiddzo3gS9f/+mDa38BWaUN9dJ\r\n5l4A0OK3gm9nk/Cp+rwyxsZqEH2t9OOWBD554SyOTSOdJouLjcNjsDhaFkKf\r\nI709JQzwhRBPNGrcYW3b88t0HBEeAigleCw09qcqb5OE8WHEBfNyVaWNuRyJ\r\n0BQ9UY55KFAW+pzHwwEl3wXCGoP6CC5KrUiRiy45CjuOBLPljSa4InEHF4PK\r\nXrMm7/ImSmPRy3X0GB3ga8c4O5mK+9Ng+Ue/OKTaWk3O/9Rq/vLKdsP4wPSB\r\np1/bKO+LJMxOhg5sf9tiCmUDGUwAmfWrXGhTWpsPsFsQ/yeQx81PgXLEZM+8\r\nssxKOw18tGNRkjrB/SWQLtMVSjqtVDLPKDIUXiz8P3wxukWMBNelutsnpDtz\r\nqqBKfKW70t0WuENORA0czjXQ8hJ+62obf/nknknCQhzl3L9bltiR6sgKLqX5\r\nzzbQuk0dsdHjXNqFGWxxq8aq/LMXxxlV602b37d0ANQ5bDaFzgZltCYz5ALG\r\nJHCkY8d2vl9yy/Bxf/5IG/S0WzQ1zJJ38okzJQQn6Fm79WRBvPEcuazZPmkc\r\ngUmbStNc9RLftR7MZxRnXtHWKxHRmNhYOcivLQ3qH6qVJWJVCN+4XqlcLu9I\r\nH+fIkxGIm+/Vyw7JtDFg/BSmqribUAhsfiw=\r\n=yzJj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"244daec844fbd68d025bb106c77c3a097a9ca518","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-beta.1_1659531281966_0.4283169661768702","host":"s3://npm-registry-packages"}},"4.0.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"93fda27583c030b37c4ed5851bf9db56cda6f26b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-beta.2.tgz","fileCount":153,"integrity":"sha512-AqrBK6bY8Lcj/MjN84KRjA2HRgw3EeOpQQHB3wXLvmy71p1TcQOAqY6Re6rGCijjKyz1nfjwQQaDSUGaT1IS/A==","signatures":[{"sig":"MEYCIQCwcLyP7Hn00HiiP3lNSLXpPIpI5VZ8t5CUYj5Nwcxt/AIhALOkbytuPltVCZH19EZl2Vf6GHnvo8ftF8sgIYKTvdXL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7PeVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBGg//bmE39Ea7wA9k6tzfE69xWlXeTtj7y4vT7km9gFNXgbqGen43\r\npQdNv61PBJgYJbn7ry9IJ+3Cqy4HXeeF2Izth3jifcwSyncCW49l2sBlF6Dm\r\nhGHF3TwwlmjUmedFvVXFzb7WvN/A/Nh8KFKdAUsCzaq6Cb5lZxIByfuxCuZH\r\nzRJVw4WgT5aI4pB4NfppeT6P4hFL5ctcEcjuvi1oQCDe+uQ3mmb9AAzIsIiu\r\n+KMEpmV/vMXe5Gj1XCo//gs2o05pCJHo/IKTDFMX2UB4wYbcWzk5PEwW8a3p\r\n+VPAWsRK2vERoWp0sAmnzPw3BNisf3HALT4lvSBMeccAAyuy0AXmLGXyqrAX\r\nmouUbyENnoBzgVXsiqjc+izxKuYCScDryZbtop7gRjO7XHNGNuh49LAiWopu\r\nf/7GphJEljDBGF9F9FYDttb/6YRKFLH+nJ+IwehD6NRO3yLKYUHxqdEhCKNh\r\nLWYA5UjO02lgS/cvldPOHLx1KDyF/VC+/v0K2T9OG4MLCrhrrW4RHilb54XO\r\nLwyY/t0jz3TsiL/WowYO8UlghnLca/NfwwPwfc/r35NmQ6DvKLxWJk7PcOZl\r\nO2ZwEEe2mx6WDxPFaUTqZfzP1qQxJGpKkeV1MfvO0EJY9iwpYsJp8ULOyn/r\r\n9s4HU7jxXKuqLK7hsA4dSI+hANQcbciQOOM=\r\n=r9KI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"088aa827093ce487c5761bf6766891244ae5b42e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-beta.2_1659697045172_0.9077913307964374","host":"s3://npm-registry-packages"}},"4.0.0-feature-502e08-l6ki4j6i":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-502e08-l6ki4j6i","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-502e08-l6ki4j6i","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2725fa50bc33539463df28efd5e3fdcc980f0057","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-502e08-l6ki4j6i.tgz","fileCount":153,"integrity":"sha512-uwzJOM6R69u7S7ujgKd/M9/RjpaJieTJEgd09T4rKSs/o88f4v/TbfQjN8enGN/8O9CsXUoUtY37TqE+X1QdmA==","signatures":[{"sig":"MEQCIBVzxzzbtm3Y1g4w4ayFaulr3jcs5yYs4MqMKtq01gp4AiA6GZEiTqWIqnggZIqDMqbEkgGWdKxpJA/94rHASIC4fQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":492832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8MuZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUWA/+MkiZjmSPU7ZILsMnSFymOu2pgWxEz0vOw065aIq5QfdPEssp\r\n9r+B9KkaA14t7OBWRiUJLUiyX5Ec/ezb+TPgDmulwldPquNVoocAsa0f3jLm\r\nZsLoKZT2X3KLsW++/rdQXNcyCYscr8PkkShthnLuMINKQAsXucBDdZVw3vDI\r\nyrswzrIRiRoOhnAGcf4FTRxVbscTBqyFlcHG9ipI538N55fLS0rkZyde7brv\r\nG6ZBLrZGyCc59cD3SjXKbMjtmSn484awqSiz0i6IxrO6TgSiuLENFXHBBoLV\r\nh2EJ7qmWOAEEiKG6SrLs0HpdtN3mJp8c9C+96Q3LP+l8ffNIlcEjKMscIvea\r\nA7746nuDBfACxpy8jCofzsy0PF8HG6ywt/5gOM8h/6kptLlcSL5VOD6fk3vG\r\n9QsE7HRHl3ndyflXpeu93VvV/3K3at+QpZ7KMuuBF1GaMAwcDwQDIlXGkn32\r\n7LhnKncMwgygAUvP1hjKoAQOkR8KFU1PNIVbDgEDQ2dMV5th+5BV/oxD/isC\r\nnmdXBSrSPlhXP5zaZ0TNqbGxNdZ+0d4TdZeJQO7U3UfxgwAIj6lUhbBOBiVP\r\nJ3iyAs0lifb0o8zw1EmOVSu72ptgbUZ+SbWWdmGMSX8KAR/droeNNdxYPIqC\r\nnz3KZx6BhM9CH+XOaqyjcv11tbzMTtv3n6w=\r\n=FrpA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"502e080b87f74955203adcb0cb0fb0af3221856b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-502e08-l6ki4j6i_1659947929260_0.4513785640318224","host":"s3://npm-registry-packages"}},"4.0.0-feature-5a08c6-l6kj5mu1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-5a08c6-l6kj5mu1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-5a08c6-l6kj5mu1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e52218b31e040b1da4375a781342a65dcd01cc15","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-5a08c6-l6kj5mu1.tgz","fileCount":153,"integrity":"sha512-YS/aTZfCaeYZAsONr8EOavddi2CwlfkqVPtfjSk6jhxwSTyBSNGsGpX/Cy21Zwco3re/UXuiqNBU5Qo7/bbfVw==","signatures":[{"sig":"MEYCIQDYOufQwFGB6zqJWaLnAJz3LRCOsRqPnJrzxu8SBro1rQIhAK5LPoE/BRzG8gmqsfVloS90rDX5j+/UUhYubVktMHDN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8NJhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdnhAAih9UgjqUMfgJBBTTLZ5fAeXA4JIV/JAqi5n7S4IJr/a5lhdN\r\nimXaC6mCZFTVDEiv7rihN0o9cZYKSyGxzUdw9N1s4w9c4lyRCQbV4yfIcV5G\r\nbrZVf7WmucWc7sdonvF8iiATOh8C5j7w9UDwGcYUq13cOugsV+LOJkPcFUYe\r\n4aDk49lPjUZnwnFlscwiB4VWO71Xew507noIqgV81mT3ooQNEv8rur1RyrXW\r\n3SmVZGzy55jioeVdTZoNi4QOdfBXmHb0PIgg/l/CWmXGeWM+IKtw1rBBGiu2\r\nE5nphNZt2tcZHLNbCtVbb9aGORN8r0pZmYbjY8MYjeL1VF+gNqihBsnxY/WR\r\noGAZlhJAXnxc2F1HuBBrUIvkDDoCk1UkD3gKjUfqnWpYNTsvcKWgvinauxMB\r\n6fRVy0ZpJIdBSxIarumSg0RP5+oi4sftcZx7waXINPE8rT+YANzWq3kOhsH1\r\nKRinyag1sOHOwMrGelY/ci/ZYU3xBBaFs7E5vTb0FiieWmDgsXD17jOkY6EB\r\ngydXLcVmapSYpzzYOTC33DFskbmlTdtar0XebESXSA4uxCog4rgtFNaujh7N\r\nT8ZJ6GWmjsLEB6nPSLDp/K4FgsYoMvNt7/eCyyTNbSG3NKf8UAWhgLhw6dvx\r\n8P9nPife+5oEgpUeH/2fFfPCv5Kg5V07kDk=\r\n=Mt5C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5a08c6bde18f7e1bb5048e01c574c3c10abb381b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_parent_process_instance_id_to_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-5a08c6-l6kj5mu1_1659949665204_0.41309005834618073","host":"s3://npm-registry-packages"}},"4.0.0-feature-2d693f-l6kjt9de":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-2d693f-l6kjt9de","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-2d693f-l6kjt9de","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8afff7732b538c6017d45917ad1e59e20d108f96","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-2d693f-l6kjt9de.tgz","fileCount":153,"integrity":"sha512-OXzNlPK1NEev5pT2jfCD2EsJaIu+XyG5M4BzK8Ifa5KP1uFvvZ1m7AEaMODVHamrQ+anzv/KIHb7eex8gGPvMg==","signatures":[{"sig":"MEQCIC7+jLBhcn8FbBrebA3JVxZVQp7d4yigj1FzeuF0JJufAiA9t7yXZSav0I+XpEQXKSc/b0faiBIA3lsPRQ9IaVdJZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8NaqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhOQ/9EEqOH5jqU3QEpj6gEcVoy/9NrwHn3Wlb7kzbUsB1uYCnTCeI\r\neQdmMNTiIY6VX6ddMH6H3XUxPiYznewYjbXtGMe8ign4wfWZgn18/pRnI8kn\r\nGkDXDkkyf5Vuj5vzKqUhM5d6HWR27inKlKxjvXYUyp8cVAH8C3zlZPFvdnM0\r\nf3wZ8rMvyqU8LWgRIXR5B/u2yGXyn1hIZWczCpTQnQ5ExyFFVZtgkWedZImb\r\nVy3Mf2l8/RDbvqiAeSZmFhCVfovp2+fs2LgNIyOOdaXenQmK3QnmK9H/buEb\r\nVf0NDhfhFzVfdjq7yW07r917sWMNDznhVNwAJ3XUPWAmZRlhjbbHyu71JNUz\r\nY3/44bC19TXuM6NwYN74GviduXKZdf1C6LelDK/eoaBDZYySZxiXdbHqd7hz\r\nF3Keb09tv2lccO9H4NW9f2ByI64MMr0VoZRvYkmatES+wxwIojvNijJNsTO/\r\nIaBM+de9kN3z1J5VM+oid1LbiEszMJdojmr5W6DF3RFEl/12mHMsoP9OBDni\r\n1WFALk7Hb0zBuvj8TQ2DbY3eaEa2JMEkRV9Yih3KLPbWZSyDoB/LeI4CVwyd\r\n4uZX1THg8s1FF+puPG3Cmork+S6pKu2uiPHZjizV50kfDzeBoyF+f0hmJVjA\r\nWC0yZMksBt5HdhBpuFnwiG+1kWD8H38WVhY=\r\n=VwOQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2d693f59991cbc0894fda1990e58a2e16e15789d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_parent_process_instance_id_to_events"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-2d693f-l6kjt9de_1659950762696_0.0732716294557223","host":"s3://npm-registry-packages"}},"4.0.0-feature-895562-l6klxqrf":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-895562-l6klxqrf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-895562-l6klxqrf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"076f05d16c833ec0332bccc8ed091077b23a4a9e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-895562-l6klxqrf.tgz","fileCount":153,"integrity":"sha512-Ww6ZYfnpEFmL3GBsxPmC6fFOc+Ck7slRTQGtEfG5R2LoQE5FAo3hZ+TQvZo7CjakoCavl2LDRG9wjK5pBdvjXw==","signatures":[{"sig":"MEUCIDCgrcpizTqsmyeZef2HcCtosbPF4Dl5YswUok8A1IoyAiEA8cSYp8j5i4OfPt3q2YPXDzFYykSo6+/q9pfoVSpKdZc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8OSbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpzxw//XBwaJ9pxFIYfrEhOyT0VULbQrG60iZ3dL/crVXuPXcMQk6+3\r\ntIrdr4XsHkfKngZlxR0oGLNEYleOb5P4zGP3c0OE3Iwbp3bB2+I59Y9h/s74\r\nkk4zXAyfOtyJcFOhut/00KLJEtJuI09zJCy0xGCWBYrUnGD/aSIR1hw9DX+g\r\nOQDJzq/CWlywUQpBpdaluZi7fG7ElXVdnFYpETFYimBtcIZHswABMU8qQhPn\r\nXoH+46ywQ/8hgI01CadusxCmfO5pkkCGwJ90zlaMw02r83Fu/6vvQPMMrOHW\r\nf7TBod6jb12dJHPwQtKn4bCSl3Q/k+CfJserP80sO+UKtfyhU47T6AJ7KeOI\r\nODo0/hsX0E31PkqVB/741fkAYXZopl+xR9IpyM75mTBsHt1daaQ3oIH2CZAV\r\njVnX1IWQG0JAZb9Hfh94IdY6tsu4Bt0xj5cdzIj4LQxwacwCb/QxATBEPfJs\r\nGEhPcKtmzm2t7NXn7g6EkQcFjSxcQxzLGrVBxQNDnYLK+k3La4CxD8FDHGh6\r\nST+FioTRFFHe7MqTpSAP92izNsvWpF1OtmP5+D/s2b7WAtGZxaJop1RyrErS\r\nlXzq+p1SKidq0Az7s1QuHYpgu0uOEAnkSSoGhFYGZTno8R5sl1PXULj7FrEy\r\naZWs4CwxdGYoCcHqmfH3ZkXkg06rhx8TVNo=\r\n=PIvs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"895562938c527712e3aaf1f18eb7af6e133d2f9f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-895562-l6klxqrf_1659954331052_0.7851519769043032","host":"s3://npm-registry-packages"}},"4.0.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3136419846e11f67bd175d7afe09282a9243870f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.2.tgz","fileCount":153,"integrity":"sha512-FfHbfKd6GBd0kRfaLWCOu9HT57+fU4cv/mj1HU2gxEYyFYMlGk4xMNiF/wdEDbUfIOqdze2uKLfm8ocFmIQszg==","signatures":[{"sig":"MEUCIQClcphnPXV0r0mdcaTYrxim4pazoFGZxr49j4bv6Fdp8gIgDla3tBeQuvQF8XwoSOSqN1H5Z3GNnqA53TMJyiumdNE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":490215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8OUHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqdpg/8D4BCR638hfGRE1KWf1Zxv5lPXpgNKVwGaSKlYElYf7DT15GN\r\nL61LjTLUCv9YPiSWCdQX1kVaVYavYxysVjnnKEywel1iAh1Uujiquc1ZexvP\r\nmjswzoIQjR0DDJpkOVBVnP/8wcS/ktNMKtYxHhDVbR1t0tNSnTT3ecDCibX+\r\na0Tteu61UJku30+aSZ/usnz8q2vjDIx0zrNhinaC1pMT9o1gJpcnVsBqjD4F\r\nx9CZBfj7XQ7k06yXRblUChcIzsHVuZKvESOVpKsVS4SwxpslH2T1srbW1EXM\r\n9LSW2zW0HJrDaPUuWH7YPykn55YkUURFz2McFxNEjEjgcmS9DUAqruUqp4sT\r\nvxI87VndTn4Yh3c5dmoMb8Vw7TaUJSV2FOdhxHxhU2FfUa3ACU2SgnLSCvh0\r\nPqp6SV6vZXfx0NQ0WQsb1wRQpSnonjZcRIJXKH8GIlZsb9967i1RNTre+fx/\r\nLDMRtfovVyQKCeeKARAA5rm84/7lcBl0GrLSSgBerv0YvLMUCz2ths2U/lE8\r\nSNTUtptee89gcj8Yi2qWtYkLR7ywCbIbpU8YrdcAMvwPJFSWH9/DmmKT0Xct\r\nJhRPVzEK6O4M9aoO5NUY0eTqJ0klo9g1N8FP7sK94MmB5pu2xoBpRuVr/JnC\r\n43taB3Oe1JZBKEYSGBvF/j/OUp5tt5LxeOM=\r\n=SEY7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c4f56dc4c1bf419248aa7ba9d0c3860bbe894d31","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.2_1659954439547_0.9578564546039967","host":"s3://npm-registry-packages"}},"4.0.0-feature-508b5a-l6km2ivd":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-508b5a-l6km2ivd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-508b5a-l6km2ivd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"33aca63243256bcd7792a6ff008c1050eeaf4adf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-508b5a-l6km2ivd.tgz","fileCount":153,"integrity":"sha512-9wlVW5XwErRqf0Y2t/2tulqrajuptdgScotuYfphyJsIxycScvGypw+S50olXjSv1OgLnPuMipd6m9YfQzGrBg==","signatures":[{"sig":"MEQCIChtFUVDpgDAR1NHLDL3NcOViPbYDNUOdQa8WigAwBwHAiATt4LIO/ESn4l9YA019vnNcg85ieKPRh2vHGCjA8XEMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":492833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8OV+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0gg//awiZZcUKINjT7nGEfZm5CuQ2R0KZOspN6bmByc8Eo3uKHh7C\r\nNOjsSK7wcCLdNAPgwZf0xu828zyaDNGLvs5ALOmAh02/aSseL8yNwvsPW15j\r\n4fv6j2uDsIMaY1VBZwT1KCrp9AakMi8xWJrv8S0CmFwBcwRzdbBlGtd5tMEL\r\n60G+Sk/OJsCxpYUNhBXkJr+cAobKwbhq5ZOC34U4sd0GcJ7D3/4ZEh4cxmGw\r\nkSrl6gbvMrHihBtzOHTfSLcgCg1J8k56to/ZX4L6WW0+zur6sgZPPqbax7j5\r\nc2TYug3yOImSPA8xu0ZXkmISwjgkmJDAB9mT0QH5T01DT/gwECnea9L16mON\r\nE9TbMogCJS8t+tuGvnFKYBxRB31U/Juf+9xodp80izl3sGKW94x+agoW3/OW\r\n2IxkhCsrpVL5WDRbuDmUcoE0xCh5GM6QhLWcZ2iUWqAjYy3g4zFaUNJWMVss\r\nCuCPUhUjSYs1ZrOQUtrQBBAcTeHp4B2t2eBgiPiZuLbdGW4qxDTmdimFst9X\r\nT6zwNyIeLyd6xCQbEHaQKssj/A2gA71EnDBdxzBTRPLyZyab+3tq/31fqDjJ\r\nJCDqaFybAPz3Nmx42fdasfviJGCltdgAh/ePU6I/Q9mfcvOtDS6cz1EIV6o0\r\n/JdYRq/lG+pkd8tmYtPbsLGlmoJm9y5yN3A=\r\n=K71Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"508b5aac6e3af77098a8f5d2413faa524c6dbf6e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-508b5a-l6km2ivd_1659954558265_0.347147273802362","host":"s3://npm-registry-packages"}},"4.0.0-feature-760a4c-l6ly65bi":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-760a4c-l6ly65bi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-760a4c-l6ly65bi","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"09181d7ab017d069c0009753e006eddb5cbd3bf4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-760a4c-l6ly65bi.tgz","fileCount":153,"integrity":"sha512-aSnOdaE7BhPvLoVsX2S7ODcGzvwFTDax8lvNbQWCnAq7a8XLmI61/eICVcYjz8NdvS9muiU4o0MA3ISIPOhJRw==","signatures":[{"sig":"MEUCIEtqwaGyXLzddTWO9VjSjjS1owHhr4bjmHlcxjVGbR1bAiEA0RRlXHoOwGezy134cpn74z4jND6vj3SADw8TfsfQ9MA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":493383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8iESACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmok/w/+KImSBRHHOf51/jAa/2FGC+lukaLdD+9B1sqWaAlet8StXPQ3\r\nIz93eYXnFWbNyaD4txIsIte+/uIfgpgNOncaJwqDWd1NhtckdcqjbM28D8va\r\nkWsoDIBG6Vmh/8HmdD/5d2fxCp33tk94MK9efezg9uaN3bgEgSkkayVVAiWP\r\nA9ujW+cQySFOgeS8e1qKScHg2j5UFrPBu9/gBf00zIkpbZgaKhxmv3pkXGZi\r\ncquIbOF/mUSvmYvMIbHEkmm6iUnUeIfrqbrHjtjl65UWGf8LbIxDEY8w4DX8\r\nvupsrBT+VQtVqL9if7tKFyckU0KEm9R8FnoJvgNlGf1SRO4ewElyx//4wrXM\r\noI2E6Jhc1Bya6K9qRS1DgwRb9T2c9iI/CsyXJZpIcPitXwXIij6LNwWIxXvx\r\nY/40X0fUEgqaJKysBF6eN1JiCf0oVb9YnUad48z/wqo1r9mm9xoF28ydaqnc\r\nxITkS+KS4p+TV5qY7ovqAWf+Py4xjWLFB1v2KKuIUMraiB7Thtpr0TJgoK+b\r\nYVZGk1VUaPOb3x2C5ivToA3mQ4oPkEhL6pTFjlOBPxrcUnGcbvHIoCeERrTL\r\nC6jOe3eMzn1l6f1B+qRSdf9/pHXXMWeyjLs0PiaBdWfzqHALGyI9a1n2LaXg\r\n0Ev/c4y+UaNWbFYGR1fvBado6uh+YnQrMCU=\r\n=oNNt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"760a4cc3e1e98006e0844d527d42eb91fd014a08","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_history_for_correlation_and_process-instance-metadata"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-760a4c-l6ly65bi_1660035346228_0.5136356516870435","host":"s3://npm-registry-packages"}},"4.0.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4737d7fe334acf84384ee032df8b13700ddb8990","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.3.tgz","fileCount":153,"integrity":"sha512-W4CoVV56ga1+geWfbv9Jzold4/AM1vjoFD3nsKhT3dbeSOj5+IP5l/yx04MVoFG1DMOiXCZteNiV8ZDwV9Bcaw==","signatures":[{"sig":"MEUCIF48fiaCnfIFCkWGBU+WbFV1OJlO9ofHMeJnLuZeJMWhAiEA7iiLM/6Is08XVDYmolmZcMnT8edZmTCWpq6Q13Ccheo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":492817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8kyEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpp1hAAiQ9dEanAMLbCPJXMhaoVmZMbOQ8LhGP+WlxuwfxahA9gW6vz\r\nD/djuLkIWDhV/TrCAJoDS1BNjJ7i9aQLOJIWKKvOBvffdLM2DAdzvHIT4o3k\r\nvZPF89/MAwV5arugC3W8UFTVQ2UJvrQO2p+EWnGw966eOP4N0dxLRNTvfEfb\r\n/BmisTxfOLf+A8xiYqa/tKVZN3QiWQAYSUo15pDSmVd5NHkLPNcCkyM49WtQ\r\n/aSCL4B6p4mb0Q8MLUeBhwbgaXe8YyVL6exmEfyn1IWs3/5Z24SwyEQrXWIP\r\nTK1kE726K5A9dx0SHsuqNICIzeyFKvOEYg3DhbWNp9GxN9aVZcyyTfJkqgUw\r\nXsWZ2K0eyrveMVSFEkzbfeusnuT9loHyB4YtYoDtJSX4rRd+6c6bzf5k1clX\r\nUVfMOF7le4H+33zFENueTo7J42wkjgHWDEiMq4wdPJvCrZNza5zarTimVEOl\r\n+FpRMMUAIinuo36pPpaXYjtg/jZG2VAswtI+7ZXuh9AUfq7mV0IZRn9Y4sKs\r\n/PuTQkD5gFUuFhksgFuGhAnJ1ASBCjhsWxEYbVEZIiyjQGNI2ycGDksINqO7\r\nPEKb1Husafj0yipEk79tns0fEoFqgiIZ0wprsLgHBPqyQD8vvNqEQm4On9ms\r\nGgwmIhLaSJE6bE569HoKBGrmudmU5kjCMLU=\r\n=RI4p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b38b9c44acb643b8efcb04a3774db006cb27817d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.3_1660046467833_0.42210593845768885","host":"s3://npm-registry-packages"}},"4.0.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ce0431df8919b9617df3e7babba14d716c54e18b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-beta.3.tgz","fileCount":153,"integrity":"sha512-sJPe1lVcnt3f2SBBDTZf+ZRDXKlqT1vIWrF9GP64CCKV3IpeIGO+ncvUhkiH3VI2gbrYGoI55Wtzuox/n/YeBg==","signatures":[{"sig":"MEUCIQCormhVyRxpB4LwQzEjJ26EP9YD7sr1Rguouw3UuuWOkwIgPNmt/z+WeHq7SFtrT+KKMGdXkJc0zdzgkUMu5/K2Ncw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":492815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi84T3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTaw/9GKpTt83wGHL8yNF7Qm7ocjpPxTwrad7RZPZUNyoEg67mnuzL\r\n5YzKtUizYS28GyxgOWBVvy3+1JRWy7Has/i78UH8u4LnkkZgjOUZiCOIgFt/\r\nHlpt97CwkC9q4PquTWgFWb6Z3adiFRZlck0KGpN69k+nP81SVpqmOxPewcwN\r\nUOIws+jkZdFMDOQaCK5CgEFJCY2iv5EEnZR9YbTWcNzi8X08rm7yK0w+4RK/\r\nUDa62+aAiXp+Km1+9ohc8W/lUqguWe0ttKxEasVUdmG2t7Z94iYh2NFEM+yN\r\nlekBO4Ockrc3Twjl4g0XcXk7qorJ34CwQfcOY2AeyeMt1viwY+bqkvm9vi5y\r\nl7yRYYNCdsfEuDQPU0gpwavMuIU+gwp75AxGDODFDkR+FoQinJCtFWdPm6xK\r\ngtMkpIT0RbxLHqcJqPuvbTPZ1PAKpy2mtCIqIsvhj4bA6qOWFqfBjFMf300g\r\nKLUCek8JQGdOWADdo7/u5QtPjqdOKYqHeGdbxrZQ6YLs5H6/CnFoqI1RcHTl\r\n6wGF1FAnOEeOs1KuIPeGM/NMd7vaZjD/6tg49awcyQamRE2s/hndQFe8OLwk\r\n6EI2yDUaZ0xkou1tSoD5P165V8N3XRjRYue58d/0nnwKv1JmyBE1aXJMaNaT\r\nD1hwN7KjZPzlp3BDxZr/LOlsnaa/w4FOP0M=\r\n=LsRS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"53839fbed947c1e688b892a904f34639f1d84d72","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-beta.3_1660126454876_0.4145620626779378","host":"s3://npm-registry-packages"}},"4.0.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"865232ed506401a58bc4baf90a85733a0f3a1f1d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.4.tgz","fileCount":153,"integrity":"sha512-mwsDS1H6DNmOv7aE7T3ki2g2KTpkM7HAd2VfRZJjyD76akAWSHs7Agux8skfsB/CV8x94NsLcvHvlRHE26A4HA==","signatures":[{"sig":"MEQCIB2MLXcPsk7tbYLNkoFLZH+RVnpIFfoXoWXNN68og8DmAiBOM9Ic5TNSpjsMxfMj4uP3+qJI3RcDmhBvwrQHzNkzBg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":492816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi84V5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolVQ//Tkcmqji4YRXXbyhQND//dUnQxgMqt+CLwntCkaqQgBjAtJPv\r\n9Li3H2pA/eLGTEwMRZCPZ+j32Xcr5W6pbFlQlb2HUAvBpskCklyB6ff0FTr3\r\n2rJDL+3ozTXnXyq29G9XIgT4iZHRpJKHCa9OGsty2UidO7TPix2QcGN2Q99j\r\niJKZWpzfkD84Cm/cmdHuA6BzOA5oBm94yLW4udJzcER8XVu9LiKe1D9VE/D4\r\ntR2G6R7qbAvRAUxXwqhyGnMFbTkfkBy6C70VvqOyTu2tzZv7Yy+Ik68Hhb7o\r\nhS3jQCsqtfhSQPe3JaFPEToaGD7Da9H2WNUdfXexbpnL3ldpvTabvrtKNXHx\r\nQIGxtKr5sJGYo2weDsnhXf5Hy4OMgBKtW0L0uS4OSZ4C6hJz1t7oJf7SXoG+\r\nz/O4GQhM0+m+OCB0ws5uUdapsPv0K4HNtONBJvbGvH3J84HTRhHSBNtIG4pK\r\n0eZOoLZeyldlK78UrDmERPgFzGzF3inPIl7akdvFVPsvHkW/SfBzrYlaVoh1\r\n5gKWVA7okUUDqq/zL4hH/tLQPh/1RkLgbvFAUFR5HXoQkeWjetpbM5IVUoGt\r\nlKLwW+W/M/YvxmZTIM1sH/SMG87j/ofq7qYHrPH2s9dzK/zVsSL1gk/CMypz\r\nXDz7Qi75Ki6eD6OR8b/qdYh1NkISq9/Kx+k=\r\n=MiwD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d2386b0986d1a4665d46a03e1de348408dc6366f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.4_1660126585121_0.2928029621220267","host":"s3://npm-registry-packages"}},"4.0.0-feature-938dd8-l6w4rnjr":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-938dd8-l6w4rnjr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-938dd8-l6w4rnjr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5568e4720903d366dcb8d85c5c199c53ed679470","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-938dd8-l6w4rnjr.tgz","fileCount":153,"integrity":"sha512-oY4BzYJTujl7U420dXoHmQCiRwcFieTFq6DOan1cg86jjf1YF4uEGSBtNYuDZ14edxlgiLcE88zb0IjE0mAuew==","signatures":[{"sig":"MEUCIHzq32WiVqyGjPWUuxYabyP2K1F9d6HeKEoTOLSHg27cAiEA/Q3J1dLOcfTsKzU6dxUgfU/aVni/jmxGxE3VX6nM9Ug=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+4ZQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqH8A//fdPU+KenjIMj2dti2NF5oeCShlzBQM4hHfsa3putjIa+DYsQ\r\n6snUBu7R1iyB0RuQOAl+ASwLsTXd932UEfTSIn8BdDpZHkUzRbs+qdZs3sxQ\r\n+LIEdsWRstYLzd9Ku0/g9ixh3T+bVNV2B5It5iYEfgcbBq2UCAtRBgnnVHhG\r\na29Frzyr6d//VUo1stnveaW35+t3VpdMOw4W2DfGp5r/0ECHZ0cJaMmMXUew\r\nV/+mlPA43tQPfQOeIOt7f3L2tVAG1E+MbmjfGalMUd7h94/8qsN+Fbr7fpP0\r\nRdwLGwQVLvLvhxptC+K5Psft+Ty4a6WxX9IqK+JQmU+kriFezN07Ly/2k5Ka\r\nMWA0ia25DaoqUo+6Sh3FDNcjxg65cZj46WcQvK3dWTpUkNcHuQh3KbtzBWoj\r\n/rzDEkHE9IPjAkULXBEWsONVYtxIi3FR1tiOQy6u/wEEiGJerUbJF2kBZhQr\r\n8yUe5Y9G1TkvCPmrirb49/Lrb/7NLwKTpnH50uWMInDJtAp4ZxRTdCd7mqr2\r\nXhi3JCw5GQ8VQbcIM8grG9xCqIQUy1ejzhKk4H3YLzX0Yw7Oipe9M82HWAe6\r\nQPdhxhz4rDpfjvuO1yAF1Yg1u5yrKviSdFF7OAlYk5SJ7y/CNArP+54lEECD\r\nG/r5x7d+1g48QyCvuHwsO1LyHTmiAUAEmhc=\r\n=ab41\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"938dd8049d8253a0b3bd93fe8eb1ff2a8d1ad371","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-938dd8-l6w4rnjr_1660651088212_0.04212944584801881","host":"s3://npm-registry-packages"}},"4.0.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d85351328c16953fd44320b61b1fc60af8064740","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.5.tgz","fileCount":153,"integrity":"sha512-gYxoQJnsRl/B8fd56lyIuwSw4cD3u9seh5i+ctwPhnxVjJW0ko4fQum+aWpYes/DBOgydVqUrrQHucMwMSvRWw==","signatures":[{"sig":"MEUCIAHR67TsCmBMRz/H+h3hsgcfd9JPBV1aq+/IDhRzaVVMAiEAsOv3/Dztgc3W1bwdaOa3qp/0su4ci9DS3a/WEqViMiU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+4bEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrmnw//agIIxOVl/lVC7Nl97akK3Ms2WVHdfa2BAyOu+U2wXrCWZOuq\r\nffS3pRwQj/dJowiNiWurGKJ/NgXvLl5t6EkzjAlHWTRsIqCDgg5dVCVgMScR\r\nH7L9PPwRDQqlVwblfP8zdovsg/ViIwjjFwC0Z62G9VAx3WZC9N8kiR9hLn1e\r\nnPj6wowChhSopawx2U/+X2Km7iuX6kyBGEkFZ6U39zkZW8/4ebHHzrT6q3Op\r\n8UPtW+03/sQbvnCgc8P+AsAJvyX0J7OYr2l+vGlJ6/3KDXjOWdaWG+uiTe/3\r\nqaBGmA8H8VpovC6TmqDCXct2Itq/YbBkitDEA7kY7mziPS4oTPNUqB+wvClF\r\nUyZQF+2Jb9xhQNx8QIepPJjoeTd05jJ92IlMrcACZpeSc9bL844CAxL14Oql\r\nU4uo5KA9bmNM02IvR/sZpJE/yOvziZJXdgtewXE0rDUxYy67kyZFGxxhDFW6\r\nfa+mwgNtu7HKmMmkCJ4L1TzemWp6O/qRwcX3nTdJA47QhhON4rQLBRqR9ld4\r\naKTwifVKKGQfM6hhH0s0Dm+8e5pKyPkxL1Tg8gp8KISd5eMjnsRDxZTpZMGK\r\n4AZD2fZ7gZbe/OZtF66n+fqingw+AaiWN9mbCk7Aa+EpW7X1+C9qTm70aF5m\r\ncpmpLcSaBfpMm3jzlrzIlhkHbsSxHIb3cAw=\r\n=R41Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"922b89b0c9b28e0d2a2cb1507af7496c6428acf6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.5_1660651204645_0.3230288434971804","host":"s3://npm-registry-packages"}},"4.0.0-feature-aecb15-l6xh35y5":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-aecb15-l6xh35y5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-aecb15-l6xh35y5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"86126c45f784f2fa96e0a63ac499e3328d77dd5d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-aecb15-l6xh35y5.tgz","fileCount":153,"integrity":"sha512-i7DrRdMzmBYn9akOzXIKVEJ4jyOJ2I09ABAKFQ3eifeCL8jnO2IbsfPWR3UEann3F8sNQWcBZ6qTqOni5N54Ng==","signatures":[{"sig":"MEQCIHUBfdtORSRag+TbMaogK7s77KhNR2a+7Oz38bkW9Pb4AiBrOFe6dwVrxeBgwwN/0x3lTvxgkiLITiS7B/pBjS0ZuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/MNaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbZQ/+PfMqIfiNgD0f9RT3PrvlIHlwpgdKmCzF6Xu8Uq2AsWpLcvIT\r\no9weRWC0FEaR7So849faI+7JgM/E3QVKYLsFW1XYh9vk0lo74Shzkf6ukEqX\r\n/ONtXbvdMat7qSE3st8pdAChjH7vyKJ9EIUrSMqLXWgLkRyX8Ybq9VrVT83y\r\nmHnV4O3GMZn52XkA39y1W3U11Eulg0LqcZ7w6FnaMioCBHvi28Jjy33PTzk2\r\nK4a/AOnTsTmUSMH0t1i/4AdGOn5sj7MpfXDCmdKn+zo8gGVr+giy3Mb124v7\r\nBnGq76zc6614eRohTZtag/WP81zENXYsfWuHeLfcPNbp87LsgYpTM0ZahEZ/\r\n1QDqizy6vDUUDoTh8a1OSOavMCz6/GcbnRK5X2JGURkZwCPPdiBNjfOF5cZP\r\nGzx8QtlOHPettZiXYTvGBQ7a5AbF6cIaVj8SgTKKNHV3smCWrfe8hX2NxjjX\r\n3aH2cJIcGT38kggCR80tFMseO2BK8dyCtLzhrAwMBPNcEErt44TjuCGcZOfl\r\nJ6c3lk9rhpMOOY4mSlozRjLXX/zHNEDFLVviPnmaRz+yOAaPQ4P/rJe/2EHX\r\nGLoqEa1JYX13AVtbHyMYcfl2QQLI1jMJ/E313rzmGQuff50+8rEoxaGf3IvE\r\n8QHcQAZ3vKyPQYELKBIyS6hpkFPZncdIE+I=\r\n=sTwy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aecb156d6a1e3ca3ed9977d8016a72c13b5e79b8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-aecb15-l6xh35y5_1660732250337_0.7604479926596601","host":"s3://npm-registry-packages"}},"4.0.0-feature-3cb6ad-l6xhk6gm":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-3cb6ad-l6xhk6gm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-3cb6ad-l6xhk6gm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"10ecf706740add94afa777ebc1f1a6cecb4a5509","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-3cb6ad-l6xhk6gm.tgz","fileCount":153,"integrity":"sha512-FuPctIc8yneOzRKyxA+F+Qz2EbVenFYbz3/IHyXJU0k7ohTy1eW5x4jA3F3YE+l/Npb8hBRaiQIXhigIRncqzg==","signatures":[{"sig":"MEQCIGmy++g2A4BAMUnhOEN9K71tIpxBuJkX7g05ShwN2oaaAiAx8OypejyMPNWeKHuVn4IN2YixwS6Tv503SFC5eTRQBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/MZzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjpA//QSy+vv/K6cS2o12ZrwJ3QvfaOhT8i6iGaStcr5xvsfruuaVT\r\nvE0chEViQ/uNLAOHkGhnazof/WmlPO5iA2zto3oq4hPfSp7rnoQuPe0htrwR\r\n9QcVYPJf7rvdIepYCL+wF0zZFGdV5NPluQ+wf13EkQVircy7QXEQxgEUNofC\r\n/9v+oMo5NPdwU/Cm/Xh3JoglG/A7prG6o/sVD+7DfqPRCnNB9WHmu4QnbNIJ\r\nszYrB4pHNt6Aa+frFkxgPRkQF6PCNEKO+w2hn2pHPDT3Hsh3BbhMPRZ4bOQf\r\ni+/3+qeYi9oeAny+XmkR+ZpJHl056X1B6g537o3L20yD/xVyoLvWfkG3idxn\r\nA9oS3IU/jfe9zVHmFPNIJ8XkhXRZGZhujn+YJs4cXOLLhdn+15TX6vehi08M\r\netDwkKnl/U28Egc0qXTz2+XNBCZ7qAZ4USYxj0gBpq9UDcYshxj2oYdbSKa6\r\neLjcMnDNXSy8O4ezemaczlQ9VQlrY8BA+P/qxbG/V2qO+rDdZb4MED79blD+\r\nEwYzr97jq+RELFpVbyqEZTKbjJYHmjJwPSVX1WMBG1hzlRNxAs5XEypSVL7Q\r\nJS/GoIhVJ3Uh6oh2DyWghxVGyupyxfoBDdQ3/9niKc4zTVFfV+tK6hoxM7G4\r\ntXWN/XUFAgOQW7BsbsafLSv/PTP3MAHg8Nw=\r\n=HWJp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3cb6ad47336336b68133df897de77b810eb8024c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~group_metadata_changed_notifications"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-3cb6ad-l6xhk6gm_1660733043055_0.6610125492843153","host":"s3://npm-registry-packages"}},"4.0.0-feature-f35011-l6xjequv":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-f35011-l6xjequv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-f35011-l6xjequv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b41606e430a85392c780f76f8d1e589a2c70b944","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-f35011-l6xjequv.tgz","fileCount":153,"integrity":"sha512-nnK7V0xOtNs+MFaMbsaUu3UZd97Ak9n+u7Las1wA8Enz5yeRkxTJ/orFMpWzQi1aaudCVChnmCeGWw5Og2KpJA==","signatures":[{"sig":"MEUCIGliwjDlNyk/f5Ls7DyA/mcSNw9Pm9kfqRwg6bjXDqdYAiEA2V2F7MO/alkGUg4hO8sNF/22A8WiyjLU2tGadRjQR7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/NKSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLrg//YrXdUbwNdj36YZ+SwLxCqwcpA3uzr80hRYkLXm13RbnEXYLF\r\njKMLyvE2wsa85BuP9zPTiAQkGI0MRM0pLmGn25OXnPksAR9LhnoqVhPCcDP7\r\nv2FaWtMSIHlftceVWvmlofw1URgDNCxYQ++UIrq51OGv4GsAm3L5+eExmvIM\r\noJYxEaP1j4r+4jtWYA3f6YvBQjlsoo4PJ6A0nv007rU9a+7IirNg16PCP0+N\r\nAshvOcxIVpiwN8XrZ2v8lDujnlgPfRyqRw2bpKkkHElkq/xpk62pTcVHPgeQ\r\n7AO2zm5a3L8ciMB9XaCOVXqTku2qvKphceK40yZZDzjvmQxKEZMd0L6Vq6+E\r\nMeAJJOJrAGxqBlnQ2lynmypmLOUsxXmLAcX569J63qdHx097GunSyIIwiPqa\r\nYjqt2YvQHvqLKMXymzaNNXmdab85d8iuhJB42z9fSoiC2nbw+WWSarxvjS9N\r\nPpTdRowB/smfl41BrPsIqSns4Sjw4gqmyDc/gcaRCVhNjBjU29yx9W9a2DQo\r\np/OLTqVQ1jQGQONQ8XJN0CQou7Z9sMT2ixl6TdJmfMyN9rqJEaiadr3J3lxk\r\nRBuFYIbvnPrMfyQEufWyi0AYAKPjtfn96lmU6KAoXiu2eM5zVs3JK/rXbw5M\r\nzGLpaWn7WlI2hGn8I9A/d9Frr7szoBRKj50=\r\n=AE33\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f3501129c162fb01a7244c9b5b490720faf05166","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-f35011-l6xjequv_1660736146678_0.5727352887472312","host":"s3://npm-registry-packages"}},"4.0.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6934b1f06a9b65aec96a3d19cab901c809ea6ad5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.6.tgz","fileCount":153,"integrity":"sha512-IGek+vnfxhs7XQLMPfpAT4VCzjSGikAcKOwGg3udFN8tptDZeGmMQBxPXy2O6kPdprleP8A6yVDElI6iBf9LVQ==","signatures":[{"sig":"MEUCIGFejp1dtMb9xiILvL3JygZrHqYgeq4+m+Bd8Sm18TDsAiEA34sEcrHrO72LyL9C0zGPF+jFPH5o9m3GhxGvc25+JeI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/NNjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojmA/7BV4/GUWlAzz2cZZgu1+zVbvhn6JbCvYKLllwZdmhbIHyETfU\r\nasUZ7Voq8bbkokCS+VhNS8C1szL/ei0RSqWOovz/0or6YTl6OwCgX9OKiTmD\r\nWmEcQk6UMt6xOn1pV+F8IJAhmAsOAi6D3AAIpkkEQuYIFJCgBBqXL3ecrNB1\r\n0lGevTKIQH7/d122lAC1ceYGnb9L1rS8H6RDBweO8EUS73tabsuSgA03B6qj\r\nX4w5TKHeCjeNHaF0ObCaKhcvNmOwY1vMrbwhqrnxeHw103/pEz6hCEPiGwGd\r\ntwOsHzReriWGg6xZlAS81QBRrvsL7g4dh0gP7ERp610huUDaVFDy2YFR7tAs\r\nuUmt4RsPNDhtA3BSt/aeyjH7kEdp6f/yfiTtghKkJxznb4d2Qlld7IqkOIQG\r\n4IV4s51MsIMAhebhfRG0nHgcsnvaNgmku9UeT8CZtzyVbZDgilKDmeeqGeIO\r\nCY60i721wvf8x+4GQvxz31BplVv/QSKhXr6OG3XXgLbPDWxjJYt7MZ/c7wcI\r\nNcJ0J3Cn8T2GKXyO751uSCqxtd9qPGZ+iBezpXW88+vGGXBVFf00EOLxB38R\r\nsK7SLRVhqa+uWstkyTJFaoTeWVvauPglPrqojU+K/GmIzh/a3JpK+//77DRn\r\nb24y8WuxaLjoc67VBhnRAtmej+DTruCdkdY=\r\n=xVQM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b5bd9540f595a019e0c42fce0695a7d47adb2226","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.6_1660736355124_0.36144097484676463","host":"s3://npm-registry-packages"}},"4.0.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c7578e4be40c9e309d92601c2d798b8817b52dd0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-beta.4.tgz","fileCount":153,"integrity":"sha512-lnJQrfdzlMKUZoby3SxjrLo94QyBtSAciu4nG8YObMFgx80uOAs4rtllFOfVXhTgtsJK1QHq/N6XJACctarfdg==","signatures":[{"sig":"MEYCIQDeGxAcOYAb4CxCMATnPjND8ay5Waa4BAT+LD959qnOXAIhAICBe1dHRqHvcqJnJgrjljyIOrvsTBdEzyTom7ML+QFv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/NRgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJvA/+KqgXZYtcRmRfFp0ix0d8yKtgjawggFgidHcFIO062HTJvgul\r\nsZBQwWfe+O8aPLsvcNuD7LbF/oSMRlwIxz0NfIsW3+b6eywo0+OhnvnLNMgW\r\nSCqaFsEfrQFhTYi1/qItVlxuVn0RNjDFRbTnE3wK+iRppB3KM6lEfjo3cddx\r\nxAq2jfSPHRXNuynEOn04CDjl5azSdBkYJvnGFkJH9V/sGLgnDzzkWVEcPRjD\r\nYR4zc2228/TWDCF6LWbe/ieTOsamhwgI/0VB8nC5qUjvKpue4nc9PxPaes8C\r\nL2eqiEsVEYCLYlR2AKNJ67pDXQNgxmQ+lS0+3n8SYsW8VKlfBFQLztuXfhzn\r\nhVQiEQal37FogBzM08zhpMAn1+pG3XL/iqtd1x4hL0adiZy6fY7SHAVBd9ti\r\n/m9ByTGRQve4+iDV4NH84hy5lx29fIbU7rmCebo5+9rqTPC8Qmg/DzLCmuyD\r\nXvLF8llD6XCV3tQVvxukt5ZojlknBY7WF0yoDhSSKAkXT56o4fJ1E7gzWC1+\r\nDVk2zB23qWk42QhniGLEucjgXNn9v32pdFi58UsvBxVSU1RvX1Zt59GkXc0k\r\nN1isIuVAM02O1KxIqiibMsP9Zmob1qQsjiWXGFq9wrRzAsAxDfyKVGb/bPCF\r\nhTd3sg6URfx5camXdpsK9kWX5rCbaPCD+uk=\r\n=Etwy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"721ed11af30a606c22b9a60742968ef7bc4a0c3f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-beta.4_1660736607798_0.4246525288999128","host":"s3://npm-registry-packages"}},"4.0.0-feature-f13ce0-l6xngaoj":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-f13ce0-l6xngaoj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-f13ce0-l6xngaoj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9a6658258094d3be707f07d9d05e8bb319bdce13","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-f13ce0-l6xngaoj.tgz","fileCount":153,"integrity":"sha512-tTJW7d+6gqPxc17rd2UDn9HU1BkMlrZ5os+VdY61wakXVfuHtdJdMq3pKyKlSuq2bnysGYsdPGCEXQZJ6yeYfw==","signatures":[{"sig":"MEUCIA2hh7E3ab0wNs5JbJubHi1OxuCYxXhi4TCseItRie9UAiEAzggljxzIjzCjs4xxiRsqKxQqBfvQgAXcz/EFK81JJkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/O0YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVrRAAlmSzZmAn8uu38mkr9/0gJY+JX2kS0DbCsspa1/+xNwFmnOFa\r\nYY1Y9quy8aNgAH65SW5xDVnBZE4s19i/7xpEtL+f8MYuCJoT+yLeFSD+FW3F\r\n2x/kAgw5sahL0/tZuwbLKMUcb23PWRaC8yM1jXDOdA0UbO2aooTInsiJHWHx\r\nqU6rL/Sh3kjZC0RfHDH7c166bgKEq4GG41kVEZbCq2D02RnPO2bUuaVf4o4Y\r\nKlu4NmjvVCXpO56zN3UqYHOlxduLz9xhogo7xOPpsq5FzgCXMB641ES0+4/x\r\nSmDIoGWWEUL3nV5pYJwQuC0O5O26s5FkctQz1eUwfFp32QaWW6sorSw6/iD0\r\nX9uEv+H80asc/KE7yRL6cFfy5dwfNFJzLNF7hAkVVxzPbPFbJUar6gbJZdy3\r\nAaAEDg/k+zleGjwq/fnvKqN3Wv505OUsrtSwRyANQKDPgtG8NS6LYVPlpgjr\r\nK3i6RiF+DMiO0Z6jy3dLxLw9pMT6ctAyZ1Q2rS9XEB4JWbAk7dtHPIaaYoy3\r\nUjTo+3n1XW59ByK7hcqIanvMjTCZbap6MQgzZMACfnBf8PqZgYQ3/DxZOGMg\r\nQQbc4GArPaHB5iTIut6mCrAFhKiUfSYQiKRwSGeOyfPlBuLBaQqM6YoOJXTX\r\nTQ6h1PhZG+4ZSra5+aHUD8yUfncsyfS0Vaw=\r\n=aPN3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f13ce07773d6a9797283d949b88f840976a925d1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-f13ce0-l6xngaoj_1660742936350_0.6259995773569076","host":"s3://npm-registry-packages"}},"4.0.0-feature-29adeb-l6xqh5xh":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-29adeb-l6xqh5xh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-29adeb-l6xqh5xh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"063c5290354d9302adf30264cd87232a3eb91aaf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-29adeb-l6xqh5xh.tgz","fileCount":153,"integrity":"sha512-fcW5n19n6V/GfQAPL+BRfcrIaxP9F/pYIaNHc6jGh67zTg1fleIWZ/gRyGLbg59Hh3p6p7K29Ogf3jae/FxAbA==","signatures":[{"sig":"MEQCIDUWCxyA+zdigDpcCwfkrrGDeEi71pW0ou37ss9fWAqxAiBoG/EU67jzwHe4hRWTVJDaHE5odYcUOT/Hom7QsysWpw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/QDxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWEg//aKoJbNWbkRDi4XTdtrDKMfowDNGU1N9mElDGtc4jUKs00VUm\r\nOy0PU9HirMDvKQxzyxjathe0eVyqkMNTJbKr9TfwYZPYDm+ER7396IeLNdBn\r\nbR4ZXthQuJcnAqS66JVs3nhqRqsnwnSqpdR9wHNMPealUVMWQgiCkgwYk5Rh\r\n8oobODW8rYpOi/VzsUGkRRhSDoROqN5cvUISZO3P16yOEph1J/tXOFN00Zkm\r\ntUbYpkohFWfjgLNvDOPFZgBovUnJcDu2tw+3pCt2WS/2ksXsGDrjKya4Qwv6\r\nZdLxvOMEhgbak5m8k1ftMvq9iTk6SKe7gBryD3qu3p/uajznoqwUdFRnXj2H\r\nJSCp55DZmms4n576HjNsyEjGQnAQ7ZsJ05+Pc5B/ULznHVxOSyNlxp21ayI2\r\nAh+VaWd7B/U7U9c8zZLvcxohJJuF3OsHCsfH9kK09cma+R8q93Blqw32BWBe\r\nqlyinXLCPA42cj/1yLUl8m+yOXtIvAbQJv+0plzwXxJMH7/8OqKsYdTkuve0\r\nX5gSbQgajFf5bQiR6BwvmpTMvBTBqo0teMzfn3DXEsm4G1b0HQ2SVIQkeTMX\r\nliYn+mzAWyX8UUcDkZhdrGmDEaq6vIUssGnDwqjqQBTev5neeCl5SFmc0SC8\r\nR3v6c5NxlxF/q6YxTxJGVLLAARwLzltxho8=\r\n=wPHM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"29adeb36a960b774c05c7d2322f73dddea207a61","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-29adeb-l6xqh5xh_1660748017106_0.9447376646624188","host":"s3://npm-registry-packages"}},"4.0.0-feature-bf7c52-l6z49whn":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-bf7c52-l6z49whn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-bf7c52-l6z49whn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ef13c3fcd63d66851e0d3eda57e62eacd0b0b881","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-bf7c52-l6z49whn.tgz","fileCount":153,"integrity":"sha512-n7VgMoSihqkT4Hb1RGTRz/eQnEHeT2pfNk+tOg2DsHOmNIGtwTf21h6itFBxfJJhDVShHPOn4wSdTA2oRAkEbg==","signatures":[{"sig":"MEUCIHKPWlJzG54BEcanofTi9Oc1D2Up0peAkeUJC7XiYJI6AiEA2Abrf6d80lKPT93EF6h6GRfULWxLr6vot09BSbEKgPc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/kerACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+Ew/9EKodTpGbGD7HcRM96nsZs4Xb7HYQvR/ZwzbpLPTofX37/9gU\r\ncNmeAyZaoBrE4w9DRSLmLOyJmRXyTk8WKXulz0ifuH/OfCL2NFFJUzJUgbZx\r\nP76eM2cnaF1dHeqwkkNfH/8QgidSD5EPqsLvA2KCnXm7df6nq6EwjJuKlkjG\r\nXq4sOe2yHo/idhpLy4/gkaA8QHPTkKnZo5OIQN8g5wETLkicl95zWOa26uIR\r\nDcNVn37WVZHMpW96C+5KLRqB0DrHzuGCVU3rEIw+6PhG0+5wGVKWBSP8yDmT\r\niXLM1R2UG7Qwy/Hh9hIsoSCY6daLGzStMMWonvEBFmGvtJdoITBTxs5DGI7s\r\nKomOYJeYBMcb9wA1qRC+IFj3SgF36l9anFxaK/pBP/LT3BFsaSjre9+Me4hG\r\nL3iMATZB3wgZaOcJKmOtobZCvJJx9dyYobRAIfKCY86v6N9Mn9YSMG9fNUel\r\nOver1i4cHFtB7lJUVDagneoAdaFKH2AjWOERqF+kcLkm70Yf8mHgRjZC/DL+\r\nZsDelp1BDTeG7YUkY8Le3xtvf5L4wY1nP24w6U5nFop3CNkDDBGHOib0gBCd\r\nZKIKFzZPkOggy+7gAay5BEoGDLCbhM79XqWC0CWaDwUfuh3l/ucHG4bzDnEi\r\n3sgMHGaP85NBik+dTsKdmolhZdyispP3lVE=\r\n=FITj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bf7c52fd47b96387b3b80766bf5a5e0632e2867e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-bf7c52-l6z49whn_1660831658713_0.9678639196895449","host":"s3://npm-registry-packages"}},"4.0.0-feature-a393f7-l6z4i58b":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-a393f7-l6z4i58b","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-a393f7-l6z4i58b","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ad2173c0a99be92ba3bace4eeaff05fe0a886a4c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-a393f7-l6z4i58b.tgz","fileCount":153,"integrity":"sha512-W3ZJepwZ05WCpG3XVeTntOZn+TOzuWjk124GipTBYL4qa24V1EvHgXdFJjWKGnpEpeGx6E1hUc62mR7UpLKrlQ==","signatures":[{"sig":"MEYCIQCeTpskUBcvw7i2lGbIiP4uUCXAxsLPWlNp8zso/NkdwwIhAKuoJ0lXfhIgyG5aW2JJL1OzkX5BFFnGBsOKw2WwSp5C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/kkrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/bA/+NBsF2l/+exeX9VDMzONMITzQGA3JnlehwLBpU4anWum9ozRT\r\neYQ5PQWcvRAKMfU5P1hu6nMJvFyA9Fylr9A1SfAx66fol5pYqpCCeTSqIgPs\r\n8+de26ufXk1BCXOqwM6mzw3FAYBvX1d/6y4Gi6O+wv9ein+hxE5fWdNobRdU\r\nCniK96IEb3PeV8S5dyB3kYuRe0ocq1mRtDSdHWuPzeuGp5jDpaADhp0cKZNo\r\nEz/B0sMPaFy2WCp/51zkvB+AuNmMirzNJrnBByvvKssuF14l0sFsbkin5KpL\r\nBGyO7kB6OIwtxVd3TgiZ5QQ5ScUBs+n2P5avaUg3oeMH1Zjai72v1ddKJKn7\r\ng5H2LJpFm9k/nSTxm8yF3UT5EQC0O821ctcmquWBNurT0pe4IHZfI1QhOoxq\r\ngbYVCrp6Y8p8YIJJEMA7jsHU57M/2kmtWzNkTr3j+LWKEZXj4EAJtg2gyb/H\r\n5xAdAtTfoB+wONYq7uT4RA6Q0XUt+d4C28Yg6P23vtQRH+ONR/tkrXQP2B4H\r\nomZ2CaNKv2pz0rzBxMEbzJ1MzYGef4XmGKRcazlAoKeD4jbTUxIKI5ReN9ZZ\r\nRl24cMiT72CkdglHigvJKpYfqAqPaHDNms0hHdL9/WjPgZdS7UUSs2v2otD/\r\nNMWLyfAAMuJimeomHULq/v1zTeI1BfRXKdk=\r\n=+AuM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a393f700bff57b87788ded1d049a4b79adb7c99e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-a393f7-l6z4i58b_1660832043472_0.3304776179669049","host":"s3://npm-registry-packages"}},"4.0.0-feature-d40d8e-l6z4qy7e":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-d40d8e-l6z4qy7e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-d40d8e-l6z4qy7e","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b2943ace4d3821283c993848b1f43e475a8741a9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-d40d8e-l6z4qy7e.tgz","fileCount":153,"integrity":"sha512-P7FjNd5MGi43wCnYWXWZuxciEtV7I+MCOaFYXaV3ER2CiLEYITF5mHgsY8g02B5G2sKwZH83RQJ+Pg7GcxOKTw==","signatures":[{"sig":"MEYCIQCkQK4ws/RGdP6VSgyHGea3y+VA1lAmDBpMSKOPV3i4twIhAMZxD0z4bpU/kf1x1Gz+DV4CLymXUZ1Yqs2h+XDQDJc+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/krKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGxQ//dpM+KNamvrp8r4ueqY4xXMfau6ptSS5Wg5+hr5XSJ9s87hmv\r\nn/mkKR5tBMmFESVYfotbN5qr3qYx11fM7SPA8tr8cE3fYtMPU9/PdrModBz1\r\nZPXFbQAKS/w4Fqhl5SkMWLwJ5WaPPtq8FqPcs6TYKeJIzT+FpafsfUu1WaCC\r\n4R3xbr573XPAYUn3Z70UMoUUb7eQ/3rpC9EAGKrn/pyuImEzSwxQknr1EU7f\r\nk2vMBbc5pAeoW/4+5zIOZw2vHCs8VQLOqAIKy8LGwPoHGM4GlvLTn1lipXaI\r\n9a9GcFo/fZVzsutfp94L9Jp93KByflsYq6E1tFjq5a0I47ov81lYJZdtPXny\r\ni2x2fyCuVI5wguQ4DCMZL6oiAQlLPZ/50ycNDsmpeR8VLwWkmMdkIsHF5P4s\r\n25SoVz6zydANqnzgMNaMXfzAtIy2pon/zn7TSjW7hX5azxxGFOfGDKrzv+KF\r\nLwIqYRB5PAyBbqd5tE+c/mGfs7KDIfDyQNj78mqRIvkWBQAYw6dIH+6QyoFr\r\nfFHKRms2wahXKep6L1EmCAL9EMBzHEMD6K++IkWc+Tugv80POjWi6sGB2Njq\r\niHkAF89AlskNBIyPYroWc4GADNrIEE+KzA4JdmD7e65QbovmfGrZ4TZhDUe4\r\nCDFx+erqbGdsOC2CvSajj4lJs+jWfrK/0T4=\r\n=P9Ek\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d40d8e2e25b8307bc87acfae89449f709734f4d5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-d40d8e-l6z4qy7e_1660832457846_0.602872065100333","host":"s3://npm-registry-packages"}},"4.0.0-feature-cca828-l70ce0kh":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-cca828-l70ce0kh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-cca828-l70ce0kh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f37f8cb7fd3e632b1f17d8c0125ae86e051a81cb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-cca828-l70ce0kh.tgz","fileCount":153,"integrity":"sha512-pBpLZUDai/dhJsP9BBF0VNOKfXPBzncWKVPw+ON4lEtzHwoTXd/aNtmfwT4Lgxdemp4qpAusgl/hXY3J1HHyhg==","signatures":[{"sig":"MEUCIQDUc6F2SQ+SO93JdBRWZIphgZkwmvEO64iOCLsj0szS5gIgOHBFq8uLeVIjfAOHMXeIYRKN1Ror1kY5lIHhD5HuvW8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":498347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/2kZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUAQ/+LSlznc/BSa+nXh07fvv2Mmebdlw9Ur1/40XTmcCT2Lr7UsuR\r\nktYqQv+dCPwVX0XotqacMj21ca6cv8HSMxKBsdc0USZG7FNFLWfB3Ja1cyFY\r\nIJ2r4cEtsLQ2Te+ST2EZJI8335icyCcyn5WvWigA0OhKRYCHVlKccXbvy4cx\r\nBBVzVLc7sSQjkSnaM8ZylRcPqfqel4sJD3jB8phHDFCy6iGeRzBAeykYE5TH\r\nk2Sv08ANVmoxbo84472yPh/ocTbju8BXjD3ElfyRYXVwIJAExxduaZpUrGoU\r\nJyVewveBqchWcqrASaqjy6c+6A/XWEHDcIriLoJe1hk9QNd4QY3jZbkrRKif\r\n+lKiqBLE2dZZEp+SYsat81R7m3D2KKnfle8lgsHHte+t3WIyLeVTm8X+Ii7I\r\nKfwhphk9ep5PCF9Qt0ziKUuFRJ0Gi3J7Cfj+KljO+tSnCE4q6/G7iM9m1MHZ\r\nBT7UEJmyZKIV56ccadkpE4AgHCBhluqOton3p0yE5D6dSQbZrbxB2j2w/pCr\r\nTRXHuyhiZUDl3rAt8G9gYF/SmNP1WjP6e2X3Qm7fxN+kMsOvg8mgvWuk4q7b\r\nOpSDq4q3pDY+LXS9Q4cB5v2D5pffciCZgzBZkhUKFWRiivdolpJzpRrC8bOu\r\nTNfGWYWUiFmm1TH3iHlgMiVAZ9OXdzUFVoo=\r\n=EmDG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cca8287c6d9a8515b4c6da783707b79fb5471916","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-cca828-l70ce0kh_1660905753662_0.665520452914647","host":"s3://npm-registry-packages"}},"4.0.0-feature-a559e6-l70cg0xv":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-a559e6-l70cg0xv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-a559e6-l70cg0xv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6b66b1710ffc2552309189891d4f3e14710e5d68","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-a559e6-l70cg0xv.tgz","fileCount":153,"integrity":"sha512-nt96wHX7wKIPdCzbVSNPI1rsaQn89gBwyxjQSjTuisQLD8ai8WE5yjIk/zNC9Z99To+X4sjmJCC5DvmW3ZB2Rg==","signatures":[{"sig":"MEUCIQDnpnoFwOMoTUNo6DtMEMB+5DtYJrBMmL5pjREq2NXoawIgJFlawGvY0hZ2Ia4SovMTjZWQFlzeb7wUdQJ/UlBjhKY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":498347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/2l9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYWQ//aTwUoIODd6aqHHACtCiCdZzfmWi+GQYvzVXIxWsQjT/QqbjB\r\nRAlsOqxwPBGLoYKKr7q985tI91uXqj1e/qGeHMrcavBZIuDHG3FJqCQO/1fS\r\n1Oaa6oOyJfIydN07m4HZ2LA2x/XVm7gWt2eky9H051j5Cr/XzJpwkHu/J/Tq\r\nS/UpBItOg5Kd5EyasaQga76j6bqWsBUl7ofBRjsEyR/SDCpIAAsITTHplhS+\r\n1vsBDLiVd9idRSCg88YSrHsBKzGHoRxmjEfI7QQTJk2ZeY4XupcECbcSjUtC\r\nA6JiYSPdCmwTIIgCHosSIwxP+DzQZZ5BXzSSxZvL/bFIUGOQP5wmropGh0se\r\nOfgKVRr02Siao7nALKdrgZSE/RylZYBxXqBQhfc8u9lRR3Vlp9jscmZP/5JR\r\n2v77BHrx9COytalE29P0exgcL3jdH3wXwvXhiHFlXtmr7l4rblQzAVIEJRif\r\nXcQ/cIDb3qwJ/uk+ZORUJewGwMgLQUlPJ+ZF9VocdTClSTr4lQ7TCIdTjLdI\r\nMsqtqL+SzYrAzPssx56VnBVkRGsAALOAYv/qZXJBOP/Fx8difskz/DjaKwws\r\n0iRD7qTsVTDTTNUHK6ofJxar9FsM363UmJpZRZNXpeesndT3HfF4AtHMFz0X\r\nDJHXiLVuUoiMuTqAvZXoX2zKIn7Lk1eOhHg=\r\n=heY+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a559e6ebfac5892d3547731abd70dde4811ebcf7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-a559e6-l70cg0xv_1660905853216_0.10932000824279431","host":"s3://npm-registry-packages"}},"4.0.0-feature-fd525a-l70eo01y":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-fd525a-l70eo01y","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-fd525a-l70eo01y","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64ece501145891915cf561c1df8689cec2f4cb60","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-fd525a-l70eo01y.tgz","fileCount":153,"integrity":"sha512-MXT7pII/7t+jm8mhtaBHFHl+IGtr+hB2NzVRi8SsKr1ZCBMcfR3fcmAZQo52PogTjGFhD4l5WCKabrIpd6uYRA==","signatures":[{"sig":"MEUCIQCWw64jhyyjUOWeNFq3GnMHm262GNEOcTbriua2XppRRAIgYq6tPgQNpNYvrlVkOaq8uAetqWKJ4tqfKLKHLEHoJ/c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":498371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/3gKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOpg//T1jMYqpS0VTPLNw1Ye+V3WX0QrxjTsNjYAdEbsdLj4kOSNzd\r\njJHUcJVU7SMG0fWOKt09MG/arOqsVRzl5tFX8nbRe5E5NYJkgLE2vfdFbHJF\r\nKt/bM8xiqTaCwuGnIQMl3JhvA1q4rhB27eh/7YNdGYL0NHIew6tGHpUfKSi+\r\nSbWqWkl+/GNzUfufsJmA1MMq9JtuFKgb1rs6NC7CZcyhhYWmCMsCzfztmEVv\r\nEfayRrVrx8L0lNFzoNVuUd909Lj4EZANupNkPoPMI36kbhOI5vyGXFMcaLCA\r\nJHuZZcTi/MMGYlPTU4WJL+d7yiavTgK2irZ3lgZGP/WTuPOE9ZVn4pthUhx8\r\nNhgMh8WN5o1l8fWGQCfk5Y4bkPPl0BBgzHzF61EHct13MYBKwEezTZecaBWk\r\nMMA1d9rODiF5SecbdkMlGQCYw2CG8XgNsdFckpuAySKCYIrsaCUyZmpTdAjv\r\nJxJCx41yOfYYhQeNrsgd9CNUj07GZCQZo0OwIRiwhCnEH16RUfBi/vzxeIf5\r\n0d+NAaICqSSiJ5/S9clsTS/l+sy0UtHFFaWYGKcVTkM8PycoRv0LLMK0m1Y+\r\nycG3lCTaO5luk8oSwOzC3zu6c8OAfz9KbauI/98pwRWqWwcRZ9lk5Vb8IYVQ\r\nVCmX0ap5hI8g9AI/lioEpspkh45lUS1hQFg=\r\n=Vlxd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fd525a7b87fb6f5e67e9914d381bc3cdab37fd33","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-fd525a-l70eo01y_1660909578614_0.4191896306524052","host":"s3://npm-registry-packages"}},"4.0.0-feature-9a57a3-l70g6cev":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-9a57a3-l70g6cev","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-9a57a3-l70g6cev","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9d1522c5593deb4191db34d094c3d4cf8336a593","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-9a57a3-l70g6cev.tgz","fileCount":158,"integrity":"sha512-zqVFqeE2iCrChek7muButd0F8QA4ZSXM/QjJaISK7LWtSORrCmgFYnh7JBZ8WSgWAbkSJrtEMmaWsoHhr70xmQ==","signatures":[{"sig":"MEUCIBUxEHLXRuH6ejWbcnk57AwtJzZfrPMS7GJSo0c4tmO6AiEAiV0RTnWhppFzlAikOJkVJoz1hLIC4C8/AvL39QDnLnE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":515909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/4H2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozIA/+MFBw3tWKToi5hIQGAnunJDTIxUJzTmQMg9QCLsCPlvbcVkfD\r\n19EjkG+3BQpWeyBTqfzhwsGKvYFchzszgPMSuOebc4gic6eNFGxrwzBxgzvn\r\nSVkYJafcuZH7oLOTfZF/CJTUigLfaZg1beCFfHC6hPHLDWgY1NEATwqygeun\r\n8GYQr/NiLxQHJqJdtmPprYkL9WdJW7Td5EOCiwaFS7qrbEHPWT9U1RrY18Gf\r\nBe8pBo2wDihXWhB6oZvsvQf3GRvlpnLjIq+5jtJ5vJ2rqQzo7e9FLqGPjAAW\r\n6M6d38YwGhlnz9CfKpKt0gJSCBheLO8JsbQYc0ypruXn+/jx0jakagxaCbo6\r\nUMjGhF4/6DohWOADfA82TLxChG6hB/b0DJKpmee87jVZNulr85n9nTcmwrUa\r\n5PNYJZSj4uExhMDBD8pT/8FCYYwiIj3N+5ySm9D3WoHDTPIKuLL7adWZGHTs\r\nWDnYB00bP+Yibma/bsxtV5cgmg3vLanEwhA5V9zndf2b0JabGlLy7FBS4L3m\r\n1NWq+gCOqXjhne5GmfS6X53dy0M2rtj80vLDTWOwMvVauorpPFPlPLmWQCtg\r\nJinMp1/XwU4WLKxcNZw/7E0OS1DvF89L8VoiWsXCLqRd75FuZaNXR3DJvkds\r\nGIBYCnuYLO+zk+pb82NmY/9mVU0a4QbWotc=\r\n=T1LY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9a57a3de20d421643e44e11eddd18f96333057c4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-9a57a3-l70g6cev_1660912117981_0.7182159518174647","host":"s3://npm-registry-packages"}},"4.0.0-feature-d2459b-l75vs594":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-d2459b-l75vs594","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-d2459b-l75vs594","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2ef62ca37c6e2f79797784076815297c20dbd5ba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-d2459b-l75vs594.tgz","fileCount":158,"integrity":"sha512-mBkqzsVcryKeAIv1jincLOz6aWDUV9cD/zQCVax8QdLs87k3MahWRecmbII7k24xbzhKoL1kEY4pICVj730tmQ==","signatures":[{"sig":"MEUCIQCqv64lAZdI4R0WwpzEDtTRdwyydwgRgLXVpNskEDdbjgIgZCgL6eVVJq6f6bwVMoNH9ARFKbSMZppYuXqAyvHuIzY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":516089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBIVVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqe3w//YXlOpCKUfnucDTZlO/b0yjAt+GTwn6WSd1shgEUeeaQHZijt\r\nzvW3NjPsvznYm7auaWu1MpREfledgyhSM5joswlpGi19V9v8737ctSrDUwKW\r\nTPUjzhrgD5xSwDP7DpcMDq8QBhqSUnXffpmE5h/bZp0fJjptfzPk+D+X9jKw\r\nlrRoyPXopDYDY6bzTRSBmoKMxq28CeECUySVW+T+Q47F2+qqm9ERQvTex4uU\r\nHh7hsbE4PAIzxs6eMwos2q+T6179amKLFXik7gsO54NMYM5LgDggoFJyTEZd\r\nJBnPOkutifvZYvt0dHQKKPCiIJ8Xj2jdbcKyMvRkZngHgOJFX+PznKgd7NLS\r\nLrQjhwdpzCn/OYaaG+pf4bmWT6LZCRbGQm3DtrzvrAVfei2o07z7KYfLXZ9K\r\n4ZZfqIbi16PDQ40ba8UGCx1S/qdhryQleyIGcLpzzrT0gd+u4WJ7pOiH+a/q\r\nLr1Me79SNvo1g2LbKbg8wV3iMro/f9TVyvlNnCQM2whuXjw+xXxkk0wv197f\r\nhSAFBXBp2fdsDcsWc2+6LUCUc8Nuh3VBEGm5HkrCHloac8SlwdTMGfENzrOf\r\n2xzLsCVU8Nca/ihSfBopOyliP9BI4b71dkkJtEoNILfdH+CkXowUnv+inpp9\r\nHtHblXoEiR5tHozJuUL9XhiqPxR/f6J5SHQ=\r\n=d3qN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d2459bb6c1b857cae7426f0f9adfcc8bdd55c745","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-d2459b-l75vs594_1661240660606_0.4143240587679966","host":"s3://npm-registry-packages"}},"4.0.0-feature-d37df2-l75xi3dx":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-d37df2-l75xi3dx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-d37df2-l75xi3dx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cd192db2a7fdc4bc2be0ab81f7a286fd60651c39","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-d37df2-l75xi3dx.tgz","fileCount":153,"integrity":"sha512-QoLzF6chmkZDj6XJVu3K1i7kA8bx4PnvdHhGywvlYS5i9KUFABq40DKlzgZsKbP5LyI9KKhs7ZClUdwdSHKu/g==","signatures":[{"sig":"MEQCIDEluMCRngVwXnudfJrYh4BS/uRFA4U3RAMJMeKyblt6AiB0u9U5reZhNaiN8gtJKDwprmna7AQiSEHQ80hhaCMKQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBJCaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzDg//bfaUMJi0zPHT7IVJAQBjWkei4Q9KdHhh+nRge3tvRyQsZdbP\r\nrl04PZ+tMj37y7jBX54kj9QXxHy0rju67edYxvO/dyJeJUTDRm1qludM7Dn/\r\nRYTEEoyGtEnajjztYv/E0pC2lrn5yqN1FCZ9xvYymB/7DtS+q/E6EO2g4N19\r\njEQ/9hUWKw6DZg7T5w215pmKRPrG1rawp6r5wDjGs6GIK0/ad3wEZ2Qxl0y1\r\nCnGtM4BSOnOq3Z+6TIxZIeYFdatXW825BlAH1wz1iF6F7fvv6SQNRoGVFplM\r\nxZNSDYzESPKQE2ziXquUQESilJj1t4sJ516y4IDgWbRmHBqhcFDqy2hB3tog\r\nmgGqQoEw5cuqZkCCBAqGT5msjAddecNVzbL4MXEkEb5hPcs3mg5+IhEXmHxQ\r\n6h5dPQz8p1AJPjimLYaf19/NcEaN2QCyjEVfbZHkOSKe+GAu5faLM/xeMtju\r\ndZOGjeO8MXLs6IwGoQXvXmca6yaA3bM6fUtMCXIsYetdzqWdxodUFPWwB9YU\r\nVx2kubuloF9twtsP6Y0x+VMrgXJ1NGNY+aAKcoczi/lZfUgMwu/SyuplNme9\r\nk2LThnuTHShVc1cyiKP0tYjEBv6WPqRviYQB+BXXbhRG8EpltXSC77By1n0c\r\n7jTZSz/L0uERg912NNAax3mNFr5YmA2aOI4=\r\n=GoVL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d37df2e9405f3dfcf7cbaaa8a31b4a77105a1570","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~store_evaluated_http-service-task_data"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-d37df2-l75xi3dx_1661243546390_0.5886203094902445","host":"s3://npm-registry-packages"}},"4.0.0-feature-649085-l77dacog":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-649085-l77dacog","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-649085-l77dacog","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cea9fdb9506dc4b56f95502d16e3633eb62de7af","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-649085-l77dacog.tgz","fileCount":158,"integrity":"sha512-9lzxCy6IyPzY7DZcuE3gguoAPDkIJbtH6JEawdWkl33MW1M44UUQUYV3NnNvoUNtdgBdOy6F0mC9QXmxuNDCAA==","signatures":[{"sig":"MEQCIEl8l8bgzwCM9ME6MSw7xLgykF4a6J+JsZai5pSAqlGpAiBSB1mjx8/Ps2W6TCHE5McGQTW7NVLt6vgP12zN4puhng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":518838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBeRdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg3xAAkeQOltQbTiGxAXnoxnVm0ahjeRP3KqTdyD3XCL6qAQCkfPKS\r\nF78S/pgF+qjxSWRBq9hw8H3+ShQwxEw5vACd8/F57p44e+W24vk9QEGjzWAB\r\nN5R1Lz+wQ/LkvR90wVojpdoozYzMUU0iJaeWQiPXOxw329VW6os4BSOiRZbj\r\nOCuv29EURLN9jQIwL//ZgpSC/xTALFAnb4r6WB4SnDAlThWf0qHcs844Cmwj\r\nHh28NY3aIO16yQ1M8Ztzdk8A/hjtjbSMpWaNBWeXEDcfOj2ssaDdxBk13Uyk\r\n5s+6LFV8c9Ed9GVYpCzFH8CADHe3uQLHRSEcpwGK3kbjdUzmzru1siBDw27Y\r\naNsXUfT8crzf89v23i/tRbYoUoyRhOt9RxwgWSdseSSeKgfDUXIL4jIJi/gJ\r\nPbdQRk6xGyXU3zTIk8M7x0k3buriDaG1rdM+SRcuDnkzlxSqNtr12sIYV9vU\r\nZo1Lj0JhIqBsuDsWCJg9w9QOnc/kA8oXe2fEwsoKxRjgaV3HyxmL9rOmYOJ7\r\ni5RbGcMJXNSrtluOGaq7AhEggW1swkgHx7OehptI/uVCcME+CPq9i6+Ztuty\r\n7fMtVxWkZAIL9718QqRu6JebJY4yElzN5+tCvURTcM0/pvn4j8P0wpyD/2qi\r\nDqi2XNnogGYdBnid9Dfm8RTWGsQdl07i0K4=\r\n=ZjHn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6490859c3bf26e55491d50206bd34e58b07e5523","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-649085-l77dacog_1661330524737_0.6795734817313823","host":"s3://npm-registry-packages"}},"4.0.0-feature-c9b86e-l77epihh":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-c9b86e-l77epihh","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-c9b86e-l77epihh","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"95d0b2717eda51660daa0e288338e913827c0ae4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-c9b86e-l77epihh.tgz","fileCount":158,"integrity":"sha512-MdP4BNmXj7MaGgSeCZ7Ke8EbXl/0TpB+SD9lLSfTONRrJKd22J075jDmHCCdOI5dxDx9AfqBLbMf41acskONug==","signatures":[{"sig":"MEYCIQC96uial+eDsPq1CwlvgvF1kBT1LbCDeooJj9CFHO1hFAIhAP/wQgVDtud9Z7SlEGC3ggKRBBjxvUigsqSTU3/UxTrx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBe2xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgmQ/9E90gF195ph0dOUQCkwVIR/oUGDSYy3nQjRz2OBGLyWwv1/oH\r\npXpLo5wAENzjtO1OVH0ilzlQkke7D5eIhQjOLYq4ThY7sjOBQhh/ToqmPrMM\r\n/caCEM97H5rTqlCjnh9GnMrnyS1FfR0BkYjruTOaSr9Vs3ycdP0zvZ5jQtTT\r\nxMBO5ebtd/5k8Dkn2uxiyGG0NRXABGOuUX79+fRw88Sp5iP8tELu/3aVs5CK\r\nEY/MjRjQwMiaZbRbMe5XTEmh5ABoayxxISsiBKeQd201MFnYLJshBV3DVV6I\r\nVf8Qe9UzyLbKCy29GIrzMpPUCbTz9yY19pA0G9HxCW6bQBH+a9ctL413fCHi\r\ncWYn+iICAYJhxWhl3YpiE44R8NZb+S+JaCx5rFhorKYLJzNhP4avYBlpUtMT\r\nDU3nenV5N3AWajZveJg48jrXuMJleIYMGkFKj8IRvSsExWyQsMPkH3q5Ee0h\r\n2lbn8CSGCOmYo4Xr0sgrzbj1sRuDZnFGVHT9B8DokewXgqf6poVCAsMiQSa2\r\nCFT/tn8EDl4CoOwYvixShaQGlM4FgUdRJ5RyUNm1mAOTP/VTabtt+Gk0wLge\r\nBEOUZYsbvV7VOl4ENtL8fwC2Wx2H7fUf/0uvodYteYKfAI8JfbmD57HTgt2y\r\nXRmVyni0MbmycRkgCTY2MyUU254ZvydMOmA=\r\n=kh4D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c9b86e4b923c7f1ee9bb971bd802db9778fc0113","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-c9b86e-l77epihh_1661332913352_0.8962107531877974","host":"s3://npm-registry-packages"}},"4.0.0-feature-a09d66-l77ilwfp":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-a09d66-l77ilwfp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-a09d66-l77ilwfp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7feb0c926b52aa86db4098dcc6d727ba67792def","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-a09d66-l77ilwfp.tgz","fileCount":158,"integrity":"sha512-PXJdkqhh8zra9ZX8DfmtuQ63eAR3Mup1CtRXHx7N8l7yDLnog0j4Qt9g+fxq4a5EtYic6Vtiy5CKbLDoOcRDSw==","signatures":[{"sig":"MEQCIHjmRanXYQdoaOfCrPnLydllXs/1CSgQ/nLkDJoGA8IgAiAbwpMCAa2MJ87Czw6BuIKltzk6U3LRlkE4z11lWqHnpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBgdHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrm0hAAk7bzfpiqVTjqgBbuJssWrsOupqfl4D9SWfMU0D6WdSYK7dVQ\r\ntk2ibvDNJbsBuvLc/mQzh6SK09W+UK/A14xAh9CiJ7PkKUwcPzM1h+9+JKTF\r\nucI6qxchQpk8z78DDqtCVC2wUzT3E04md2vFfvwPbQcJK/QYebOz1ouBFRYn\r\nd9v26n4s6DB0U4H4PpZuPiKX1b8PYfI7aZAsW2GQfoxNLdjMsa9mJfqx5eP0\r\nzKVsp5a4L8YcPobuIVfOXaNtFjA7J4Z6Gn356UPFylt6S5N9kAvKDQ2nobOx\r\nGhIGvGhm3hZjdALGd2AT3XX8/y/8bbPrFB1oMmd2vCMDqdcBuGsZKb47KYrd\r\nsBlKtkCqZW2P7af3dN8o4xsxee4FPp5aVtbJsrxx6pkeIg4s110Xrm3EZ0Kg\r\n0wvU3q44G0ACExOFlEKQDeZg1I74jursurHChN9g+pvC7x+N2gT4HQqgwMPT\r\nlMJFOphR6MCIiDA6n5SUETMYIT5H6TWVYdjQEGZcCaN+ajVowSLvywawUStO\r\nErG0uEwrkBiVYswhHyZPqpbQ2dc6Azab9s23wuA+/280QBbDIxaJn0VvkP4G\r\n9PiPXxCOBrbhIBhJIC099LjZoiGZ8MjidQqnCkpmfKeXu+dmkrvKYIn8HPEL\r\nXo1/S8kZSWhf0BSSXlUYRtnhchRAWxctRL8=\r\n=a4Y1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a09d66e8aa11acf86dd49d32be05b32ada83995f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-a09d66-l77ilwfp_1661339462101_0.9405662073368461","host":"s3://npm-registry-packages"}},"4.0.0-feature-a30eae-l77m0fsu":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-a30eae-l77m0fsu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-a30eae-l77m0fsu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5e1c4845ad00741174cf5d43a1ec809f44039501","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-a30eae-l77m0fsu.tgz","fileCount":158,"integrity":"sha512-0ixY1J6DxHJ6a3jIwdhF7B4lONr+A+Ojqt/G+pahqUHkbNmR0CnzwiZqWvAvRt2XXBm+vMNRzMTtzIvWfSx53A==","signatures":[{"sig":"MEYCIQCzN9P4Pq1tWs27pS85fdfNd93Rg4wP9wGkid/1PrZzAwIhAN/waQJif9vX4hc80iEyAa+t+FLVJTs+GdSnqDSbhtl7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBh2bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMDw/+LIsOPK0xqnSfTg4Sc/75Uae/5wwNlrr9Asnw+dZBnb9UaCiG\r\nLoqIAsNcAtt8u0hA3Gsi0TT+jIKPV66veQQ/HJGENoUQ1c7AZEyARsNcVjEp\r\ncznbpTBNXZzLZRO+U8glhqlDJV5ZuTYD0k9KfUZGsxVOokRypT3qpYcXXRHQ\r\nXWw6YM0aRdQ7jl2jc3DbkMC9a7P/934fFpD5RhJg8tEoUCrvfQMoRbjY4sPz\r\nEGI19kecuytX51OVvS9dv4Z+W3dTevv2Oydfhv9BC/0RJ8C5akgjnmVUTobg\r\nrG+xY2U9EbHFZgok8ZngP65sG3MS9X4Hhe13N8onnCTVDOSRIbUKJXUeJ2Q0\r\na7qBrWGyfzn3389kBPSG+gE0jJicDExtg7BIFOxLDCpiVVaLPNgcL4+XjJXh\r\ntfzlA9ALQWut+6cza6EN43CnsmzqhD2YDf4UVJOSqrrNQy3lem3ZxCRnqspq\r\n2hRPJrLlXLU3/KhZzhgkJLNutZdEfUjzAd0FhCkiO7DzTvA5ft9KDBV1zQ+v\r\ncHne3fRNMf97EOs3YHg9emTOmnEC24js2dHDngfkj3Pi99yPsNPciyQpKuES\r\n6Lj2uh738EwezlqGksS9CIGzs81S1gf8vHlS1wZx2kGBH7XUIVw3kptEiKFU\r\ndd0nK6i6NVVQNaqYVTHsqhpxdT2dJ0t0Kgo=\r\n=LL6K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a30eae341c66b61d20cffc09785af394da12c215","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-a30eae-l77m0fsu_1661345179680_0.7743089517408779","host":"s3://npm-registry-packages"}},"4.0.0-feature-fb229b-l77n1f6x":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-fb229b-l77n1f6x","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-fb229b-l77n1f6x","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"02156fa30774cd0c8d6ad93541298019289e38a1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-fb229b-l77n1f6x.tgz","fileCount":158,"integrity":"sha512-DJoxTcm2i/SIpZ4jaFrxdK15WVxL+5Py19FEgSQD4oMkzE2iQPKDahyKbriGgYW+KlcFk2P2AxOIK1CAS8g6fQ==","signatures":[{"sig":"MEUCIQCkK9rEFrjXl0PdknlAuQz6x4eFHSEIqudk6l83U34qLAIgGVHOPKyNfaT/JrQsJilg5eVD0xROFh0JZiOthlqQaX8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBiRZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8/g/+L7tjnAYLF6eZ0tzSY2Ywe1SchWEubSHoAxDVzsCANrysz32D\r\n5Dj6Lh+Rb875ravyoyN2HKmel83tFSTvo2HyJqIZ230XfFh2VfRhDMKfxNFw\r\nQZ1x3CiCJW6GGrRd3Ld/7D1VawFMGXhycmh8w3sUFkF0iK9r3Xoe2LXdD0Fi\r\n4JaCj3eao2qtTmINrKRBpCYmdLnmlPWfKDzscBDMTc2UdA3/vkYeoDlJNHAi\r\n0XXOYv2nXdGrfPgX0Vx0XSE5nYi4Dfq3OoNX1bjI6uKQaxOA07KS2dEMcsKw\r\nJx1Pv8MFhr4yP+yheF5NBuauBQMPGWLZKOhJeIvC1JqMa7f94u0zlTcpUQdT\r\nI88bORQ2a0Bi6VjKCrYGlP3I49wIjBAP3G256Xg8WYJjEzI9Bai2FwZ/9Lfp\r\nV06U2Ffm5fbpUP/Hq0DGySD/mkzUv3rG6LA/2VeSXiGUgD98n8R6FOkildeO\r\nP70fIuDgiG2PngHANa5lnPnyQhZrDqLM3dUznFTekPNrApfaI5IUUtsygx8z\r\n2F384v/3ZFwG5jfJHmXqxbte173SrajDGWj5OTNzStUZnKxYpJl1ng893eUl\r\nwTTSa0LE/EXT5wUPK+m59isVeD7c+TA4/g/geeCZuhclW00uloIfib53uXx0\r\nA+iCZ4Qtn+sRoLWyaAllysTFIX7W1TFlXeM=\r\n=I267\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb229b2a86c94b0f8868cdb4364bcadc5ad67c3b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-fb229b-l77n1f6x_1661346905679_0.3218306418325536","host":"s3://npm-registry-packages"}},"4.0.0-feature-87e53d-l77no92l":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-87e53d-l77no92l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-87e53d-l77no92l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"00e4582447b67eacc1b95e239712fe4f65df2d4a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-87e53d-l77no92l.tgz","fileCount":158,"integrity":"sha512-TGakvQUcmY8z7caViUsZzP3yJTEdsgJQwAkvBRq+4xBEt5i3JxgkVIqpE2Nd3sexFyyF9tQQiovq6a0I6r7GOQ==","signatures":[{"sig":"MEYCIQCzxDNeGVpOClFSun0bBEpjgAKACvZ5cWb0K6iQcwvzegIhAOxB1KLNunOCOfR/p50/4H+85WsSJF20CvoPcCzV4fky","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBiiAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrv4A/+K3BM6BklfPJt63ISZdegzQqgLqM4nswLzj/lin2SCtBLBFrb\r\nvEsC/qAJfj2Acp5Oy6JDzDejtCHCO6NftKXucDs4aPPHr3EObIYdJZkjhuI0\r\n5w0pMUELNSQPDHrI7fm/7TrdrIRQASMbfZ64SqDzyvFNW/LvbycTmB5XDsMi\r\nJVp1fQ7Mkf6Ynd/O16cx3MeQFe4TS1A2YAtzdWRCYHcWjQUNi7/qDY/GCjcN\r\nGFOnuzZrFWlyodrA5AuBtSrYeHZ4+yfvPX8+5rBthopXTiGqGdwshvKXa+dt\r\nHmNS+PmMyKYUN8nwIL7yuhOhqRx713e1QTqA143uE3mIcFHPV0tnx9rIioRk\r\n9DucsSV0ioGw5ZIUoPlaemGEfIqWsDjP+GGQLw1t5hA2ofSRUr4m6eP4/i83\r\nz8VPPN8Qk0fBXUi7B+Qii6jnz36ruHLCEpoQ4w48NOnhetSBh7I6h//c7yBX\r\nmCJ7tTCELHXzx5xJx5/Ka3v4gM5Y7j357bcRoL9WW6ScZoscsKjbrvyKhp5A\r\n8YTjPHrVhJOXwEtdfsPMC6m4xa+QV+hI84iJ4vnVnFg39RcZ/AzPDdB5B6Qn\r\n9T6Dd6Og8yPP/4DMMEbIofc9K757qab8F62pjUoWi9D6VFtXUc6ryfFUetVJ\r\nek0KteYOZZEYLfTRGwYHZgnkoKWxKiKjz+0=\r\n=+E3d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"87e53dbb99c17a22ac3efd486b473d76e7924a7b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-87e53d-l77no92l_1661347968711_0.6623819397073407","host":"s3://npm-registry-packages"}},"4.0.0-feature-cd6267-l77qv0ga":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-cd6267-l77qv0ga","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-cd6267-l77qv0ga","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"77ff59f7eb27617ebfa3c0d175b7f5436a471ab9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-cd6267-l77qv0ga.tgz","fileCount":158,"integrity":"sha512-AW7IVk/iDMVxuOxM7pigm5w81UgIWdY14FmpfxVx50Aa67RVrSEQ3QKIaAz0kplNMBWZ9owBr5dSWZyifsftGA==","signatures":[{"sig":"MEUCIHaots7gJD/GYzRE91oGP8rvFM+jIl9FF4wyre9WAZPjAiEAjbUvoTp+e4FgZ9O8AvZ2uIp597OADwx3wicTzPXqxi0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBj1sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovew/+ILvJZjL9Er7DB8jSsN+DwOSjKpjnWidCYSi1yHMj7qcgUZzG\r\nRrPDuPe887iFo3gEoYddwYmHTY5NHowZai9AXKjMFJZnDzMgT5HrJ4lYR1wJ\r\nzh1Kqy2yVJ1SLw1mDatHCiLvdqWCL7sjEHFwCHfRxVFcrQImu3KeOH8nqhW6\r\nSy40sk9LDA60vjaCkNW/QePDTdDWgrFVF0SNp3N1e0SUG5TM1NRLsQV7MRnC\r\nGfZMDjiSiIWz1EhggXD6/SMbBHIJ60kzz4ta+6M+a3G7JVXYiYSVyJp2VQtM\r\nnQEwzL/aCEk1fAmbV8FL1uieiT0hH0QnUqrb3BKkeDREHGV+Xs8mCOod5xHY\r\nIqJbsVVBzQxSMXFLuzgAm9iZabsfgEpczbhNlIqB63jFzc7voVc1KpQvke3d\r\nPjB6xX+mxh8r887dd8G4ucNFY0LHxnoNC7xWK0Ot7Re0LxW9XWPBnFuLJY7a\r\nd4O/wFjmyVUZH9Z0/yQZWE0rt7yGtnPZDQBxWlZDKBtVKbuD+Xf7orBtXVk4\r\nA2Xe+7ohXek8yXXnsJ3OHnqXUmB0hFR5/oRedlth5q3FdVbNB4IUm3ou3oT0\r\nVIexC9jRy+TjrcH7A6RIV+Pn/japl0SBQl6/IRvr/Tm/LGsPMD3AoaQ1uDkE\r\nLAQFzeQg+CW9vqTEgiVgUeUmEfcK9ztP44s=\r\n=fdb1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cd62673f465c129c38f51e271015cddb2f68e744","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-cd6267-l77qv0ga_1661353323880_0.3340553505975592","host":"s3://npm-registry-packages"}},"4.0.0-feature-2cd9c4-l78pqor0":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-2cd9c4-l78pqor0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-2cd9c4-l78pqor0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"352e1b198c05d792d1f8c718b762c284fca15a67","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-2cd9c4-l78pqor0.tgz","fileCount":158,"integrity":"sha512-Wew9msrYkRVrx93G05yXU5NDRx0Wgf7Teyvb9bM5HmYeuUQstpmZvsARWjYIlxpUPHHGr7BXlDSH6PNRKW9tGg==","signatures":[{"sig":"MEQCIH8gzJCRMhYfkiROa+bifiwIg71MlD9kLULFjhamaxrWAiBIscZGuOSJooyqBByE/1Ya9rnawp/hfWC2S6yi2lfuUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjByJIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZ+Q//bTHhQe70dxnNWB2EXTKmMpkjC+d/tXskXRHhGCuUOOmhT0fM\r\nJc/X/RPUizktqSSecdGWvJTaTv42UJhhypd/E56dzuz7/6PUd8VytImralKo\r\nMEuSFYEFfgENI/rjKnYVCiLSkofjIsp+w9p4/Phck005jg1tp+KSUlkHwG0M\r\nJBlT88yfwYclgifxij4DIZ9zz/EnXRrwZDlEPjGqkJAV7hkfNqmhJicJoQlr\r\nXxHwrU42EZRuzKfad6Q85E5suvA/I99KoHnZhZ1MlQQqbtKcwSmq6ax9cBpW\r\n6Cx4hpRk4nH7U4yYtlu8iXvzajSKfSZWPtgSksZq89P3V8Xqs67GrahfFUPB\r\n4A8IldYSxn5kOYgxDUWi1gED33WodLWggPRPIB5l73l4e9Tu1n3U+a6XiQRz\r\nC0FVrEXrKR2G5e9Q90kutYfzSzeaOTa7JK4TdC3iQiVGc2/JyeTPShzZOoCN\r\nSIGw3xhykQ9tonso8D4FVVv4b9nByXmDIr4bTH5img1xugGhTVcdUeZ8xSlC\r\nsuXzqPlJKuPn1eB21uOLdddXyi7xIoVQSqOYDzuT8gffifRtZGzq9Z33U1g7\r\nnak2HBCnJ5zRsTlfPw8Y9/6+AAg6ohETm7lCEzUZ1/PCCJlohABdPXkFZ3oI\r\n8OeKA6P4a95BhyDyItnhs4RC03Xz0yKlXJo=\r\n=keYb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"2cd9c4ac77a1c1c2f9e0420039b31c26cb63740d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.11.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.16.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-2cd9c4-l78pqor0_1661411911964_0.2622829283696346","host":"s3://npm-registry-packages"}},"4.0.0-feature-1ed50d-l7fyt4sg":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-1ed50d-l7fyt4sg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-1ed50d-l7fyt4sg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6cda8b5ed2d78759898e849df258b944583d8048","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-1ed50d-l7fyt4sg.tgz","fileCount":153,"integrity":"sha512-tsOe/uy3dumWebDvCDcR/uD1jZxbdgJf2n+KECEg74VG4t0l42kH92cxeb7CJ+QrAPHOOSLQWb7FnR5uZWI3Yg==","signatures":[{"sig":"MEYCIQDmb4IKp1PRJJuumJ2SdvYFC0TYHiucfDr525t4kboHDgIhAK7FN0jY3ItjpOl6QN08eB1YGrNjEAUBhoegpN6Lfkud","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDdMiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomnQ//cqPKWmKrRDBxZX52hokQnXwjsPga2KdETulpN8jdAfBSPllh\r\nxRxs8ao4gbcr9qPq0+gVp3xLxNlnnYG6ym7L2xHW/xglDRpmg/oktjxKMP+D\r\n7/SySM1kKTX5x43yqFdL6SNWwYAw+pftoY7d/sXOQO9VJY6Vw01BaeTw1fNJ\r\nkEPaMktsCippSVm7GXVWRF1Y9Y0tkGCdDw2/G22sEFcdXaZodKa19+nCUVGD\r\n1LlDn4bAEchd2drdIRaEI0oDGyO3EL1w3q+77kH3T8S7nP/1TATb87rgeURD\r\n9YYMwMM1oVKefGMxWhgpv3Es9kMM2xqas65GyKNTZujhM4vVuvG3Bc4yPY/t\r\nuAJH2Pt2TUe9xdVirgbWBJ8HH0XGfJHB2kQYd3UIa01YsaJsYCCMhM9LRLiv\r\nARkktIfzx9US1hLv0JYv94n7p//OGkRP/J5PJDOb/8KatEtzspNO62Hs2LTd\r\n2Dxr07NJWZPvCk75KN0vIezbGX0Jfpii9OSkNyTuVgW06P2/4uc4eL2TLU6T\r\nNl219xfjv1Zgp6OHifiaAZ2uB36NUbkCO2/QIyjEEVaxI2guhwO+vOLmuuKz\r\nkelEkcwblv04mEHMdYZPL/PBK8bb+I3tsuiSWpYhiz4hYRz1Vny9zGbkAP9X\r\nFWmcI4ibhEByhIBGC7oLFGxNqmVt/dcWCxE=\r\n=Zw+u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1ed50dd4b542083e9b2e44caa901856d6e894a01","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-1ed50d-l7fyt4sg_1661850402501_0.5000727488294783","host":"s3://npm-registry-packages"}},"4.0.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7a416923f551e10a04f946c38840c0400711ecc3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.7.tgz","fileCount":153,"integrity":"sha512-z+lv4LcaCW/Vvtdr0ntqMs02/TEM6cRE72SGt3aFTX9tIYHuVX1DRqKDEMu6H84Slm51PfGfS09zPgXBzrNQ+A==","signatures":[{"sig":"MEYCIQDx6/vUhYlXswDcERW8Ullx9c0fMFb/NV4sc/VR//FOfQIhAIDH5j3pv1Rd2WQlc/Kdiu64hOXfavRVnwVnP1mJlc7h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDdOkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBjQ//RUwOJTHPhfz4LGjUsEBTkNCKHpQj5raHszomzo+DvndkHjkV\r\nbbqPvOsDa36QsbNUCnT8zY9IcgjFpl6TUP36lvw19Be5tcdSNXTST7osfb8Y\r\nsRFsrodS6AXhq0bi2r1bfz2X8zLWDVhGJIFHGYDkSw8EFESLja/aHYwi/kx5\r\n/KxFIqo3NGq5iHssC1MNIkamYIJTY1luXYlUGokrczJu4Q94DXKT/Osr2xBD\r\nWpJYr1ikss9Co8Jj4ZWIiYNaCKzP6Acl/2IR1BqhwpQQfK3ZfoimmuItNTvv\r\neIVZI81iON/q1dwPhtaejS1tXAiP7Uwe3gB6zWBOo8pL9hhU52r5VQOZIDS8\r\n1tZXy5cvp+J+LbwLlndxSZWW2rd+36Li4GzhoSFl4IEEPMsPBoo5mBxIflk1\r\nfhNGdudzN/2NmeZl3TW//khNwFKGMchaRrSAn5cnqIfxH+4/cj5TcJsmUK9d\r\npH83GbV4hexIOARpox6keOmZdLIWgsC0AV5v6TWRS+df5iOgTfGoEG9HybaH\r\n3GwR5r6B9uCt8kdJ1JA9qTnjNfLbvS2sRCtslIaGu2XLtFr+Mq3WsHK6iVzP\r\nLW0Km5m+vnSFtwR8gyM/VQloX3MnEfYYpu36cgcUX15miH9ZmLbFnKVrIwee\r\nwHIikIyNtiv8Lkk8iHSFiR3titvZK1V2iwo=\r\n=Z7Pf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"17061fa292457b59d6c4fc9203e97374a2c2613a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.7_1661850531816_0.7424786365864653","host":"s3://npm-registry-packages"}},"4.0.0-feature-e89e34-l7g4nula":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-e89e34-l7g4nula","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-e89e34-l7g4nula","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"668a57f452265a83d72939e2a9091e4fafb35a52","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-e89e34-l7g4nula.tgz","fileCount":158,"integrity":"sha512-9QS7T8ahcvS8vf/GHDP2+vG6C3wQ/uPCfxt+CiPELDFlOvlPeIndkDzXW1RJxTNIA839Y5Xc2F8PGdJnuWBhKQ==","signatures":[{"sig":"MEYCIQCjEZ4lWjS7ZgeWStoho9hBxDEGZa66tbRrmQA2fp63HwIhAPxPe3Lh4QbChoJrdWA/dRSLI8DuClOWWZl8RyEY1bXb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDfmKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp38Q//Rhi8i0Gn3wMEvxpiquYVorEI2li9SSawuQ0EWq31Ts9Cs5eU\r\nIWXMeVmuYcLUPdKuoD+7WEZB4X5FoVdS+oaR0NAXMFxwAaLEq85F777AjFLW\r\nu2MsaTXhvxl/lwphqusRUemkYbHTWZ3zWomJGOpuyjNFZvtJ6E2Bwrt+//ef\r\ngUnD3VW3Wb6oF8lXh5iP+JYscyHSXfT0IpK6/9L2bs/mdmIShtY2FCk7p1yo\r\nXbsRGCQaN3tlf/asUtXUAbXqN2sRlcqGdbatyYboLNHdx57YwrK/LkssdPAZ\r\nGIVeWAh52FjKd/hh0aP/+Ne5rBhG0s49XB1RJsnVdLiAfIyn/Y44TRlhbExN\r\nEQGYaKp/6Nfnd4TLOBa6ccTN1PCtUkTa95PhQhMq9pI/+NIcK4EW2Gso9QIj\r\nFB6kPXcJeXjCsw1K9HvRgvqm+EDdYLHpbA/uXum52bhKIuYnn+sbO0Y3gXMF\r\n+ujwdor5HTIAO94Ap/2G/6Q6qHpiyXQ3WAbCRqrJjH2l9euVSByMqWmdQyJu\r\nxWrPwq1rHkNdsREywQcMRK6ZEAsZdmMxzVPjMv5OqRszlWc5ks6KAcsWALhz\r\ny2pZg4ElNaiDgCyCXZK08O7gDava6PveaEC7SuYXSojeVIf2nxc8cCEG4vfe\r\nxiHAwaiHomiHo5SbJ0QaYnglQaAHEBio4/w=\r\n=V9tH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e89e3425ab46d7a78d9b26f958250cba18ba3d0d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-e89e34-l7g4nula_1661860233770_0.9028266371293621","host":"s3://npm-registry-packages"}},"4.0.0-feature-b0bb6f-l7hcl95s":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-b0bb6f-l7hcl95s","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-b0bb6f-l7hcl95s","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a102a514ae83f44531f8808083c35bf566fb2a93","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-b0bb6f-l7hcl95s.tgz","fileCount":153,"integrity":"sha512-89LplLzOUm/IJenC2gq8GeM5GuvkoJeenjunMLweYPLDyBILpx0ppvPQeqOQ1/y1MauAFUF3MDcoIZqof3dCxw==","signatures":[{"sig":"MEYCIQDapkX7OW4tTXrqINcrK7IFj7rF/WfxWGaFO7DOjvC0IgIhAOkwx3K/IrI03JgKxliLMljUO6MSwa6eulsw1vRIeuCb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDxnAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAMw//e8Q/CVWna1RHJFmQjMVU1t7se+MUwuVwy3BK9hGUh/MN+PR8\r\nUEU0fGV9yh1Z8J4PwPpVi/F3PtkMqJSiBcz8idJXQcGdk9+ckkDOJuqx+k6Y\r\nXfe7AIAkfIG3fQy2N3SdYKYqjebtw50YlnIK7pR9rp4R2qUlHrFH88rjRIus\r\nnjW8rWkjpzDf8ROcrzOY64IZijBUCoZgqbCR/3hdYs6A26y2Wpddpfnq48jA\r\nY6hXXejcl1jVFa7gS7eLHzUsPAsCg6VNdud35Kvcb5t83+ZnqRHvkjDBrPR9\r\nHqKl+6SDc1QZUZFuA5+4SJzn1JJu3Ay++9yHfnMGvSYIPT1OP7yYV43Vp6Wj\r\ne6tiwtWJ9eN2I8cFhTd3a1MgWScVvUQvyqe2DPQOw5HM3NKAmEci7hZ0cwWQ\r\n+CUK+aG/pATv4PMp2bGAP7Hk4ufk4GP70SAD7XZ0jbTuvouc20/l5wMA2eQC\r\nSaxuAtuZmAdYYRsIxbfpm7ccKzKvLdgcNQPsBXHjQ8IO8D0DLHZGiKbBtiqq\r\ncRLinzMEVX1ztZ80A5BUmvStboI1JctnM8l1y8texakn/5Uop2VC6SXToqav\r\nZASI4ucrzd2lJ26UzDeX1/A3XnJT7hB8ETLp5f89Ayc6YjHFCtUhLLv0+yYw\r\na15u+tMEnm1ZXmZSZ1EUJjRXP2i/n4wpitQ=\r\n=gtXL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b0bb6fd8beffdfc729c3ed7ba7abeb7546cbdc3d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~deactivate_delegation_token_per_default"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-b0bb6f-l7hcl95s_1661934015913_0.713739622863732","host":"s3://npm-registry-packages"}},"4.0.0-feature-8c4103-l7hkydbu":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-8c4103-l7hkydbu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-8c4103-l7hkydbu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e3de8241e909753e23a47b24a3c8388bf4b61d95","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-8c4103-l7hkydbu.tgz","fileCount":153,"integrity":"sha512-cqqAxPUp8ehy+Cn/lh6mFO9+I+q00vQQ+j1hT4KODNgenzoPPOb/1o+FVS+h3ARtAZLpIIy6xMKji+7H6NKspw==","signatures":[{"sig":"MEYCIQCcGQayuoLk/jcr3nBK0SPEnJuLnDaerNuazGkXho5xQAIhANGHsvYUTTEUITy2+hs9kpyWLmxsMXai1n/EiVi9v90Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD1ChACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrExw/+Nt6Aoln1GIYHqSCDXGOpm6GReJNvXtH2EmMjkmdGrOteAEeE\r\ndx5E/EhAsFNmplDld817JH2GKIGwDpI8tmavaB/w0ktB9/XBb8CljAK/nKgH\r\nJju9PDav8exYWOEMrJlF7kcml36+HhqtW1O6NdZO/yo02y+/4Iy1AMd9aiAx\r\nEA/AV8vN1CaURoVjAcLEpRbXMyIzOA1msUhqJOzdgugtPPo9RgiaCFDvaDaI\r\nrUH4Hvao4vCVeZdhmkHVH64EhFPypqc5lDQtLkwXHVtc4Q2ahr6fkvu/iehv\r\nVl273rCnCW18AUyGpJ8WQcsK1BAP+Hl2QXmYXAgthJTfR0wsmL+MhCZKaOYY\r\nrVWyrLcgb76rBi+fFOmO771ygXmZpYY0972OOw2vt+eJaRZbNzXdvhNid3f5\r\nX1GU45LcaBHzVreAgqEQe1VlSxVLIck5MfRhv0ctU2n5uNzOMlZE/63lMzC7\r\nD+pPpGRSRE+oGR5UCuycfLDJKxC+J+FGcmw02tfC2e/CqoWGE2mxnRLIPPrx\r\nYWtYYBBp5xBFtFsJ7R08bLBHZZ4N+WIyK42Im+ip281VV5CGZ/S6LI3/FvoB\r\ndkamlGedwjZH65M3Z6oOjklxb9n0OIhRcm8tiueGQXKoBuKbj6wfC5oLm9Fq\r\nIwzQUSc0Oia+ubweDo4Y9YgTSBZB2jQuBf8=\r\n=NPtg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8c41038efc1ace5e80065a612fbf411dfdb86c73","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-8c4103-l7hkydbu_1661948065647_0.3866054961502423","host":"s3://npm-registry-packages"}},"4.0.0-feature-6042e9-l7hl3qym":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-6042e9-l7hl3qym","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-6042e9-l7hl3qym","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9ed5240d12e443e95de49fb8845e742d68a5820c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-6042e9-l7hl3qym.tgz","fileCount":153,"integrity":"sha512-hSAuAkzvyUhVWUV6ejy0v2G7gtq/AnFx/qA3rYUZUkzek2ePfLvz7WXMZ70shTqUQPqZcQ3TcRRGC4yIP0B+7w==","signatures":[{"sig":"MEYCIQCabFPjN5QyFBk4vHqOyKSldzM5KvY/bwQ+4FL5zrxz2gIhAODOYekxr5l0ymlhOdGcyz0TI5AsAnsboTmEZ0UczlyA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD1GbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+0A//SIv1MGFEKFr47TvgILNVJkmK1iMEcOloL/1AxmVQp9K7ykeM\r\nvyM4+FZXgDgDFzUti1DUbeO+13GmATUYs8u0jCqwRayUc7hF0w6yLHZNURZr\r\nJEja4+AQP2ZdFnpO4McRf8LwBM/8i52LyDyhMf8v7cYOOuCLQ7AfcBhCcqEu\r\ng3Ks9MrLLND+enUlhL7UTQKmXXD0YZN+V4nT4NIm5+hNfym7c6rQhtvP0MwZ\r\nONY76GxqoJUK3njrSJNaFyW1Aqb0RwV9ZHlj9w7fgX/5UniIMW1qvTEjDRT4\r\n7JR6kic6SBMmOd4aEEdKzhU0w24ZBkNLVR09t64UqeIaOfyYGAQ/S9MMU76g\r\nZhR5WDX6x3U7rYeD3wWbGp/7IXCgZOC6CcjOtC+0apu00iB2MMjp6RWROXDv\r\nx0eO72lYaQzi+aKZT2LC94GQi06IKZIYgtBTwWV2ufp6N1ob4+OSY4aGTjt7\r\ntoXfUeYZ1LElTOMng9h9am5y5mju/Ype5duFNj5UDdy6frPhLABDFtcamEdj\r\nCK1J2o6w3rTF8nAFNN2CONCYbHkMsdQ7sLeQdd6XUEqoT5b+pckR/8X8VuMF\r\nrCfF2+0qHXcGh/Berm/uZpuJJ+iMI9zgY3/tTvjzj8AaOgnMYhMiLTp8Xv8H\r\nABOOc3turPJ7fMpzgYlx+eRvlv9n04W3raY=\r\n=iZki\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6042e9c61b380882cba7ec706f32c87d40ada97d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-6042e9-l7hl3qym_1661948315387_0.4775818349833818","host":"s3://npm-registry-packages"}},"4.0.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8c103990b88aa22b6ba4d74b74ba74ac6611b7a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.8.tgz","fileCount":153,"integrity":"sha512-5kgHMyXCVLi/d5e00mb3jiCk3BGJChL8nQf2Ad6A6WQ0UL6Vd/qa5L1jXMFTyPDvIWtg39XsOsarfJNZT86TjA==","signatures":[{"sig":"MEQCICU/WdrhQ12N5+wg8EWRbzcDwNF2dTs54CZeoujDZzekAiA5oFxyzGo4zNhre4P9hjE+/WeJ+lLwc/RJSW+gyRMEYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD1IMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQow//ZfUdQsDv2V12GZFcMeQ0N4zyINqPNQMoFtHtoZCy/qHPH40L\r\nvoWs7CQhXhipC8lJUKh/UQuRlMxRIk7OMxunrKSrlvC1L3VmOKyfxYOF2D6l\r\nXYWD8c2TCEaJMGthIT2Nq9F2Dnsn2wtXEivt4GfUMCGR3tRU673GUpq92Tot\r\nKCB+NFDZGMkOmLpYkuSrUQCXTz2+Jq3M3vdakxUa/SGXpLSmYNLzZXWj7qXq\r\n6dKpwMn1qyZUi5tNEf27JriIUSI6KSu626NBvUB+oxvRjMBXag5JBeYm9FCi\r\nHF8+nkpO8eTlHKVMoiUKXgLi8fIxhXd0vLkX5PoyuDcu2IGDuDC0oGbcVZ4Q\r\narv2/UdpEVPkTSzukgvx7iAx1bGQSQT6vbDQD/5Nu+CiwFwNwyKlYs0eSi5E\r\ncGfUWWP3sNDbuV7U1N/kqIVgvOzGFRRPBEQBpj21WSXdkYlGzLwDkA7kUA4u\r\nruKF3ECr9Y8wl1Z3A/XGKK9DkPMkdXy2xHjhFNULR5RXl+x9ALLyicEmN88/\r\nJ4638Aedq+7OMm1uLzAV2puiJdZuw40lTXk1QgxJaxRU+5hDo9R1MuaZ2h3Y\r\nFlfJE564jBt5opLaImLi+2X0/lviZ8sl96F6w7D2eOL2AUFPnuR5afC48BP6\r\n2DN3hVKMqLNcvaR20b/zo38nmIKWJBZeYHI=\r\n=046b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cfcb3382956f7474f912e2a6aecefcc4ef8f9a80","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.8_1661948428399_0.9734700295126968","host":"s3://npm-registry-packages"}},"4.0.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1583359a19315051f3576558b948b608b01d9496","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-beta.5.tgz","fileCount":153,"integrity":"sha512-dNvCeyl/4eGJ+PPEXrj60nDfqruCuNAjeEXRk/RRd1NENgMjJkV3qzEZgJClGtKRgfY97hnd3U8PIVufeiNcAw==","signatures":[{"sig":"MEQCIDqOGXbhUtFMCCqD9hCr+u27cuPzjvDRjzKKNhELsqgBAiAXKTSJG+9wyt/GdruCeyRhXKoUuAEHR28Qee6LJ2iqnw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD1JqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXDg/9FwNqA4li0zid+iurdFomO9twVjyQYDCJI+HphFkA0tgvh2Bo\r\nsIGn6ag2F92h4iWU0cjIKRz8uUiHCxnXduOr4IzHbymf47+le60ifAEbHbxW\r\nGTKK5FRhjzNeF6QOGRAzKwQtoBD7oN39cxLWz6ukatYFUKsiNk4a+0FWumBO\r\nNi/DD3X1kzu72ZJUhYSlO79DhvK2bYib8h5tDkVcCXr2idtgCO/yUKe9ljL5\r\nKE7QVscMRKF3dXWM7jRGL9mjaFP6Yn6fZESyjzEuOLmIvzzZCbiZM/XN0yBJ\r\n26NUOHujteosEKqczs1cRWKMJxg63PpI0LF/m7/vctGhHJlKDKzPMGsxgLM6\r\nX+GSb1HD5CAkUuqJuazH1Is8KEQttPq4tO17FjWHXv6eSVa5IbcPHK4LLu50\r\nKcnEbLr9b6vIeo583kM3LTpYky9FVoM9VRRR3VJRSW6DgoxKNwc7YT0Q+wbS\r\nzjy2kRopy+B6ERT5my3ChV4H52VoSjDmaPcjWtVnTbLM878OwEr+xKVsYVeB\r\nhX9kkLb+M+Yxvhi+fOnSdFQQ2y02OL+NiPpwUMHZNBIV4Zz91mvPqvSrNY3z\r\n0BHnQlOcsDvZeqD+pa8gnDhgK8Zm00Nr2T/d/OZcwiKwTVViyh8ZIG2PBklm\r\nMKVBIvzbwltMfkpS6Ea2JVrSgznOp3HHp6s=\r\n=zW/h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7f808c7251e744e18aeb57be9eb80baf9de6c664","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-beta.5_1661948522079_0.7493126945028266","host":"s3://npm-registry-packages"}},"4.0.0-feature-be33b5-l7hldv1n":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-be33b5-l7hldv1n","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-be33b5-l7hldv1n","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a0434bf225bf0c0c67996862909f094f8ac16fd9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-be33b5-l7hldv1n.tgz","fileCount":158,"integrity":"sha512-KL+NaVDlQqknuTN95y14oTNK0I/JjG3Reme20yB4W4yMDmGTa/l8Sr/25KEHon7asj7YTz7LJoSNDL734L2eVw==","signatures":[{"sig":"MEUCIQDdSYoRIxqOXAM2/sB4KvSGFeZTIhvX+oeU9UvfEgNP9wIgBqy4Ii1a/pVwFzvOHhcpbzK9khIeDd+8lkJt7qMeoJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD1N7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9sA//Z2u5CBb41JgDO22gTZK2odesdCQE0jYq0/A9Rlfw9BOdzZdx\r\nmzus6/mvT06sZhwlzrPn5JeGgF89oI/pot7O+h/v6x11hVfMvd7iK31o50Wr\r\nnjEWQoO+wZ94pJ1HDmtj6XUb7mkXAAm7zt1vB/6J339Qdjme6uMdK0zu6IuE\r\nAqAkl4yQepXEG4iHCsZXBWWhRnzwklW7H+21pgM/bLsMarVL/m0XQixBSE3j\r\nDWZsT5pfF/Ibomsr8vrwnfT3xbtoYABWjNAFX0noLLSjvUqH5Hmo/Wmrw+Ml\r\nF/cUrBj5bMguMwXw9VxAxamRTF2T8U/wQBBae28CT7Eu2proTn703aRcKTGE\r\n9lK9W1DhBbNpidF2toXb5VF5C20zlSKMMmZh/5G04Ahi63HYTx17Wh1nTw+X\r\nFNeq1x/YW2spI0QpEnTiwKzq30frNliZ76+sDC9RpmFXLkHbWDSUBBW5ABLy\r\nakz3NwZ7pCvmOkL/wYyZ+dvWVmEC5Zq9BAw/jZAOK1TVdLGVzsjCXXClPMHb\r\n7nTBHD26BOL1VlOFF1mrrHv4fJxsl5yypXAYlH673dXY1tsvAvx45WfZowmX\r\nFcpGrnC799Xt+fCWX4nzatXmhGheke8QIELYlPrS64EBVZXUF5tQNYzcDRmH\r\niZ8P8+ES2HnsXGJknIFeck/iSr4rBPjF1JA=\r\n=LyWg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"be33b50ebe8fd96fae7107512eabb54a64bf219a","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-be33b5-l7hldv1n_1661948795593_0.49805739717623143","host":"s3://npm-registry-packages"}},"4.0.0-feature-257126-l7j2dzch":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-257126-l7j2dzch","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-257126-l7j2dzch","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"946ae667f1e778366ef349226296d9cb0126b093","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-257126-l7j2dzch.tgz","fileCount":158,"integrity":"sha512-Lttsc9/zDcz90ICbi8/9otQ3YmM6B9hHLiafRvxx0BS7FPNEA5vU9yVipUmDgdNdOwCH8GyiipmDDJV7B7G8vA==","signatures":[{"sig":"MEYCIQCegzxhRAM1N6jBjMFeUEBVgpVJ1uAW2FrMO5pVl2DYoAIhAPkXUeYpawRy1LSmvZB08DaVQzGv36N1BaVkgPVhUU1h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEK87ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbKBAAme7x4R197tCmL9TzFgYtZJVrPPOBqMKwOqWipi0e+7aOwAsj\r\nRKD1nfEG8oBME6c1/G4UDlwgLtEhnNWIgMdmMF7rbz3AylODdLaGCwKwsZgZ\r\nG6hg9xsmU2BsN0B/i3fwryJCbhgQdo6nwV9UT9+ZqAxPO+s6pvED4xkPj/m/\r\njOYcmQUp0VhGqlUYQfW2VRLoz4VLiNIO6Q9u38ovbQFJ47v28crdtauQCS9c\r\nIcJ5okVVOjAR2wzguasPU5jD+pMqqSVLBi79Q6U7GLtsyV+r1zJeenjybp7+\r\nkNCDqoXWoQ4e/B5RJU+HYOAeW8sOLoa8mqGSvfYInVotST6mA8xfb3GZvdV3\r\nD9LhpBqvgY5LBsfeyJx7vyM+AxFTzvQEE/M9mGdA8Qg0kIDsHx7bpDtJEMuz\r\nEeYZsjwjTM6n1K/W76XPHikgoIFgtTm5SMowg/afaK4MsusiVgOty/F7l+Fm\r\nKpOLYCyGrmB8dUR3OHhTtIXshrwNon+vA3NpUkeJcZ/sD3sjw1bKCJ2LxmFj\r\nfljsXVC65dpc7+0I/bla91YGj0NhPJKn9mj3Q3MJkMJbXjSiX+Qp+2sZrqmb\r\n3sn+H3TWMkvf61n2JEL3EYoRCFT1ekEIX0y7IYRSFy1rfNyZSHHHjk0fb9Gi\r\n78ziOgdazeJM3VQ2vWjIDG3XwxnPBYn3GA4=\r\n=CyBO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"257126716bdc0133d4b223e2b7765e7f1f75bcef","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-257126-l7j2dzch_1662037818672_0.5918147628071768","host":"s3://npm-registry-packages"}},"4.0.0-feature-fab61a-l7j5001j":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-fab61a-l7j5001j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-fab61a-l7j5001j","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"598745e61f12a71c9ce02ee4f62ea07f275992be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-fab61a-l7j5001j.tgz","fileCount":158,"integrity":"sha512-5k2dopWBeHR9WKSG8C1Cuelt/82g3STDkjEeCLX7SQadaKlwA8SdiimmbbxvNuqS7m/BBK8cCsDyCrNIrhFyqQ==","signatures":[{"sig":"MEQCID62i2fEIv5FW6R1pGFAR5izMULfvtMuzrPk6LkUllqrAiAJjhms+UKOzIfUw84kYCTs7pcTztxH1exjH9QlXgchJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEMBcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqgRAAiYwy21v8LcVAA/+elnW9Koi45QnPrDgwytNM5mc/pKr/jnLA\r\nTdaN9eB5F2C/oOG6vwpNO6WYq2j8eWvyD1brZctV9MfHnEdpCsCtVGBDVGJl\r\nRzqKVsQYUF59IO2kxIlZNBGoOmqiT73PE30VmBc7HEvEo3/lVGJ5PlVcrkXh\r\npvKQWJD9DSnDvdIxjUAwF5imkhwqFbuuwQew+APi32W5ojtRbBrnyBn68dV/\r\nDUnbYCL8v1KT42a5c2ZM/pyf96ehi4v/VQC4J4WE89S9ulOcZl5NNhQtgZ96\r\nrNPJoe2L2K69PSTIjdH93aFPKn9wzyQYWhx8s7ZihzUMPxMoh9ycjv2NGNfP\r\nND5tK7NGU0IDy2AiEjQC/MMUPi2/QPOIkVAhh7/jNfbvpEpHty7/YQ6X8ByT\r\nDZ44j7faDbL1IZ7StWDZj38LXVX1DZqIzq0zEtR6IOpF8E06WU0m+fwBfWUn\r\n+G2lan1HAUKKBi9K/M7K/3QVSitiLGuZ6bSfISnRX/iJ7o5D7IvZiF7qWr5Q\r\nf5ffBoO7gm/59GJumUS+n0rsy1g+0CzZIb/Nm+GP/ynebHInnTGY+7EZM7Hq\r\nPjqUTgjz7COl5Gd3x9xc/DlKhixdaa90RtYWUk2eC0ikY6QqPzZb4zlLsd9r\r\nhuenQjFClNc8wO9zC+2fw63sCVlHEC0uMwQ=\r\n=LpeQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fab61aa51bd83bdbb8d8700ec4f1948cbe12fc66","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-fab61a-l7j5001j_1662042204411_0.8200023714684819","host":"s3://npm-registry-packages"}},"4.0.0-feature-251a63-l7j580ht":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-251a63-l7j580ht","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-251a63-l7j580ht","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"07b454293f0a6cde4af3d179c10ca2efa4b0a460","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-251a63-l7j580ht.tgz","fileCount":158,"integrity":"sha512-Dp9esK1BIgng+61wd9vIb/N/XGvEUtCccEEcD2BwvTfGglj+H8HV718nyd64pl6a7YB8paqS+zuQXKwqe2wTuA==","signatures":[{"sig":"MEQCIGNQLewev6dzraFRmvWWbwORQ+o/CZNt0o7QHmA3sRg1AiAkMatQHF3Na0qds0N0U+ERyUWdmOShOiDx4aMgkgkaZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEMHNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohMw/9Hv/FcSN8CSnph9WecTwjS74QbS19xu99at/G/EaI9R/0L5Ng\r\nHRnz+iJmhh1yqlN+JxS+cOqoDQhWhN6Ww6+X+2TGD41FDGrCsRNmCfjGz9pl\r\nRyi+gN6pBHVMN7PQOi9jAjV/0axFzA9/OJE4dvSBL9jINQCUKvQrMdgz7OI0\r\n+1udIVP9/fLxBUOqqCCUSEFWvrXZCRGk9UVuzOOsYlMk2HT8gGAHDBDfn2mZ\r\ng/yyUw9P4XTqrRpBiI+7se1+FxE3EKQzPhccNUcpnx9XHyA+f/ef/Dypqw8k\r\ng9CViyp6wIKJPvf05mEwQX+pQT4teq1Nn1fwMDm0wgVVmhX/05wgjDhY+DKi\r\nnzLaYC8pTtp8+/guxky2NQIKm2Baiz1cynUcy47sxQVBnXTax1NDj1OFsKLb\r\nutejVKXUUD+KjOwl9bpqskNLtvclHMrK3Mi2jo/tieqI3cfhbo6K7E6cLj1E\r\nV7fj9Pm8NAAYgHZ5PgZOFowxstqz6jPDo79hwIHzQ3oby+Z9fplsyRevCH2O\r\nXCFUyt+n7oTyrZ8c3oyt4DB35X/J2+Y7egx0kk64SY2KtOnlghVeylGIg+s1\r\nEHO7DW/4Y8tW7wTmJifpgdoHxd/FRDNszw8mjw/QDt849brcyTIAV/E7fcz2\r\nMhlWCKr/FP7FXCZjEo06hdkogMujOouU0MI=\r\n=us40\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"251a63278ce1a851e65b223c97896b4d53db424e","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-251a63-l7j580ht_1662042572758_0.2011182678337331","host":"s3://npm-registry-packages"}},"4.0.0-feature-03a9d4-l7onrna6":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-03a9d4-l7onrna6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-03a9d4-l7onrna6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a284aa113efeefb1ebd8748ffaceaab7d396e337","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-03a9d4-l7onrna6.tgz","fileCount":153,"integrity":"sha512-4qWqmNJr4ebiX2nqbTiiuSZa2GKo7ww+vMkccATRYtxtM7tDyftqL/Fibp6f8OYpyQKdei21XuvUGzb3Uk034g==","signatures":[{"sig":"MEUCICEPOYdhzyTHiVvwOl9rMebsfv8O3FRtI3I1zrM4aV3NAiEAuaWMeM7zHGbjCT0EdAzSWlfEF4jUUF1Nx0iUXVwS2W4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFdh5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRww//XsedOFl6uAMxUVOJncYQYFub2am8Bfwga8yrf2qiIEjm6XVu\r\naTbz9oNpj22SYyrQrVmK/sfit1HySgIMUdfAplrnly4nXvx60l6eiFQXykIW\r\nRdwDLlkVf0NgIXoW9R3iMCsYKuhV3UnsSNPjqVk1rXEovdtBvs+/xpWUqD0r\r\nxzGRIA2TSjpAD8A4tQVn9EEygntY7VxfG8a7XXbcyJNKj4BJD8D2RT9rJdZF\r\nX8Up5rQWK5e0/YmOvF9l2E1PsPzrwQUJP0Kr6N4EuVKPPJ3pNpW/u6SYSQxF\r\nEnaa5yE5wDyz9lgPumIOKfp1IaAbMXvIh+0QEkor6UDRtq87u5WPwZmlre7Q\r\nU6Lk7Us4gIo57D2Ze07E2YILpbveuDFzCXncizmlxnvy0fpq1kmdHQN1wB23\r\ngQGHVkisG6xjXCMMsKBTrM3ARUB6vnK9kzL//9obVI7vo4IKpIFoY/e0J/a9\r\nlLNNPsRbSMfvpw3cKFSX0OXYiKClxU5PX+l6F3v2rmjmRHRntbe8maoco8u3\r\n2FyVVMFWGtV3J5tBcVK3CY37lwXSI6GDV4lyPoAhAwdNP0KUpBswgy+vmEVi\r\n92QUugCYvIrN6jiVpPV1WNzwWvveIq4FOktIOwTjZD7HHe0T2DrZwX0eI079\r\nCMWeip5WAf8AtfLt13JQZRl02O4Y6gxIxuc=\r\n=DO5w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"03a9d44e885cfb88cac4752f7004f9477cf6becd","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~trigger_condition"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-03a9d4-l7onrna6_1662376057579_0.0041404278583907494","host":"s3://npm-registry-packages"}},"4.0.0-feature-fb289a-l7sunn97":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-fb289a-l7sunn97","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-fb289a-l7sunn97","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf543b6e587003f8b70ecdd2c0ace8c3a8cdae61","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-fb289a-l7sunn97.tgz","fileCount":153,"integrity":"sha512-zT3l+dFrrN5FBPYRFcdrPYt9D9D1zNBx8+L5O1Z9dk3FAHZc9n+KW0Wwwii9aI/JH/te9MalpXCFh/EjUlmr2Q==","signatures":[{"sig":"MEQCIHV9Zgfk1mvF1hWsqMwfZsJ+QD0xQRz0D6T98nw4JsUXAiAM3vLgQ0DJC2BulKUj1G0wHp9VbjtF+o7rsr0ZKKUcaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGbZyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsNg//TCEE1t2D22n1An4SCLKcn68FsmK14nf+k7JOlMWQxdXKGrLt\r\n5aI9c7C2dTYfi8igQ0K0JF5dEd3jwl2Mq0lkNzU0lFav2fNAPSATCv0aD2xO\r\n6EIf5S6m+YYX7tj4p3iarbU76Ios7RywJfSrpSOkj9w9yPGIJgBh+cUNhH6J\r\ngj7vnksoU7eoiBfcgsYhbXfAii2kcsX/Zf9oGDnx3CWAnEei5rnNiOH3Rq+u\r\naoMVHWM/IzXCVEhTkYQjLMUU++cWjxLDz0kzw9KtKqtsRSinqgEX4oRQbq+b\r\njnqqG+o1nDshFQJLn5cEv6cBvk/672I2sx7mH+QJYpoCRummJZEq+EItUM2F\r\nI+z0MyBuJpC69G9zxs2vZ7oQtZpRWd0WcDY2wgtj0Dx7gClqVvOikEXuSVtG\r\n4CR4JZrX3v+zq+cw4i4Fg6v+297YdvDk8QHl7tZH4FwonWXE0y0E60EfD8ZX\r\nrauANGeb3gajbPpGmmoqjm78A5GTaJdbEks6wniP8RDv6NgF15Yzkukhnj7B\r\nhD8TMwmamonKJBKcN2trkUqqop6xb/gveAX20OMpPk2GdZ+Ky5Jn0WRXr1ke\r\nL4Zj/tmP7bPFxkfXGI7aac1+SM6dEwD2uLSnEcK44gSow0Db4CMuyXIDHP/I\r\nq2wvKHVERu1eDGXrBvAq3IGK/ZyxsH6hnTs=\r\n=tLJr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb289a396dfcc428cafa9e2a540f9b0c8eb3a93b","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-fb289a-l7sunn97_1662629490040_0.41793823209314596","host":"s3://npm-registry-packages"}},"4.0.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a9d67746c0673ca87049fc7b7168e1d0633d6637","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-alpha.9.tgz","fileCount":153,"integrity":"sha512-jr007GwTwNu9kWK2pTKrY7TMhY1FYL1GZMDbHQV2pG+Y0u45HX7Bcql3D9dU+fGbCnRSI+wlKCODa69FmdDVfA==","signatures":[{"sig":"MEQCIHRhYOfkofknSQwoqV6P8c7BqNJsA1bioA3vGCRGNofkAiBIe4RomYpQZvtDdMyCJQOpfJG6ZQIQS2yzl0uxnTu6lQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGb8eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRfxAAj4LdDUAl8KtuF5zg74YBYWzB0ntOh8cALHbmQegvAmtqVVGO\r\nvyLKvW164assgtDVJjw0DUCi62EDN293GkW4+aLeuskodsI7a5MocXLFuot1\r\n+f9DpeY5Olbs4A/rVBlBHRe3GUXbJi2mbLc8JssbLaK2nUKqkosKOD0mO4bq\r\nK3D8M8cV5MLigSWWNJ2/KeVcoi3LeuDm5xx0dcfWd6fZBiTkqHLXfaiXCDRK\r\ndsvSTKiCriisO375AgNwdMf6CWRP9lptuiyLiUIjd0PAq0XA5KGnT9rLUOeB\r\nuPye1mHI2Tq8WcH0TGlr5zTlbZdQz/Zp93MAlMCOTYjuA0EdCEVDL4oyb0fg\r\nBUcoEhOmNAFXmGYgohp9rgxIfD/ISg2NhnIqCozDTkhyRTdCOdBIKX+eKCrl\r\nfpWGJpJ33+KsKjeotx3ECmmHXRSYr+9LLQhCy7Ry/jEAfMxIy/hYgO2YvrXA\r\nKm5Nlb9Nr24yMCGBX+iVonclcOb+Bc/QGJtPyYFcPNmaA5l3T5f/wzledOpR\r\nKYvtIY0hfDctFswxGJ1AHQhuTcpBOxHnPVgLDOtT0OjiaVX8kkDqxkTIVvTI\r\nCQdd0rSHuCINM9khrARDrJxFH1y8VOYC64MtE/SnNKWuBkKQlPfvmcBJmMdH\r\nRH6EzvJc4BtethfBVFcFDWZqDWtjuGM0RdQ=\r\n=sB2H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9459a3632474970e7aea3237550e268a476ae6f5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-alpha.9_1662631710156_0.03014065673928301","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"30e114601e04a9a0b8310c74a0f170624d43825d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0.tgz","fileCount":153,"integrity":"sha512-YmJgi1WouoPFIx3dGOuAqUt8U4QdT96ZsnlPuUUmET4OV3Noku6PkEBNVSPQ8bcZX6GXjUDxu07pA7vU/QWZQw==","signatures":[{"sig":"MEUCIEYwpxm7bKzMRYu2deTX+1RlLRHv/WngmtosNxtGHCy8AiEA/MS2+MJt07Sw0jTY3B62EAlSnRR4rjWabVRlP+n1G+0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGcPOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtBw//S/NF8UlbRvLIfNL76lrXzxFS/5tZ34JpgyXhXdFWboEpKQ4/\r\nJqZu+BPdR1QavrEDT2j1daWGjp8GAMd2WbUWlQx2RqoBc6/U8ESd6p1nX67l\r\nru0NCuygOEfB6iAWbutDOHK70doEMQy/hMmef9XE/nEOQlD4WqGi6Py2vHTs\r\no+q4TDX9571BMFvDBZopZvuO762Wwp5BrzHurWHsxj8u/OniQaBDHB6MD244\r\nkCtcx1O01HBu+d7TfpfZSndxwWcpRctz89fDaBn7hLUlXHvCOmY9idBYeeic\r\nlewT1zl8PTsC7ePImA3gKBXpgvYLT9mbAroBajHAT8bfUxroZO3IX3X8lsNh\r\nm67ZrQkZ55OWeqHNI9fEx29EdddlfGAQNW30CmfDoDC5FNfsNmhIBmPOF4yK\r\nK8bIoEMibd4rNT5zG5K2YV5lfaHQraehFXj1/XRNgRtZI+WRz5i3n2m9w4G5\r\nseFi/+hASfV97lY3RzgXaNJhqE2nWzNqJfN7W8cRorWNpoH3X0ATvBtJchj/\r\nBlYy0ZmbyynQfJAjkRfVNhNz/ik0HMQdmOawW8rOfi14EOgEJYBBTNMEfX3g\r\nf7lkTRBPRxK7EK0IJw03NSjjQwYiCsgtXOyEpQUa/uJAzpnMgjrlERrhMg/p\r\n8Ep8vaPBzwBV/wFXGUSfN8ub4DwFSDOaAKQ=\r\n=m235\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"622cce12b8934b871cea6a8e1c5229e8d4863c4d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0_1662632910581_0.40057062909393304","host":"s3://npm-registry-packages"}},"4.0.0-feature-eb49d5-l7swx3b2":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-feature-eb49d5-l7swx3b2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-feature-eb49d5-l7swx3b2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"44df95f8016fa70c234da43314ae3133cbbccd4a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-feature-eb49d5-l7swx3b2.tgz","fileCount":158,"integrity":"sha512-+DEVCy+S3hugm3J0o2epNJovVCX2Ky8jxSYV6iudib6E9PJWyRF6TW4GMIyqe64WL++2fIUZc03Vzdb+V+vROw==","signatures":[{"sig":"MEYCIQDbIsk9fgDrURmHNzZpdVMem/HQByxPHH0tZQPiQBofxAIhAPKhZpRPrc6v4BsrITFTOulRSXAP+oMZNCx0KJocgy1D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGcVPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQmhAAkgwvIt6YSL38EqtrMFnA2iyoWnDZRRYyAy7T3RLYTKMqv/4F\r\nI5xeaWE7bpbYY8CM/XG1glWlDh9oZWa3bEgY2txiYY7z+qGPqLWNretqX9NX\r\nHtF3lNzfZQrwmPRBBj0gul8Fp5qoAYIXTna9HVbhT5WbMOa9qF4EP5sWzKiq\r\nfPEpzmp/64bVZ0tiAGEXRM1IiCZMNJ42fWZAWveiDuHJPgJn6MQn5ykUuAUK\r\nxyn+lQNJZVuZMa+Prb5LIGlyRMhSp4YUAFJOFdboePEyP8dE5oJBZAz8enQG\r\n8m0xlbiHT7b7ugkvdX8Tk66c5FbGp4mjaebWMbp02KmXTlQ616eqSTmd4vqU\r\n2twZe9bVXLQJ3FHctj2TFQFX4LBAZqS9l5nllAOQ4XfcXBiTmgB6u8BPsxtT\r\nCXYWRN53ZXvakPUOdV6fzddIfiQa7vyNgz/fCq15Eg/C8F5CN70g7vAZ74Zi\r\nQEseV2GwSXf2hnwpzDRc2rH60T4iuwzmUOqUkFHMds3rAdrM9Y8Ir8dtMe8z\r\npRoLhpnemb8Rcw78lt1OgA/3BhIgoA2C1+VDA+YagSj6ygKKAuvVJY2vDpQW\r\nnnV2A5Mq5kfCi0xD97XVlSJqt2m4emGLGT610rjUWa/xbK4SJEwluuhxYqNY\r\nybU0465l6PhzkHti8c1D6ND8tOsM1o2fbks=\r\n=7lNG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"eb49d5629d70366f7e60993484ada67cc345063f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-feature-eb49d5-l7swx3b2_1662633294897_0.2831287256904218","host":"s3://npm-registry-packages"}},"4.1.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7ef55af67459eab9f5e9904fbb258b1171339da5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.1.tgz","fileCount":153,"integrity":"sha512-kw5kV+Gg2hj8/d5ua7ZEiqKIocEJLg7Lt9z+59w26H6RXCDh9bo7iZq6Zrtl+lnFGF/x7RVXtFKkem18f5pnOg==","signatures":[{"sig":"MEUCIQCo8NT6buYuFjwokH6h02YIjrFXvm185juJy8Er0SqJKgIgZEq/kn6eOaHGoujnKlMaD9VjwE2/Tr+Sk8jtq0ZaozQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGcWNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogNg/+OjcjU/Pjpzj2tv8vLLXp54Macq3t34W/+WRWH8zl4gXddHM8\r\nccO0/ItAe6aBJHdY6fo5eln5NpKHnOMg/e5tvBj8S5uZGplKWE3A9vfkm5Um\r\nR65T21CQf8bTU8qiPxb+ugvjzHiCaNJRd8YExnO3okg1zyKz4XzQVLUWPsbd\r\nLT81uK/4p62pY88oU5COwCRHOg7ye/L/zxACxC48CMzdLIOMSF2D3DDhxLHD\r\noFnYarOO3pwlvVYp3kD7v9g+2HEIFhe1aJVX02kw+N2QgoIyRgvkQ6mkzpjZ\r\ntNroGN6a3TdMgWw+nRSiMQ46dKbZUcssK0WHHl1lFnlfjc66dL4c9IE66/MY\r\n5tuFNCpIgyXTKvJTWou7KZLVdI3uPK+nGab2cRdtm/OuMdQDbUbWtrr0ZqQA\r\nuqYKIaJ9M5PHA6ivdVE69Qra6Mcl7S6M4S8EPzkMQFsbeUP8WQDzRaiCneJY\r\nyobIP0ZtWL7Ko0w5vPEM/sqEbBMG0TrJQC2gWhLTfZeZv+9llvvdfXa0F55l\r\nu5QE6ukOrpOIX+aIIz/aJtkCNpFIoboPARZKajLUoe8MeV6V5IjOazj+xuI7\r\nLMvwt3NPK8/2tlIUV8ktvbUbcyitqYV/0DLNFjRSmsyl8mxNSxsigAFhhtOY\r\nbAHS/gPDqHvD9CHP1dFCfjsRIn1Pvn2cGLU=\r\n=Wur2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"67f5c7727f6e771fe5652e359e4f9396a29799c7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.1_1662633357692_0.3275362739549814","host":"s3://npm-registry-packages"}},"4.1.0-feature-434606-l7sxik2i":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-434606-l7sxik2i","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-434606-l7sxik2i","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a4bf5d29c49c43a3788ba00b253bb5e16fda50d4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-434606-l7sxik2i.tgz","fileCount":158,"integrity":"sha512-0rPkRdV53n4JtOPYOFYcgHgh6Pgtk2weyC0kOEkq/BS1BuLOGw4PkjhdENAUigzqZFj/tgLHhSHQQVWtpy0KDg==","signatures":[{"sig":"MEYCIQC/CF0Vbtxt+h+LGzhbhdhPDY/75p81fdVHGTB/clzWLwIhAKJhnU9dzs++Dsg+I786rzFCRTpqqBvLfN9nFEZj9zSf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGckyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxHw//T7JETMb4QZHywBMa1JgZXF0w8dKBDj/ttrT81PDh4cM0nZHq\r\njuR8d2DYTjb0XnZyWZjGfFDAm9n34fCFtgL9wLkccosZkZzbQ0BjinLMoQoa\r\n+w5JVthZ4WQd9a/rtFOTpsfTOt/SKEXscElj3a+fw54TiM3Ju2Rad2bJ4pPH\r\n1rMSwzcRrKqbinF4B1S5rZyQuZhXzADEK8ai/epwhLQCuHBzVMSu8MLQgja7\r\nUYV3ClfSW73Q/Wbc5YoFyzgMfpf0iEWJizNrBDFLnm9ELkh6nxWYu4QeU15Y\r\nHyMgkmcal8Yz13qV+SUQGr79FU0Cx2eLuuUUp05KXCWMcfeZDVrwtxAR5Q9T\r\nR8W1WnAQK3K4o7WRkwQsZMrsaGjafwQfEmvBsdmJUKs9V05sFgc0kraIWNFk\r\nNq4r7/y1TNzNQbe3Ge1cvad4grOTIxRbJYQTxsHy3K5c6ag4N4YAS7t586u5\r\nK/Z9Mb0/y9mz04fln8OcSibtjjqwNjkCKS5MSCB/kGCqajwuugYWP3vdAfB9\r\nnRzcNo0kyuVa7iYb+MfT93IcOEs2gpQB973JsIZeNSJyeVAAbR4RtJXjuHQN\r\nyzjMsNheXRuGGgzj3i1/xzgPpfHR9HWnCyj2TJmcVotIOhSSxDE3iAr1QOyO\r\n+HLT01mjpqdc6B0BL2fnV6grq/1kwfrNwSs=\r\n=TC89\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4346068e293cf07e8b8191e7a5b4022bfaa9142c","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-434606-l7sxik2i_1662634289809_0.4293706597439835","host":"s3://npm-registry-packages"}},"4.1.0-feature-070269-l7t7p40j":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-070269-l7t7p40j","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-070269-l7t7p40j","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ad26ec430098e9c7e3e92a3e2bc2984dda9b0d0a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-070269-l7t7p40j.tgz","fileCount":158,"integrity":"sha512-94LQyA3zh1LNmUc5ZT4TtRRVe5IcL9gOEEmo9xPd0uZOeF5uReY8ctefIxlgN4JaX+8woiBe7MERrZE9PHqD9A==","signatures":[{"sig":"MEYCIQC+n8VDS4EpYv0kA/DmYiJqgHUq+BDKtFbiQOiHe+Be/AIhAOPmeOESub6DPmJM0bGiaQKLOvPrJgy3xMuJutSI/jl7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGgwAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkNA/+JsrvAcne+7HSkAMgzLgIXT0H/dZZG0BgNOtDP8+jkcdNAdLh\r\n63Ovn/TcT9EernNRPFV8RlKZK7Q7fESJudN3F4EWOq7gZk1AoQR5HpKhSBfA\r\ntdIe+a5yT93/RiDDwRqhuwX85FUZ5fUWZOI6fFNgPizezJHtP532Iyh2vYi4\r\nYogpq17JTtlB6UUwvY8QrlfiXScD/dQn+icLydeg1UDaCsD2xqU3YWx9i7m1\r\nGhv3xOY2BSytjwqGeMsoiMfEq2JfCaENAlOaucSniEjko1N1+2kjaOi/btmd\r\nv4xjczMje1ssDst19azj4vbR5PDzUD5OA0LFRrtvKC+TCH8wj4nGOkStDZZk\r\nC3oPfwgmRlessihicxSETABM2FUg6OvWHlbA6DxAzQyDZ0FdGHV67wsbeEhl\r\nyBZrj22IlZIIt9TODReiRY7php6YYNJt9rDrnmh0ntg18sJaMo8sWI43T9iC\r\nVoLKTTBVmUtQKajJuaOHw0TX4kRgZCDjk/uZP1+Ts180qGk7ehKtIdzVva93\r\nAbSfgrrRTp0D61ZJn1jeQGWPGedwFkeWFK1MU5NTEPq20p/NSaFrUvne1BEN\r\nf3rMFs+kRPV92Z7K+EhyrW9+3GSyW05FHjDJkk8EiYxDIvAHsx1VY2rMoILo\r\n2j0xxSVVPJ+ATKagGHSjnAD5n/+RoAOJ/kQ=\r\n=izVj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"070269dfad385e0d6aea61583a80e85b5d5e6288","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-070269-l7t7p40j_1662651392547_0.8741158587762963","host":"s3://npm-registry-packages"}},"4.1.0-feature-b43459-l7udvh9o":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-b43459-l7udvh9o","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-b43459-l7udvh9o","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5f1da939390b58a59e7d5982de4431686ae807db","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-b43459-l7udvh9o.tgz","fileCount":158,"integrity":"sha512-wSflJ71BXl5cUBphUrAyxC5URsvG0k8QHJPbqqF7kUDbNZDH4YgLWugaq1l0t43SsLpouu9K3QXBaQSXUOpa+w==","signatures":[{"sig":"MEUCIQDe+IZnqERONGPQ5UHYkeL5K+gUuHYKywsEfBugYHoQzgIgPiSux51bKZI4U/sOObQOr8MgRG2G/SJIFMX3PRjC+V8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGyC6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqk4g/9HMtqTgFj3SoofpHyrTq2SlAhA7QlIw2kA4dWjbOYzJpALfin\r\n8q1StFM0Nl9sEjdCS4IeX5oCs9TRXJuJBCNzcYHB9/Nm6SFCsAPdjSdc3WSI\r\n5itFU/0ESqH/ktib12bMsGtAXCFyOd69qYbi/aEJOp344rjy5Qj6mZici88f\r\nGJEKdHhmYtlZ35gJy8O77zNwURvp99xNpLoz/NKzEXNizTd6b9eUConC+mLs\r\nzCuFDwGWE+uCGnYAlX3uxShiNSSqs5g6XsoOs/wzRrMDTa2OLZBYVevq8N0Y\r\nCsO6YtRuV/dXiFcAOeeoDqejmSgVbojeay2hKLDyrL3Vz0RqdNZfD5aZtZO2\r\nGC+r9Oe7qlt2LJTJdn3g1Rjl52fwizdCpFI9FkKlqFRm2RtEcoXABeqN/nu0\r\nvDG5UF2JIc9la2CExtlC9/+SRlGCFEQqd3W4mczW4ixGxILk4kojEsMoUZBm\r\nSszT++2B+6r5RPC/JLp0QnAu8+j34i57l8sQciFXqLZ+OiEMcrZd7+VgBj6+\r\nRO9LU3hmNWgaxXi6UDs2P4rbYpsjIuS/Tcg+uxmnTbv+Dnn6Y7fZnHU4re5V\r\n9WPBZG0eQ04jXaH2k72dLb36ZOQtC2v6XcZWLkwgIhYlo216tMEizdp70KYi\r\ntG+49Gic559UPwUldTOqPWViSn9C7wppiuw=\r\n=0O4i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b43459017a0f16716ce162609f4e763e9edaefdc","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~anonymous_sessions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-b43459-l7udvh9o_1662722233806_0.5477033745820983","host":"s3://npm-registry-packages"}},"4.1.0-feature-40aad9-l7ueyx8d":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-40aad9-l7ueyx8d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-40aad9-l7ueyx8d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e67e3ad4b791bb9e00211c85a089f14970e7981a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-40aad9-l7ueyx8d.tgz","fileCount":158,"integrity":"sha512-xwroA8ScR5r9U3UsydlS590tw3d89v9qrt4C+IM14JFh8AV9K1m34M8hzm6e8sGAxNxrRQga9cJzxsuOkqdd8g==","signatures":[{"sig":"MEYCIQCF37oM9jY2kGl18hZPBneLnxNBonxxn+wDPW/NqUGTMQIhAJrD8uH1yP9roXOeDHH+/P0dN0dib5ggmoaeHsxGud0M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGyfwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBZg/8CT3SVodYsEDT8DgPr/PaR/6iV4ejlOabSrc4w3M8wIyCs32Y\r\n6C0Jyxy+ATGMfUAv0YUY7HlGmDfGOR/8WXUPOenqVZn3TgCRIYqI/L7DFWqa\r\nLa6rQGGntchl84e2HHLQCPd4XyJLR3D86hAOw83tKQdfWJPXFLBMYL4IFdZT\r\nVpIZYEsH4Rk1lrdgi8EtiVANd2pMl71CZGUhyE0w4IMUBKbDEG2iDcdECL4H\r\n0sxVk5UjmiFmL2eox1TtXPVLLi11izB2PhiP12yuuu5jaA22zhUJDYLG52JM\r\ni3yLcuC18GJn8AlGZB6hhTeihQtZT53KHdCQYNIWzBb2Va3CHkHDZ622wE2o\r\nQ7hZV5mpD3HnQRhR+2rSKaijdbmepAWDmhOzXUyvLYW3lWeCR/5zd/SjoG8P\r\n0pSedZIPtUCFf68G9PfRse693Oe+UfvbnxRY9XZnStOA7vqB78E9CnD1N+uV\r\nxJj8FW3xYLtJrkPk/TequeKGWT0tcu4Zsvd9yEasnxGpRoJJEVWO4YfedkMq\r\naAjFwVT2rpXc7Py9a4y4wonOGXKA+onfZp+NApKbzpWiIDzMLCc9QkOhOJTv\r\nFW3OWtfj/ydSSPvXR42P58M17QGi21a+C6xXhcg4feF9dxzAzgkdBrlexZ3n\r\nTrjy6SH8sDXEtmsl+JGN+K8jWrtbErDsqe0=\r\n=7Xz5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"40aad9068058d34b134c3c9c4185f662d9219fe5","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-40aad9-l7ueyx8d_1662724080183_0.03522404166769366","host":"s3://npm-registry-packages"}},"4.1.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1176c7a9b128e3bf8b8f439df59339d7d532a612","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.2.tgz","fileCount":158,"integrity":"sha512-ONrwQTxhhyO7ny68JdHW7R7lIqiCmbXIyfjfQdTwVowuFVWe32rqWn+SJ7DNMqAk4tzApElxkVSUzE8e0++QYA==","signatures":[{"sig":"MEYCIQDiyN9+XxV0tZvkIFhILwPBxSjNWNyEMZtHOXzzWeDGAwIhANRWGhjJdmGlKYWquk7I5OTJrlqF+ORy8kx8DxD8+B7P","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGyhLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqL3BAAokLF+nJxc85Sbrt29HGyOlcng3hqQAmHStAFA3Ir1AxkfyQG\r\nMjQ2277xjPlX9hzzjNSS4GpOS4JNXiwjLjWbGFnLXpl7il4sGZo6Pj19arq0\r\nwSa6P6pjlk0//DfAiCeeUmKPfn06EQ0omUaU/xztlimRT0167R/fZ11afJVw\r\nSNTJ5nwxF9WkybIuck6Ub4Z/P+8Y1dRd0IF7gCLaitDBQi+lKP3Amea0lbGj\r\n2XXja8SxOX29TDvlZtomYXBm6DmyFNGUR5C6sqyHjwiwqzrV0k8Qs5Rueny6\r\nW+OkHt74uMvHQNDS66OyAzfXk7HI7t2RbnSJMHBn33NOI0nbLWlPAav2oeFJ\r\naZ0YYtICmkrySxZBVJi/sEF/kKGoWTEqw2myRt8RgQrP2XHdUkebx5+ksEEu\r\nLmaKQx1B4QPQkOsVjjuFmnEYD+fDQo+IuCs2E+rTIc6riOsnWT1L5b99s5Bo\r\nwTyQZSg9yR/Vff8ko+gJcJutD5ozKElYT4o4/SId8ilmS8sWG5BH7PMUg9xZ\r\ne27yR79rW3FlvSIOcxhG54NBSeQp96IbUOdR1dnWN9hN8MPpsBLKsEsKgNJi\r\nxf9hbccnoumU0OhNvCFgUH8cPbu2f9wr6xNRFIlpQecmqGhbF/Ar9zOLhmCZ\r\nRoivBm9OQMGpGgsvAT1IAqBH0zfa+cC+m08=\r\n=Cvou\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a6839f61af1b226a7bea972bfb336e4cf4577048","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.2_1662724171136_0.08308780919147285","host":"s3://npm-registry-packages"}},"4.1.0-feature-dce56f-l802hd20":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-dce56f-l802hd20","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-dce56f-l802hd20","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4b7e2f4b6e48892132b0a3fe398c53c5bbfa9003","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-dce56f-l802hd20.tgz","fileCount":158,"integrity":"sha512-i43cS3vuuSYyDPFv6IXHHy0ZC1l8GC3xSqAINdsk5T+s2qlOiA1Nk5xEqTaj+9xCXsdS9SnpU5abr/Jhnvc+yw==","signatures":[{"sig":"MEQCIF66ToVCLngjxnqOA3+ibG4Bhegc6Ls+nyub8fNOMbvrAiB6KLxgkGia0B5g+t3PJBSuiM0iwpTi6ZFCh0/u5hXXkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIF8sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqu6g/+PSWskdn4hKURftE5MkB7VpdUohF84CFK25cKVE/g9JfLGacH\r\nVo9Ml39T8CLP2rXc+MWF7dx9TXWe5zut77fDKNotmpQI/BIu/AU9ZRljOTT2\r\nNbiFB6f9jnp/W8wWRCPZ7kRUDVFIMun2O1y3w7stY1FV+cRM8CcFxmLuLN+q\r\nQay24L/5vLlfXAiyJugbVKQ9s0w39ZaWXInmb9KjvS40PrWj6YF59AbARF1k\r\nA/34i+IbuWayx9sAdm2dKjFDYIo5fTnGuX5GqSiuAFRAyNg2JGoXVgf7yi8G\r\nTr9G8bO/PUXxbr3LxnV5+kv7UfH65TeI3VN0iUcSDgivCuP40CPQKM4tyXLJ\r\nuuJGCgrIdfSow2hbKzGDEF7+EJD7WYjTtqWQLla9K3BvdOZvd6m07FFTlcbJ\r\ntHSh3LBjJ4KoysgV8TueIrYJtgfuq896DyP9MLFxbxOaU/5tWCxqGUYINmTe\r\neMoa7GVqqWxGHsetF+e/2dkaqyqySjqNYTeajmXM1AcrjewpuI8iIrrb72rg\r\nSt8GfTgdvWAWFor6ClNkvC0CmGmmGcpn2/9wQAO1/3xHFgNaRZm3GDUwKcNz\r\nl9hFmH3vPQfKHewyyJhm+93lWmSwOtye8alBWvN+GoHLmTe4QMUKoJRpiyIp\r\nntE7B+kUOFWd4RrojxJ4oLcaWgTQv2lm4XM=\r\n=mrve\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"dce56f9e8badf1c1a419d9b09af94dea4e2e3aa9","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-dce56f-l802hd20_1663065899715_0.35031680886185157","host":"s3://npm-registry-packages"}},"4.1.0-feature-3c3f48-l803xu7y":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-3c3f48-l803xu7y","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-3c3f48-l803xu7y","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e5301075909b87b11bae3c7612224a66281b0a30","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-3c3f48-l803xu7y.tgz","fileCount":158,"integrity":"sha512-INgezv48Y2y5bgPwPahNV7ZEOsgBjrApHQGIrDxcg3WMQHO2Oh0CtgAUuwI82/2iF/m8FRKw/zgfG1uCVexM5Q==","signatures":[{"sig":"MEUCIQDdq26+mfbk5jxtmXvmYTHuAXZvhHdVdtbymzXgWIdSJgIgbVXNKcDzBoQBK/RseqaCjMenPvKFL8bGl9m2SGSG1n8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":546321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIGi/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz0Q/5AG6BgEiVp0xPMAS33qjckuhGcwtb7DsneHwielmk2jHuP+Ny\r\nnQFBQ8hcfb8rZOQdOgYAKQ1bOpKQLTEzrzEQZbvPIZWK+bUudrX2fFcqbEv6\r\nm1rfonQsQvXO7KZmcoxZdO1mz7otsy2OyOd6NSyLSBM7LiEbJWywc/YqRf0U\r\nRCJJDPJUFE67d5tdJ9oQt77DuAiWuCB5I/mGgNDc2AO1uD5eEIt3uW8ryE/+\r\nbDtaLTSvuH2DzXHKEY3PWDQ9uLEOIln9sqSvR89ri+iY0pzRdjbN17MF4lri\r\nCPxXV5ymoMMl7qush5TFxfMlqhSdrIgofZOuRIbMCe9xEReAHXZZ5Nz+5mdD\r\nzA8an3ADU++RLpGBDhgRvn/bLLuqBJArATNwnXvsUS7FoGEdLVe5+URfUTsI\r\nGfsT8mQWXP+J5Dy4YLDu8QBJ+Imi12vCXlpYznU8LTEB4eQFloRt35RmX653\r\nNgd+tlnEZCP7sCdKbnDe23XKgsuMqEsJ/Qp5yOsW8giamzLEVOldAkMHJ6iI\r\nSsS/9ultHHdHoFR//TWML8S9hZx6YS81nos1rfjZTdryZWqqG4idoVKzFz1h\r\nx8/d8QDVLOYDJrXtoKh04nLb+zVG1X9surK5+AtniBF9N7v+/aXquUNuL+3w\r\nDmAGs90dBKhH7MP8hjPemGD1FQaJhWp5w7E=\r\n=zFrU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3c3f483d260c083377587795a3ca6f98f558ffc4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-3c3f48-l803xu7y_1663068351351_0.6082396563586667","host":"s3://npm-registry-packages"}},"4.1.0-feature-3c3f48-l80461z8":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-3c3f48-l80461z8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-3c3f48-l80461z8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c948ca045f317ecd2f4cbefeae48a3c7e54f1b0a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-3c3f48-l80461z8.tgz","fileCount":158,"integrity":"sha512-VDdtjdMGtE8hHgUl6g3Zqtga5w4LrDId1emlRBohIEirG4DTvtvgKfPVcK57VdVmIqyxWHNG2zPOs6Nv8OZRxQ==","signatures":[{"sig":"MEYCIQCmDLU7G2BhlOWWpQAKTYpCz1OQjASsVPrJjQevMMB3vwIhAPUEkafXQLDdL0h2w+dIj0Tk5pAlGgESAas4+z1g3tbe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":546321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIGo3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3wQ/9EdoaSbE6n+bJoW5EXVJKVwTpBAH0A4efe+cwLI3LluNi87OC\r\nwQXOYL4CtVP7ldwQnZDge4JhnZJTqPiK+o3FhcrmmCnY7Rz8xdaDbbhJBPQz\r\nVxlnxv7bwhYLCZUuS70R46tbeJidw02cbNvNxRa0Od/g6C3+5dbfL8QisFU+\r\nwJr2cmFwSxqj9T4hnP9+pmYGQserOK1dSaOYpc1RblO/uiCEhHaEdkJtPvMv\r\nwmus7v5j5M8+ZnNk8CuvpS9LdTxSlcS2TsQujU9gtZ2/bzyeeGRm4xP6CqVK\r\nLz0XeCu1x+0owJ3Haii1dha72MeAXJPdGnjPO/o/2xmX1hVrR7NMSC6OAju/\r\n+x/p9QoSjWoBY+aYDSYAT5vULSM98i5vPj6CRFBH0K0c8KSHFs6n3VtbxrFZ\r\nFxn08rJNomH8/Yp2E6bH5wggO/PXTAFdLcaYmcQj1nN1wuhOgdV9r3HO/fPT\r\nRtcHRw6N5m2x37EBx7lwJx8oroa9Hz+XNu0zvTvOEMMbL+Gn17w7wmQytJkZ\r\nQEMrM+Xuzpz7X7R1pF9gwJeSA47I0ulHdd+iO4Sdzks/ljZt7ek+G7JvkCqh\r\nPA7I6+G162kvxrLmvCm983/gWwcEAG6u86biswMVV7E+SlStuprdUPVfXdTF\r\n43WdieqvtypMYnr3JXcWMqeHBk6gq06K3/8=\r\n=Xsh1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3c3f483d260c083377587795a3ca6f98f558ffc4","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-3c3f48-l80461z8_1663068727655_0.5074396433523505","host":"s3://npm-registry-packages"}},"4.1.0-feature-0fd57d-l805wmc0":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-0fd57d-l805wmc0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-0fd57d-l805wmc0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8c7d408e315b54c8f581b050a228e8d64c2876be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-0fd57d-l805wmc0.tgz","fileCount":158,"integrity":"sha512-vO3X+KRtGdpmgxPdN7YvjWPAkZbnws1lG8+0PP7S9yI/jNimtTXbHKnXUmPi4m6LVtxc8mmJ1esf0ZDNUaLvKw==","signatures":[{"sig":"MEQCIASO6bFIF+hN1fadb69W30U61HnxEYWK5v78IIrOXXYyAiAVy+Db6IyefCxS2TMllPZghtagGMhDJDZYM9f+oBoSTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":527897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIHWnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr25w//W2YtSR+FQImGHON8TVvErx03vxQnGkctLVljAb/YPpbEC0O3\r\nRsx9IjDCQWNb/aRHQAvLakjotKfHxfGJ3Yk6fXUe4SNTkH8OTVvLQFJHJfz9\r\nK4KHITsZl62SNxMKRCbVfX0XM/WXfbbHZm8FfIEwPEXIFQS8TqVpVnotZbxe\r\nLRLnE1aqkCwjIN+I/TkSTJcnpj6V7tbQBZucfIyxtlknEKn5DbupZ9om180z\r\nk6cpWlBtnzGpTnOzwMug2lh68IfOQK4fETYOy+iwvlJkrXwGOAsZleVZ9ZRf\r\n8Q/t1US1Sb/D2HLjaqLPcQflkIPVhLD9cNR94LLUQKsjH2ewwMfDh54y9/M5\r\nWzGDHezEbnjcRXDVJDIZRZKXtHYvdVMLSRbtC/wLF/2hoqe71r+Qd2d5SwnE\r\n2TvOT8w++xCmOGX0o1Lfzov/U63ktZblneMnmM7uYrBBBcXPmRx8TlDausps\r\nzSEXWUXqrLo2kghDWnUug/0iPIOKDQawNRfDMlWsAklKP1zA46U9ejT5JQfr\r\nWpy60pJiSVmXJUTKZTJ+KvnOgBTDQpPYO3rdZ7peLemQMlY4qt7vfpQHe1lP\r\nszMlAWFZU4i6GiMPREUivIAmyokM2hOktmoxYFY9Lwsum8WF7nVbr6DYDGMS\r\n4xGDZKoazXvL0ZUTspoFBBHAlfdWout71g8=\r\n=h8Eo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0fd57dcbf9052daccb4027acc03129855e829746","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-0fd57d-l805wmc0_1663071654878_0.38505036815096294","host":"s3://npm-registry-packages"}},"4.1.0-feature-6782f6-l81gcz7w":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-6782f6-l81gcz7w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-6782f6-l81gcz7w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"559922aee9559500ab14f11ff31f3d8d05d7f478","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-6782f6-l81gcz7w.tgz","fileCount":158,"integrity":"sha512-kjmWS5MkskBpPKmnSHuRbsKhrJc0CSucoU07PgkKDBf3F4fOEFdixcPYmpDuBJfvhjiyM9gzf3TI6c8J/bYTHQ==","signatures":[{"sig":"MEUCIQCc3md3OtEZk6FncndCFHWMGNOe2aLMyQYO1vfIYfIXaAIgDE7dtAvPCOYjZFUDp3nifxELynkEQIdSpiPe86n77DI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIaZtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHtg/9E56a4fZDhWxexNzc8ddI+I8BxypQzdgr30HgQtLd9VMoXiip\r\nznvfsE8+7zuXHZbqwcQDTEvqrvtFmXa5UKLWQqomOAfcAVhq2FNXRDNEms/Z\r\nrVG5ieePYrRXFGwHnuXGhgFl0AQ3yUL6/aljKIx++LsnY1YCRm8bMMBwupnh\r\nOSaD1d7aEJkDAaOT/z+Id00Li8aiPkC4UguRt+I7407sisNgePZanqR2mL6P\r\nckI4KP16G/CNy4MiH009inKgLmH1k6zX/v4CxWBIZIP4qH9UPisW8k1NRBMq\r\n212ZJ0vYObkIZvkVPM9SFZZiM+WJK8Ift4/kxwhvIfYv17sLtgZei1InPyY3\r\nfo5MWZ53bZzTIUzBoUR/H8j791ZHhr6DH+vrfOSkyP5iZmOZgpa1aqi4mUtK\r\n73NNCs5j8Ob4u6tvuNRuIVLc0qmDKWey3kpkAE135eMqUsgaEF/92IF3y6+3\r\nurCq9LNaKeZ6bjhLXg49Ubiz6PRBEY4iHoSE+nKoHsIFftyLUc4Xwn64pOjB\r\nfSAyumc6vnvXwUnP0kqr/atS/uHqlWG793Fp4SOzcGrLByErs/FHW1rFyIVN\r\nNnpAFMusiBdTGj1+Xr59iKbcltqpeJQjA1e4rgvv1dgBddXGpdFklqD8KX9O\r\nyKJHI1+SqPCjGL4cpauwzMYx634ocSJKIkA=\r\n=XA1f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6782f62c6570f4695698b3281263ebd5f5b02838","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-6782f6-l81gcz7w_1663149676769_0.7599188240379959","host":"s3://npm-registry-packages"}},"4.1.0-feature-ca600c-l81gfa4o":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-ca600c-l81gfa4o","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-ca600c-l81gfa4o","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c1c5513bc7cfad773f409b91ec25b5d0a0e4e0a2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-ca600c-l81gfa4o.tgz","fileCount":158,"integrity":"sha512-LadeJH278YTcmzVybTJph3/+U2Y+R0BhIBwdBWmfH7iLr1TjubMk19nq7MDJhYMlkedGGQcF0xJ0j4mXh5VCLQ==","signatures":[{"sig":"MEYCIQDSbSvR0sWBkgOK/k3t//fAmUMJzcG4vDK3U+A1NKiq8gIhAKCRbzo92NR2gn/FyX0/dx59TTswUqQW/HVkhPq4ccH9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIabYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBUxAAjudU6SNs0EfWAu/Z7VG7ieW5Nw4bxLJL1J850SOUBdsxJJ4/\r\ngFv3OQLjVk1GPieeCF7ac/7N8IHSTw5a13on4LItq8zpm9PLokE2FsAJdhKx\r\nvX9ZsX57Cle3fpVZM03j3XlJatWNY6FYDDWF6abXFwCp4D/iW5hmqssGvjbG\r\niYpDdaOm0IBPLJsVoR30pJQNxrsBFOz7LAGqhR3zCtSK5bMNLZ2SKr6D+mhL\r\nWD14GlwiZNUCUBH+lbi7PQSuYgmJbaFxHGYqMJXhUjk6aHsTRzk1ZeKJ+F+4\r\n01RXzgb8JVt08mPuliUyX6juuZMG8sQ797F85oZTTMXwjt1ttVUWvTdosm0K\r\nr7GODDWv4roWLBbQpEqUJtb5RirXzD03rjU5R0XgieLl+7TSmgjds+mAiVMB\r\nOi2vz+5MkiNVxI3VjD8G0+egtpAX/wlvqXTlAs77qtCh92+XjWyl4RkUyLsr\r\n05WZCG6FAq6LdHatX43HDPgkQK+EGCR81m1noWEhiHMLqpp0q0vbHit+oJe4\r\nozVkVWzi0T7d8dYdIWWPEAV0Mb3nVRKvHmp2Pq3U2+nPUCttrOWnvHaeequY\r\nB2hecVy4cbxhCpRjTHo8zdLVRpu7DaMmjoLyAH2RA3jVde6aONyzYeHPuBtg\r\nGcEYR26xk8Wam//KL/nGuFgWVsuDsYWb+uU=\r\n=cjry\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ca600ca33b21a3918940cc7b71791b2c04eb7a62","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-ca600c-l81gfa4o_1663149783997_0.8271591188812588","host":"s3://npm-registry-packages"}},"4.1.0-feature-5bcf33-l81gyv9g":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-5bcf33-l81gyv9g","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-5bcf33-l81gyv9g","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8d640986e5d63599bad40fa0750292674ac53aa8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-5bcf33-l81gyv9g.tgz","fileCount":158,"integrity":"sha512-RFSvduapp84Ym/49I7tdDFvZYgEDpC/QGh3GdAB1OxfmyAm1emdtvdvTY7t1ktNVfQlTmEQ+Kn3lEgJC7frx8A==","signatures":[{"sig":"MEUCIQDzEY6mAvhTEo140vlIX0d1VaxojXd6ItDdMJaBWurTLwIgYGQ8czlIlXXyMOnSsyCfXToqVnuJnYvPNlboNBksjtI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIappACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9oA//SDB+O2jPlChi2m8EeWtPkpOrssEnwggxq3YoWgvwzxOBnveV\r\n928HFJ0ed32Z4RG40QtomCpsXTZPpcDwYvZ6KT2BIghilrdWd3r3jyCHcMxR\r\n0I2LCwyPEW0U6OczfKS4F/6cvl463RwgC3xJ50MlyWeT0bEdNBABDNukUCHW\r\nlF9vIFdaHMtGpupJap0/s80bT0Zyi1wlDf9MqXOblLOw4sB9xvm7YGbAIzFJ\r\nsgKb7Y64vuW8A9lqnI9wavDOmmxgXACJ3vr1rpSDY7pip93aQLgcKl1XYQmC\r\nPFcQxFR9Z3P2imYwbnswcD6YPtaWfb+Q89b17PaGaj51WmBP6BXXMV1wytlf\r\nxBCl3w2KpU/17+YkF7a3uTEFdVxhXZZ8HcoGe7AaR/570zfYlLk/Cr4twj++\r\n33ew2xhJcyciczPYzD19c84SG2Uze2sz+Z/P1Ji6CNxLxmKRscBU97+cokC+\r\no8mrHURj4z/QHehWh+NcKI1UejWu5T8CQlza8mOunjjt2OBEhd02sGqTPlG1\r\nYIsGJZJdt8smLvuocF1yTG1dkrusR6W3RzcLPwtlhhV8w1ajuOSFxbZHm2qy\r\na/+H4dvtr833/NAkx4DR6G1iOpFV6+6omu5nflLr5vL1HO9jGzu1rDXVaufY\r\nNGmdtAYXNS3sR1FE39oeprUrKj8TAG36rcU=\r\n=s8jE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5bcf33c7a4e261b64a2c09e630f546dc28dd9d57","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-5bcf33-l81gyv9g_1663150697669_0.06745467512939629","host":"s3://npm-registry-packages"}},"4.1.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"530b77b023fbdd30f0a882fcd4b78c3d1738584b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.3.tgz","fileCount":158,"integrity":"sha512-kkXj5hFvvf0QWWN3itr6rDoV9Pp2CP7JrZiCPMU4kmYnrmvOeNL8LdZ/1WryYLymLFYU6dfEgqlAyVIXZg3cJA==","signatures":[{"sig":"MEUCIQCXjF/9Aseri4MesTnmAQxvnbsvspD6jO9g6K5ptIuewAIgPpCXTmqHXh2dBftB7EhFMzrHhzIYIN/50vZkRK+spwM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIcLiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Qw//VgiyQj4813eq4k8ukimW+1NOC8mG+0KVsfsN48gWNr3TTZeq\r\nkjMoPhGp6fol7AzrPhyIONU4ibr/kjzHELelHZdGKX3vX6L0FjJbSwYfowh2\r\nUAwcOHM13v00odIyO/BAcJX2OdI2q1f+q9d/no7McYZfx9smYDPlUuLKjn/f\r\nPlSPOHafk21FnyQwpKqmwiLSWUaY1n1m4G61D7NoSpphZEGiKnTRJOBG+f3p\r\nI5TreRTDKF8M3z9lFz/u0ZUn2E5sA7HXGmR6voZmkbbYXq5hvo2x2RAVwKXV\r\ngpWI9qeCZW1Xxwb7TbFt+q422om0DY0l77QUeGKkzGb7UUNCwu/aPAWzR/I8\r\n/UirFime54raQTmmqNMQP6tpEV7w0GhhbytnSe/kcg3mCLqUE0CStEg+qBIE\r\ngWZN8tecEtZVR4tX0GfghHfISzr75tTOof3HQA/IjbMZ6fqa/cdaR6NeT4aQ\r\nYv3Rj9l9Bsxe5opUI1XHSl8jfUGv8QY4zocUtRqBvoIIdrpfS13Xu/V+nDNZ\r\njw6qu3fR9NEEVFA4E07OS1pBGLESaG2Iv5T7xamu+Ig/HIU874j4on4jscUv\r\ntGER4X0ZZ+UrEur5vFu91YDLB0b+/wULC0WCAm1ltaCw1CvDgk71fdOGnB39\r\nGA0gGecWTOcJXqhePs4tSX1J7H9sd18VlCc=\r\n=3qRk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"56b6530f0174e10b990881c31638af8980c0355d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.3_1663156962536_0.7846128130713721","host":"s3://npm-registry-packages"}},"4.1.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4de8e084158e55b0dec9bf04531de395e67359bf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-beta.1.tgz","fileCount":158,"integrity":"sha512-TqPUUUBCFjmlPtSQ8h1E+lJL2nwvOBRUnu39OZhdJJNffP6wpR/kqgccRG/hDKCX1saO+SryTbZjvx/KxKgUtA==","signatures":[{"sig":"MEYCIQDUjXCb+3jPwS3TSsARPwPE5WwWVt4pi4ZBEQxcAcE4wAIhAI6f8I2p8c8jYmNWqfZ4quJ7+z25YFo/CcWFDukpkp85","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIeBqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrj+hAAmiw5ewf4ohOAZLF0CIplW7l8qbZOviiY17hCt2R1xQR218KO\r\nTOsrSdVnJI8j+QZauFa+RbSGW2vE0E/E+3wzBr+Q+mHuX5mM4lc3IZiiDGK4\r\ndu/fJMpmvIR6fCWOLpVnOpZRis317n+xh7TLO4ITo8fb5OUnR+u00HMtdLC2\r\n3OTLp5QLAGgk3Cem78Uy6R6DQuIKcFPwCrRoVrHlE5l0kJ6uld6qr+BjLych\r\nuxg5TnEVpb8G3P0ODQ2pZFkcjm9rvjOo7gbG35/S6WxTVe3loWFkj1zEP3LZ\r\nHm+9gu2ubWg8GHvaxx6iCTMqedhCYNlR8YlfWdQmTAOSDrmfR67lhJykzrHS\r\nM/RjJjINU8JtvnmrquFS4UFN6m7DcJI76pShkKLtuQ+qEPkssRX2EprsL+u4\r\nIPTFOLEPJdokfY85Hi4W3qQRM/KnRNJImARuQ/lD8tFUy+sLWuQ6xZu89Y0N\r\n4ScroCYTXMmyoInFXP++1WqgKBwi0kFEsxWy5NenpMjzmN7LMVkoDDluOOEJ\r\nZa0H2lqKlnL4DnRuC3T49SoFurjV0JIR1ZJ71wOnS+hY2N67HMt/RurI5BIl\r\nA72G+Nh65E/Wy/3/OKNCkWVvNmxxvdIkFZ9ERzMWraRhx563eUTrRRQJAlWx\r\nuS6w1my7WFYpKWo9ZuieHpbb3Bi5SVv5UVk=\r\n=pyja\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4aedcf56b9257fd1a29f35a3dbcefbd27ba9b2c1","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-beta.1_1663164522047_0.5542494536548377","host":"s3://npm-registry-packages"}},"4.1.0-feature-8f43aa-l8cqwg7w":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-8f43aa-l8cqwg7w","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-8f43aa-l8cqwg7w","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"afeeeb3f73693f6b530a69f843164975e9a499be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-8f43aa-l8cqwg7w.tgz","fileCount":159,"integrity":"sha512-6ZsU35vSWprpzJDmHe1JKDSbD+bfbHI9pdj9YRfeiJI+rUa/h9orau7C/lQueEXovirO9xLhVQGSJeyrYGwZoA==","signatures":[{"sig":"MEQCIHwoDp7k84XSStZ/aUgemrWTONbVH+oDu3WkfT9Yi+ZKAiBcMd+dhzmx7Ftm3GJdL9TwRXXjN2FJYMiPu5FgcJ+iEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLBG5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFJw//XOpdYWAdHylXdnF0WYux2NZs+N8LlUTW07UVim2NM/aTCi1F\r\nECu3bdKdDD3JO0tdkl+hSoLexYx4Ej+7oJ7fIsNC3r+/39QErMOpzAi9o7oF\r\ncUUzTw8EhREP2d+G/ZKN8ETVjLG/hBSjRXhIZI/UoYjTC/M6/X7shIxeVDbS\r\n3xjOdk5BYu7FSp2t7GEjQ8lSQzihDecLeiUw2Xa04B0wJmidBBhM2X3O4qDI\r\nPK0rYoYGXHoIHkMD3MTTzA8Zbdt5WBaGgBQOc+aR5smw+uFTVerUcPD8I9/i\r\nWpkGc0KWjDbhnWEnAQ8QtaU77aXDjPuzbIp21mjEoKs/BADSXEZZq60YW3+M\r\nx6s/vu9t3OT7Ovm+Kg/lX59QBOhU+rsAt8jQT2+Bfav3Myoce956WXI7a2/C\r\n/n6EnlrvJ971IzhZ0Fd0iJbZZhys0wAMVXZHzO50o3iYHTi0Hs2RjvRaLYdt\r\nF82dmXlVTAfrVJe1EwbKlan5njnXPPDxHEkhcRd/dgg3036KdszHccFVI44O\r\nzTWKSNc6j1NdNQ0l/0BQZG6/vh2oF1xIOiuTLtLRtcqGDnQJX0nfvxVdV+fB\r\nHOpshPuam1IbOoA+3OYngzPn9NCk6BZuoE7llDiwQyaYIpI9fUUhk013uhOQ\r\nbI3FTOX/Nd2d0d+HAIBQ2xMbi8XS8c4OmgU=\r\n=2ZYV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8f43aacbffd69ecf053c5de2e86fe04c01a4a4ce","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-8f43aa-l8cqwg7w_1663832505147_0.8354790982807361","host":"s3://npm-registry-packages"}},"4.1.0-feature-fb623f-l8cqzrg7":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-fb623f-l8cqzrg7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-fb623f-l8cqzrg7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"54d8c6d02360243f899070496107501dfdabfe17","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-fb623f-l8cqzrg7.tgz","fileCount":159,"integrity":"sha512-cc1851sBj43uY41BySyzrjlsFAIG42NiPpR9Hrm09JBUAfIXysBbN2WOQlk3pacmKe7l9TBTH0b+Y6FZDens9g==","signatures":[{"sig":"MEUCIAnHnsb2im7x/IAhQC9Hs4H2wr4i3ntQqlbdf9+cD65EAiEA2QfmG/baAP/bCNsRM+Pje9nDXT9fTofCH3Ul0l/EDWw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLBJOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpa2hAAmprSMlwsuQKVaDm0JVqFy0b4PhhaQ3PhvFXsRFLUe8EgE2vk\r\nQrszJgI9oz5pfpc6Vz/g8/gFfw1ZgflNd9jEzpYqH6qe/NOqsCYvRjWXO7p/\r\ndxhLnbTwdK3Yd+RX7++nzpVzDANyjE4t3+Os9WgsBNC8iOvDlgSUaaZwzdhZ\r\nlDr1E7/m7z8UQr9IhVY03ksT1vRkNYdYkI0y4XTndkN3NbNUpTUFRelMupZi\r\nxAzSoJmWlMwhzB2AYlf8PF73LghTEEa9xIPgj7elqbWoI1ihIlzH2BajHOxl\r\nfkTDauujBoCdOSDTtnNVKvm3Xa8NLasfcXfUSBL+YOaY5DEgz1cWGr/HGak3\r\nWO9n5s3x2uYj4HhkKgQyJJxuNDSRkfu/sL1/DjIXnWajOh5JxfkzaD7sa4pi\r\nTBptjwxNL1ngNhzTy021O2gb37SWZTkqWPxSu8XHUz/jYV4ochbYHeOaNzdM\r\ny/uiYIvAwLGTTGWH2TTGDw3PrYOeMIieZKRDXxJARGkw9khFaQIHr2dQaw46\r\nKiyxG2Ws3xM6OFcztn4S5jRvYWwtmoM8NaaBryZt5ALPjyFQD5Fq4einnYqO\r\nKdkTRbUY6ESDdlKaNR5LQb5AHh9xdXtGPGFNgZRs53ZcCZ9tMUTj/amltzYW\r\nvNjaaIM6VKBXpALIxwpARt34n+R8cNTk1So=\r\n=mCuu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fb623f034d279aea9f6e5c5365e151e08f3b4f96","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-fb623f-l8cqzrg7_1663832654297_0.5317704283499416","host":"s3://npm-registry-packages"}},"4.1.0-feature-35001c-l8cx0iq7":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-35001c-l8cx0iq7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-35001c-l8cx0iq7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"70d3515ee454098d99ad8a91b114ce69f88b752c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-35001c-l8cx0iq7.tgz","fileCount":159,"integrity":"sha512-yQ+hRFuB9wfnvBAxEATG2gzHE/LRSCp14dPx8mbxuyRPC2GUqH49AdkQPEPE1TOlH36mFkI45uKxI2Z6M7EG5g==","signatures":[{"sig":"MEQCIFEfD5YscZONBotE9Ek4NU8cL7d1ZvGY3V1FzWC6lvX3AiBrdbnIgpqVLubEbPtfD8c0J7GxTXflmAGveervQkBbKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLDnSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3Bw/8Dx6lRF26UwjNQ6lhVE3GiNrqZACMAp5TQb0GvF0Ti2LYbOgm\r\nSbr/cqOl63YJb9+AVE+e2EVZLk+tbLX+tN0Y1ocbYuKzPVNI1rYTMTtrshD8\r\n/0oYdg4rCnkGCYLMEnLFw3CJ73PeGnrKLbQwqlBvBoD0h+J77p2yrVe6Ack+\r\nNvl41MSAaYxpxota2b/gRDx57or5aCQSfo6GFqpvmoeaCTKCmXXnq9KBhx1Q\r\njidIy2+1C7dP08tY5ao2M8GYCit+hgxpkKP3Ccuhro+M/xkrgcs3RTll1IWa\r\nG5JIOOc1eXiMsPIdKtDOoBLiNXsPDl4LtDMgbaKYQvK8Pjp52omdjce4cyF6\r\nFIdR6/HhltnCYSwS1j9rGDCcti08vpibZMqLFqYpXibqmVNyZxxYcGvZchmR\r\nBM3zuc8Dbb3chtw/oIGwLy/Hb4C8nn0DGXEj+aI0k8IRsNP2w3fpZkcw0Iaz\r\nvvwo/CWbIhJhZV/wfkozhExpudkVHSErtToSU00O5M+SZvyAR0F2xCaXm3aC\r\nKi61bxY9qFF8oICt+HQZc3Ce1tzwafG0yf9SVGrXvH9TNxBNS51SEs64o1Q2\r\npDZXCo/2aaTa81oCidpvrELVG6ZL5zzwTW8W2xsDXcXWN5jvvMtHejYBr9Q1\r\njpOh7vxdoiLh0KVLpU98BLHWW4s4TiqV3Lw=\r\n=XtDq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"35001c23cf363947030e250fe1a03d72a1366897","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-35001c-l8cx0iq7_1663842769768_0.09867946918934734","host":"s3://npm-registry-packages"}},"4.1.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f6f06b85c527f96cf527c783540ca6ad529d12a0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.4.tgz","fileCount":159,"integrity":"sha512-i9CaUwtOUg8aI3y2Ugi5ECj64PpL1en5f35k+JtTV27QPdo/nzrl+iYL7KSNpvB8U9YdaR6ayO1p0g5U2VXDbw==","signatures":[{"sig":"MEUCIQCrg/VemHzdhaVbCB5EoUEDtCvuXSb6Pg1XagqBeyyaygIgK9Uk4R2Is0gw87uajgPVAQLTzBafrUlfR2UQy3qNOwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLDoqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpnA//dEnSZ1ci/xRXkrG9Ihcenfl6QHMWEHAOrX8WXyCLokHAwc3O\r\nPtafRX05G0+hFUEal2g2gd+ztVbbpDyhP2IOf7yPDkMZfZsXRCdi6klcCwiA\r\nCN1cpvcB3b9dMCTpcTzow+JSjT7Hmxrg+MaqntRYb48AO8PlUhirlKPCkJqf\r\nuGQUhhso508WQhGLsyhhinpH41729qF8r7OCis1MxCTfdBVdNs/pM6yGbQdM\r\nHLDClScglkr4Ohg7FpKL+lWwyIH6d7DQRyXhZhRpSI+FOkqsHoOAnCAQkpve\r\nw+e608LNwau/y2LaiiunSl/6sglWgQsjiDTIS+F+od+Dniv9McVn2S+a6O+k\r\nMim7rqLSTftDd4IlK6QLLmET+QYLwuagshbga91LWSaSx73Ln2/ZEnk9IdLE\r\nzP16s5cRchvhMc5mlnq4ZL3ghoDHocNsgzYkBqTkzctAByeiaKD3I5GivBm6\r\n9UCSaSGK6GX40fYiWuRBK2eUFmbmqsy3khsTVgOvECnwNz2t+K95fR/YtESs\r\nE9SzxKTY/0k00N3SbjO6MEWAgAggeQ53RLcn4TDXD4FXd6AeycAddJ0amity\r\nvuXIjLWVm4w+ylGd0ueZs/IbOVnaL2P1LGoBOeaoGYoLATc4CW9/Dwao+jUY\r\nhb8SRXJs+a/wQ5fRgopHnELCjdHDgm8tEjo=\r\n=q/V8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"88d62ca775f3617dda977234e4d390c7ea5e357a","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.4_1663842858520_0.38667348273950686","host":"s3://npm-registry-packages"}},"4.1.0-feature-446265-l8lelp73":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-446265-l8lelp73","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-446265-l8lelp73","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"623342af18483e53a2e88ebc667d2d747c78665e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-446265-l8lelp73.tgz","fileCount":159,"integrity":"sha512-or6eMGOJ3vZG+xts6fG4ur0V7J/z0mWJQr9aPe8hhZaIcbFcAiGYDCrINQju1osGeAVzHobhcw7dlFDfi5fDJg==","signatures":[{"sig":"MEUCIFUSFtr56ZndhRBiME9cTFhvLgEsCkP1Mmu3VlQOqvtYAiEA9goB3sNeGMhkXDmsfCnoareGrn5bFbvE/GDvy83A31o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNA7KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAMA//dkX4QK3UTo6JMK976zeixco1a7Ygd2FKgFk+j9sYiLeiAX2g\r\nxZYWFR9oNSKk86y8iPkU+TSb34+5KuEVnTUCGI/4HmTHYrYZzQXAV90FnC6L\r\n+lnxlEhQ8Dh2WNr1HLPj7rTh6JSS30aofFUTKWiLoy754EaJgz73nHF0s6Yf\r\nqEM4SAKva5+3DjYWg32xfCltOMH1bAMgxX0LFTk5PuFK6O+/NtnxNeGrxrvf\r\nW6GhePUeODjosrSxyJ+JhpxhYQumDrC/3zHdAC+rTLfzP0Afj61cDalTdVU6\r\nKUPMa969dMuLl9k8uCdATeRkf95DUta7QY54AqXCKiBJnvF7bgWhxJhNMeQy\r\nPa1bzxrV/VBKaQu2VnzuzTEP9IqHSS42PQgPvGKOx5aYZw8FR81599BHRJcU\r\nw9f8Tspn3sq2AhnYIMkw8ubkodpnZ8lmkfPb9Binq5GM0U5bjGu1PWQgz/Yt\r\na0Tz6vPznIzKwubiRCxHSwfPsBWJAwqlfOwmlcntlllflP8i1KEhuAUbi9Kx\r\n7llI1Bc92XaI0xQQ+iSuwtgnAyQSADAoAHr+x/0i2r0dPHWVr0jSSBD40Zwh\r\ntm5lczWIesnuyjoZbVu1Dc08J0QDsgEWPAqNyPVgqrXhaqf3wR+p95ljsGmz\r\nZaGGoocpMA0S6NYvPoDhldYLTRFVC/kgbKY=\r\n=BxfD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"446265e9b3b88d490280bb6fa3aee37ab0b153a9","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-446265-l8lelp73_1664356042073_0.9866126464376686","host":"s3://npm-registry-packages"}},"4.1.0-feature-f86d0b-l8lh48w2":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-f86d0b-l8lh48w2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-f86d0b-l8lh48w2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9e6c31950010b5e628729e219db16cc405728b67","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-f86d0b-l8lh48w2.tgz","fileCount":159,"integrity":"sha512-JusBGqWKuCxU8uLuXy0oydTQcFCrmTqxF1A/avNMpg1XE6uNnwBkI1PNPBq9B62RPuz2cet+CYSTIoqIjrrAaQ==","signatures":[{"sig":"MEQCID+ZVXBkjzfObq5uS54C0ddBZXEiyG5/8fxDuScw6Vu2AiAPJWPOmFjOCwLB6e7XEFwy9pOpgJuvvQFOHmfXt79a4Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNB9MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrINQ/9GVK+3uzAyogOAhmTSoE2lJJToikzT1PqV0d9ILEUfmVYZbET\r\n4BDN034bAb0JxQI6e6MhmIdwBK+bJbEmoWFn/eda0LLyPYONS39pe/MNQa2a\r\n6+wMnGuvmAIhrmj4oZYRy3bMVaupyJMslanLGFI5o3Ff4CLwM+3O0qVtgRAs\r\nVlmChByG+5HSjzn2BmohCL7UtOyBit/+JHvWSOF2DfyHrtGx3qUXaz4G3n1d\r\niBB3N4GYN1iyQPyYzB8RDoEWbd12uiwVsanctlRDpSXCwT4TN/otVmDkwlLx\r\ng6FRLuQhAWJumKjez1v646Aa+MqUwxmu8okOrlnuO54wyxyadMi8+e6VB/2g\r\nDKtsBvIZqyoql2IXdbAHoZ1fXi8jzdND7eHjtABLfytObDQDwSYA33b/MnLY\r\n4cythQnUltjzKnF8wZKelnUGdA/zdEfLRiq1+1dALJysfd0f1LaTfU1JRR+M\r\nOwIKuFX+waKVIThMTV4yT9Qn2MZq5qF2f+O+jUxaqzGx5JNQAUMkQsXsSSB3\r\n6fK978INcVhkDaM58DZaa+upAr3HvhDacMqV5oPrGuGGwpJY4t1qfaXpY4MP\r\nZ5gZldbPNatFM+rwjgqnl/msOHy2TQH7R+e6Wb5QSl1ByYJgZSePE/DI1/NA\r\ny9OliKXnur9+fZ8EDXRqXvBgreLDShVzNIs=\r\n=XHbL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f86d0b56c34d964b43ee1149d7ef516e4e0a31ab","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-f86d0b-l8lh48w2_1664360268059_0.45932919340276834","host":"s3://npm-registry-packages"}},"4.1.0-feature-6dd3ff-l8lhua0f":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-6dd3ff-l8lhua0f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-6dd3ff-l8lhua0f","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"759c2653f088afd037e7f9e6078c0ccd5791a51d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-6dd3ff-l8lhua0f.tgz","fileCount":159,"integrity":"sha512-g3c4GBav/3ds0op1h7J2adFHuLdiTd8uDiTk0etGpsVj39nnblUj7T54g8D7VA+W44yyOnsZOAPW2l4cgwlecg==","signatures":[{"sig":"MEQCIGyj/OCO7UWyeSF5w/3M5otviERiVzBJRAIFDOOQ2QK1AiAV8jYBCOLhfF3f6Gcxjb0jOhAohIbcqWtgZHAS3z6UbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":523342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNCQFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBWg/8DkM8JbRy0KY6nIRQV69bpej+nXEHQxhMwASbLN19abK6JRXn\r\nEV+uuSTGzudK6eSyUZ+JzhxuTbFxWRVP1kOKlBopWjZVVCh2e09g6/lYCNoQ\r\n0Ll+kUjisCujAMWaeEqgPHBvUe7DI/2l7tLXCQs4cvEh+GRHXoVxqL3YNEPS\r\nhRMm/UK8PiiE65bN5au23F2MtdPBl/ZlSZqrDNJKQBtgZ018qDHtdOHAEbsc\r\naMjdxH0q1kLnycT4c9fYefj61rhHo59oLVFHr+wwealSycGoF6ZPllsnO20d\r\nHMxZn1JQMmaVMOzlL1OmVKIYGDmwQN81LVRPa3k8mV0r/do9oHLJotL+9GR3\r\nU+wWj2VWoWRwQLnQlZoSo9YZBgDaaRGsybOE6J4EFUNnHCdb1reAudb/tFhX\r\nWp3qdaCgpJT6H57qx/Vd0ZRkki0h07C5Us8+PVzpB2XqJmGhXeVXOdpnHDib\r\nvcIwhrsGLKRB4eoawVGju7wsdyEVU+WKkpUpy5AKAQtMMeKD5y08q0EjRekl\r\n13hiOjbRVuHP99bFn1rGCvNr1POsySBTohZz4oPzAhvkKc0B+NLeTsRGBZmL\r\nrc5/rOyW4S5prhUbjg+gpu1qCyVrI9tu8GDVsbgCz+fcqcV0/KHsI+XHu2VF\r\nwu3qAPOGfIfeH8HVQ1QO0hGyLRnwQfWOOfQ=\r\n=ACmG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6dd3ffa1417970e0ce2af6f6887fbc30d0f2499f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-6dd3ff-l8lhua0f_1664361476964_0.9897985505632001","host":"s3://npm-registry-packages"}},"4.1.0-feature-de2f5b-l8lillgd":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-de2f5b-l8lillgd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-de2f5b-l8lillgd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cfc07719237243166585dfb5e482b608c7304749","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-de2f5b-l8lillgd.tgz","fileCount":159,"integrity":"sha512-CCH7QixfiyYFdEpZmkkyszi8VRcpWX6fwoPb1YjgNEmikjGZGD1YcMmSdy3HCs+G3sBlw67iH3fLS+gJOKmFOw==","signatures":[{"sig":"MEQCICuqmxGUEE7ea0I3yCNgOMRdBR79Jn8RkEhTxeTScJvJAiB+aO74W4HE3Q9UCMtoEs6Og+r95jmiU/nSC9pl4mjbGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNCkFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwEA/9Eld9EDmpj3RYv/aBoWF3sXc1YNr03dv8CiNV2J2Qjo7UqdEZ\r\nx/ocGnam9ew30q53JSrVrPVFPVpChDX2bz36hrANZui/ttgKqP6h/USEDDKg\r\nZymTDMBviKtCjulpgAtitSs/eYYtPagZ1TVgo4xTz2YYVqCokC/rKqo94lkv\r\noKV8oyPXTyl2U6nxe5u7h11OeLXnOMMVTU1gdljEHtkbooJB7Z2i5CvbK/MZ\r\n/d7VMdckg1+R0eTTZaB+EMCdLT2uEcvAnK9ecDRc/1Bi+Qoa/ZYJPShvRARq\r\nk2ro2agbDgIxNbP5Ttga3B9Z2vBj5vDXcFpXiqAwjTmL9JJ76jtcbQQe976S\r\nBtO8c0fMsalCHataT/hOHsh4QBX7m5nGJpUJ1EsveCjvd4f9aLN88Efnmq4/\r\nOfCwlrlAbi/mu9VQ76bRxRdtvgU+dFVUF5FleTE9eGdDZWZSptdgQSyWVrMe\r\nupFFH2Ysd1PR+RYix/gvgXlaRNPMZIi9ngDTo7xVMjQRBNOB/KQCPCc+QnSE\r\nLstHHZ4URsGSMf6Or8Q+2WeDWI6suQhHA+DMV5wEskkFcBAgBqQ8EMhZfv/7\r\ndg1r13GOzT8G4nu3kf+NM13SJtYB4KARBpDJAIWzNpYq1T1sEk38MHzD8a9S\r\nAojWoEY2hdgrUywjRLn+OHA+v6KuweC4y2E=\r\n=9SZR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"de2f5b490918f5935f704657547dba96bc94adef","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-de2f5b-l8lillgd_1664362756712_0.07203563613300656","host":"s3://npm-registry-packages"}},"4.1.0-feature-6362c4-l8lo8f9e":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-6362c4-l8lo8f9e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-6362c4-l8lo8f9e","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e8287ba191329e90e0b9c617ec23596f30397be4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-6362c4-l8lo8f9e.tgz","fileCount":159,"integrity":"sha512-CNuL0biY/+ql75XY/20FKzaGzKGIyUFuiFa7K+eQ7KqLcwRzQhwnpufBfHEvQdenaOdJ0Wxb6jcWnHGzuw+GxA==","signatures":[{"sig":"MEYCIQDe89b5QlSnS6hhloxxrHBxK+FSxC9F2P6TZQEt+X49GgIhALOWg1Ym0M7PiBR7nYUCe9LMC67NR79hskU9x/iOqkRI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNE34ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0mw/8Dc9TxoxDAb9FKCSeQevzjEq0Ze4DVyFyyGvgY0SKwegZ7WdB\r\n8bXaD6QMFf6yItnAHwGWcvzbavaUcd4Dt98qN4rEe4LLbOLBNr32YhkBnWVu\r\n46FAQjV+MSMEvUtPNBm4nnlDmjkHXDzthQVB7pRJc9fLwQWLjUhJJnC8atAk\r\nLpkRjvZr2VYEuebmgSSBl9ZDPuSxA0b43D8MgSjrjOXQVcUyAeVkAHutzHxk\r\nCHly/Kl8nNyYZUAzt5HKXhN9zUYm0mVm4ksAdH2aiz4GebGSRT1+nGjnH5N8\r\nnI7vIX0OFb31HB37Y/CjETe6RmiqSJ82rENT21ZQsn5+AeNrsAHLmyY6jJLQ\r\npc/Ryd4R9g3r33rSYnXO3EO85AviazmD34cXdTnJ1QAvUhqhaIM6mjIKmwoH\r\ntg9i30MVxt7Tdh9lZHmZEgwRGTuDcNmt11lQQ3pqlTrnZh7AAdxttJ8mzYSx\r\n7rUG8aT3NtgLz142Bznme7eA1dmOXSGPBpg2K1oqu6SmXiuABfrnGEYAv8Ou\r\nIulTIbslTiPNRUasQyqeRWY6K7Pzy7FwEYOfHuiwaajeMTenUlJVH6Wnf6gm\r\nCRCIoOeOFJV261GnpqTsrNzRQsFLpvo22ff296l1j14OU91QPXr4mlWps5dw\r\nUha3BpYkek9xKcSLkWfhKy7u3VAqNbqZ7CM=\r\n=ZsxG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6362c41f0619a34f7ee28136b98e7a7a1cd15d57","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-6362c4-l8lo8f9e_1664372216714_0.7094956423322825","host":"s3://npm-registry-packages"}},"4.1.0-feature-c57ba8-l8lp8km5":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-c57ba8-l8lp8km5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-c57ba8-l8lp8km5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c876a8ee0220ef97c7e7a830fff1c7daebfec3d1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-c57ba8-l8lp8km5.tgz","fileCount":159,"integrity":"sha512-5n6237RTCN4pxAMTzKExg+3Z8/ducitEcX5NQZ8+akPKp+kHGjjI8CuqkQhVYv86QxfOImAWaY5DlFNzmNAoBA==","signatures":[{"sig":"MEYCIQCbLDV5NDc+uUuRujY+L7zgRuX65YuVo1EFYaQXxSVqbAIhAIlq9UAsuC39d070xD8Qzdgih8uw1/cohvuMtcrM43om","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNFSPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpglA/+KgW8cvU6k2E5h7FSAsJWB+SzE8Uw60D4Xj4On8QPTh6J49/m\r\nCptkXzz+MleQ+nQFgSU1Usr87IhSfJNUmEqF+R0A1oKH0r45Zb1UQVE+2vQe\r\nRpEvOBGzFy6awJXU8LNHmnoqXXxz6zuVoAC0kPkT+cpgBSx2bvzI7+nPaDGZ\r\nXKU88IAIWh96JgEpGYSZKfjLSe5mqdsH0N3fdIJNFq8yDIRUnZwXRlVGgTz2\r\nIvfKvKowIIcHx4C4F9yPUJmHfQkTYzT3nw+0xnLZ11fzvJhz0kiqMifiRowa\r\nHLEZgh2QHJ5JfCtOpz/MbukZii0Bac3KPGRl7lOLEPm7CrJyKqmYlqWRrriG\r\nPInQ4tdH2FAmC57qvT3lAjdniu0LGs0tiwX5/wOziIeggLs/gKcvUQdFn3bg\r\nsZoRnGxMo6NMfeYAeMUVCld8pkX/1Y9WJjdVBtlOXzevC/bYpNk0Lq22kmA7\r\nUy09tPK3NgevJIpK2UlUh0fCRLsk1BgPR2odgp3NlabgKOEj1HKRcZQ0Ew4e\r\n7ppvm0EWAYLauHr9lP6m/1hfl5qeODw7E0rJa4uXIjxkZ7yJ8jdoJCRGp5Pc\r\nvWezLWVJbdXsDN3AyVchK4x6GHcSkTgfvuIa+0H4oEi8gKe9HB3UFP4YG7OT\r\nafexy7ZJ5aKUrVqVy+0GYQmlLlzAEtoI5rM=\r\n=9/II\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c57ba86cd4678d1e86f59e7668edc5ffe2f2b40b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-c57ba8-l8lp8km5_1664373903045_0.5634862148304931","host":"s3://npm-registry-packages"}},"4.1.0-feature-08c391-l8lptppc":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-08c391-l8lptppc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-08c391-l8lptppc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df77d4625a84de82bc93c66adac71a2100ba7d36","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-08c391-l8lptppc.tgz","fileCount":159,"integrity":"sha512-GF/Uknsh/rA3XPmW2W1/uwKKHt8HxGwC1ttu2si9/YiEzvPBIDyVv/cd6zOiekMju0aqapdxJl7k4thY5PN3mQ==","signatures":[{"sig":"MEQCICEPxhLrkTtkFUjgxJYx5bfjWhM0Ve4cOkRCPOHWKOxNAiBIVE05YA1D447LQo3EH/rAAEmAzIl8NtCOWCPh/3/Zqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNFhtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjZhAAnWO3xgzPPOUgR2SDckojqqMxDR9xH5P5r+m9eKJkqTTeWJOK\r\ntCLnJB2de3V+pnAjK/tt+tpRSNVvibFRnMHZzBngx281WO42CR9hduX6VYps\r\nQttszwPEEz7XhtG/yVLTq0189ItcSskInyXcmHo1k0V7ZyvSsodD4Ox+wOFH\r\nDBEDLlgx30fiymRddoCML35dWNiixkAXHVHlLPFGj8ibROOqYc/j1/KVNKDD\r\nSfjvRx4H5QEcD/NYvWWP5VZlXVxJyb0CJij/cLLm6lcLxh3LUdAFKIXDvD9X\r\nid/yQr/J0u2KU5h8GNJv40cFapNWBA248gmzWKUiLuMcgG1/KdSoHYy63lXP\r\n4HbA2yheY/6owCc8Xexb78OtgNzt5asPV/E3JxXG9PWq5TpX3E7WcNrq9n3B\r\n6ef1Fpgmw8TGU1jEo1GQ/UqKgF/1Fi1nuI/IgvIN5NA23AswZewCpvE9HHGt\r\nu4GoilbBBlbpXvCoLiemE8vxGHNZ5HtCN9yJvIT2PGAw+XiFWQJ8RoeyqlwC\r\n0Di6R6DfxwqJHWAjpAug+03OQOg8ej3Ff17O3GFUp+yfTzKRlRkpx/0HRkhg\r\nbyZFToYqQQOPg4LwWftC95mCPZA6ieR63xr5Je/xfNr6tyrCKUylaOtbRs8N\r\nCveJ/Dc/T/BkS0eKjnvZWE91flr8lXESuKU=\r\n=LUKb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"08c39159e5552c562f9201026dd12b408985016f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-08c391-l8lptppc_1664374893105_0.42919870870015586","host":"s3://npm-registry-packages"}},"4.1.0-feature-54881d-l8lrg8qj":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-54881d-l8lrg8qj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-54881d-l8lrg8qj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bbee22b2e89cb4de7eed84b363805c45ce1d9d8d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-54881d-l8lrg8qj.tgz","fileCount":159,"integrity":"sha512-QSD4/a12TToh4cRB4342dgLCSyXm37wvjkl3ucKfTn6hnili+uFrQ6jOQX0/MMRqEeG6zNSwH4Rvkal4kCHIUg==","signatures":[{"sig":"MEQCIHo3jIDMr4Bv+lPyKe1vdyNgxdy8Ut3VF6wxejFgY6LgAiA6ckhyR4pz1x62LCOqCmw3NBk8vASuY6J38BlWl+sVTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNGMVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr12xAApItYwXFkIOjN9PMJBJ7aY5+8FxuhJFpUvgCrPPmfcZjK8gPU\r\n3EnUngQxPgf2OFB39ej/28koefrFlGwFhWaFJI1/1CD6YFF2JtFtcPHwQjtU\r\n2yw7GffJBSzhyZ4e9xv6S+OXRjA5hFxtUjVyx2X50tHmSfHgVJFmEj0xi2Pd\r\n2IX8cByJcnNGPdN1wFzMvrXB0dI/y9dJNCFSZHltFU0OGQ3Ht+MZcruXQ60J\r\nQuKEMdmwIjKY2qXsiJ/Neho3xIV6w8UYbVaqQ0BqN5rYOjO2jKeFgzALMz98\r\naYenCkDvHTAuYtWVC/HELEmmsUSjOst+7k362kH4w9lIBxJu77tl7n/8coLi\r\nuq4uMw5ed4F5+MXPCPijvsPVT0XdanlavMLFPdi6IXgKzNrv8a8yhxdBfKQu\r\nOKLe0igekcddmsOqDFOxKne1+aZ6a16G0LDmw+0t6qwhEt+y5ciD3qi4My4b\r\nKGWYbPa0/rO7stP585Aksn7p0Z4dvA+8XISzFm7VPZid1OPSAe8J3bCj3st3\r\nItng8EhznbhSvBvcD71KWFBkMXqI4GaBHMkoY0rS+pwHSE7W6Pw73YX3SHDe\r\nRXdY6/xW0d9aJoIxOubc6Zsoi7zzdoE2itbTXGA3SJuAE3IqkKGPRWqWEskr\r\neTUORPTmqIMMiMN3SlmsxZY3Sx9y92E0gX4=\r\n=ZJ8h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"54881d30ca7c3f6a79303c741a142a74664da032","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-54881d-l8lrg8qj_1664377621421_0.9983770332879003","host":"s3://npm-registry-packages"}},"4.1.0-feature-388d2e-l8mtzhfy":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-388d2e-l8mtzhfy","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-388d2e-l8mtzhfy","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"139db5cd13a917c82171692e8b4afcad0552056f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-388d2e-l8mtzhfy.tgz","fileCount":159,"integrity":"sha512-K+6VAAmA03Blh6G+9Ex7xc5bTrBeHMMuuUf7QOYPr/DFttrKyusQ3e8jvaPzjbY/jyHEoB15Qn+OypiOqy7oGw==","signatures":[{"sig":"MEYCIQDcghyjI9T5LJMVDdJBMpH1sETcjSQIBD1qgWXHFn5ZCAIhAJ+D7KbDS1v7BLFqhO8wFqbbEQWoa4U47VGCS3wKwywt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNV/lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAOw/+JmqrKc0VS99axf33i/6CgL6hfsxsUDq6NJj+ebs1EAKSrZyW\r\nAxtfEVSOY9Hu1FWdhT159hg/jYc3q6LvljiypKBdfYE7rkfRUKtBWmR3sROZ\r\nA68SkyuHWioX+DsssUCB/DjZhq19exfQUwLx907oGgWOJXZmWEK73mdbHT2r\r\npAqjIwT/qs3jdh9fEpPEjL/kYFrB5pMkHeYTIZUOq924accwege+/I0PAH0e\r\n6HIN30KWkobskOUJSEggjL7VQOi+459JAagMbj0IIYfU1yjxE4sENkHDgiYK\r\nCM87HBy19a3G+1mJ8+/fzb/cgGZ6tj4IysEJYYqYAW1sNkK1eweUcJ26mqFK\r\nhURZTfbKJ6sngAvNhHh+Gid97NKNZxLYVNq7QASsJv2YNXMPw1u5Xj0wzs3V\r\nXKGoR1XP0JbrsfbfijBfyoAMQhCsnh8dIcuTMK3XDKroKQ3MHnZjK67CD7Fd\r\nM5wBWF5ilwOqHJf8rSQB/insqoSb4cEgSiDfteUDyfDK4iXAslPSNMQOM1f1\r\n/S73XwRZSiGawdCX6Xydzm6isQ4Kwh8JNJGTQvsQf/uG1FMahhrGvxRLQ8aZ\r\nIgJjMAry/lIdIuym1KGwoyhqAwJ17CMuOGgtqD5APQtjQS92FojbXEKD7DyT\r\n9ira8kPBu3wiJOMcS8iqbbjwv0KbdocpZsE=\r\n=Ol6y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"388d2e7ed475c7b7df3e8744f6bf3cfd1955497c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-388d2e-l8mtzhfy_1664442341434_0.4425673353738233","host":"s3://npm-registry-packages"}},"4.1.0-feature-13d355-l8mu4zp5":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-13d355-l8mu4zp5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-13d355-l8mu4zp5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cbdbd1f16160feaa5c69b62eca37acf86a4c8706","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-13d355-l8mu4zp5.tgz","fileCount":159,"integrity":"sha512-fKhyNVlQZjC54a6IXOqhNdzYAYLG0sFqW5MPFTgoh/msuYHVhEclSh3BkAOOCZRiBVOWWrpZ6lej/RNOTtYodg==","signatures":[{"sig":"MEUCIQDAVQUVLhyhvQJvqjyIIawNJ6arZrdSUV0I3nmRTN/tcQIgTKZFH81Fefhq+oROH0xQRzQggDIuycbV4F98XyLWEGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNWDnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTexAAic3VMGpW5FKgYlKi3JVvdKG+dyLyk7BEtQK2kaYf2UMHKg3y\r\nYAxqw7WSawLCYSMOTy+B6JvQukUGbNp+5b3p8L/VVbz/d7PxHpPfsXqbjAZn\r\ndnDHOKUIPDJ4u/ZU99dbBxL6Uq0oOEXBtEAcUQZBZBAqerKKuXVeQi9KKWTL\r\n3Y519JYli+0KUUTxK8azzSC0cDPxspDEFJbYXqvBPIB/p8yHFJn5TXv0TgKm\r\nAqjhXgaerNIpMfb8l2iqRRES06WTUAa7j09qqQIMLxtjd5YVQuwdAhpjwyP2\r\nB3WECk5/ETR1foG750U5S6pQ5BgMFnyOyxb+SSpngPM6J5eyTi2XJz0pYCor\r\nOUANiBXbszT4wjZtIsdBiZHnh+ErHi+PcnvnFXOxMKOmeZsleNuo4+QhAjp5\r\nl46wxmYoY2icWlV0xlt0ApmE3UxkfAF7TZjhuzATFnSi0zedBDTg4YNrYyxp\r\nSj5HenN8x+HeffRhTp9ZnDCXym9clLT3vUhzYhUjiPKAzMUjrB02hrUN0lQU\r\nClv8GwLHiZrCHljV5lOk7l/C0PbvxCZL/IxtSR3C+R54HlK1GRUYVtS6pEPi\r\nl2cNXQvBYLDC9vn71SV4AYCiQsIMi1OcIGqn59I3won/IbRRCw7qDx39j1V0\r\nolJtmvDGXoYBJn861CpVebujVtbnU4MoIn0=\r\n=g7cR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"13d355c8ad4b0c5e31f93cece53a05f35d3dea0f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expression_parser_for_extensions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-13d355-l8mu4zp5_1664442599634_0.7339105382469635","host":"s3://npm-registry-packages"}},"4.1.0-feature-c41be1-l8o95qmm":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-c41be1-l8o95qmm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-c41be1-l8o95qmm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7c21c96a4fdd434f886969149a6ade1b9bf63525","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-c41be1-l8o95qmm.tgz","fileCount":159,"integrity":"sha512-B20A+QwL0aKKTfo04w6mI2nXU97yMo1pIMs16VB9vVTpO2sBwPXiuasoMLl8GsWo/BZJDTDhvK5J9Oqz2aINYQ==","signatures":[{"sig":"MEYCIQDhm+AiUr9dFH3yeM8l8iJoMgCdpJwTwR7+VcwRdJPUBwIhAJIo2Nro6Oqij4T1YBJbSz5vC5xniDAV9mYc17A6IQ17","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNq+rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmod2w//Z/L4DI8hKK4EePWiNoS03ZqORAc4lMD4kujqkL1pWuqT5Vph\r\neQjTVF2+Y77ObaFBowM0CLQEZXZyNbatQFVwqAWmFYEghwFNuND51kq6DOL0\r\nrOysSdWH9pXk/RV7QbNN3anpJyqrBIA3NfqcT0FjnKjwcutGZB8k7SqzO4Ve\r\nC+TQCYyAxHEJpYC09lXD2AsE1S7c9LV4XEZrYTHcLuonecpmwIYcsvtsz28Q\r\n+kP7AaWyssWDtHFg0Z+BETPNn8GvVJJBSt4guxlJw1Cwxg+9q4WraAz3CkZt\r\nx6q30hrmJwPagf+RqSxCeQW5/erlWN4jF0Mz/5Vr0OXvnxIx08tXbwa7rWWZ\r\n3H2QZtOr7NP4B3KH4nZyTIJvT9FhQCMbvuQcEeBruyv6YZCkWPQjm+wfk/cz\r\nXwumjGZOEX1bkBFSit5h/7HYssevmdYENOhk8yo5y5lKbbCk91ePgoOVX7tA\r\nDS9BLgcAdYVOHAcilp04eyOuifHETcWy8YnQYz/Qu0wPOao9GqlNFvRYScbk\r\nASXaZmgSAe8pSvqdurzfQS3rUqjzWz36/Csz+w744kUDTWzw1UlDYkd6hoUt\r\nmoyKfbm3LD5q8OkHKuWJbfGOAgNVLF6qrYZ1YNH3eWhvkmkCIZHgP0lb1Z0j\r\naZSW3wLUDX57dUhEGdUUWA7a9ApcmoPD1D8=\r\n=B/r3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c41be1f394207fc125a6479ac93de35d36d243c3","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expression_parser_for_extensions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-c41be1-l8o95qmm_1664528299076_0.901765479565243","host":"s3://npm-registry-packages"}},"4.1.0-feature-647e58-l8ofvqyp":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-647e58-l8ofvqyp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-647e58-l8ofvqyp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f9cc3fdaa77256d24636fc23a729566ea74d7fdf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-647e58-l8ofvqyp.tgz","fileCount":159,"integrity":"sha512-HAeePAZjqs2vy1NKELo7AYhoAqclDVT4hPdkzS/dBAlJq4UndS75fMQv7QFLNbJwXS16ItLOo0vJtsPuxM901A==","signatures":[{"sig":"MEYCIQD1nFU8xQ09WAVkVgV8SNE7B80Y4APuS+svDD4VIuJ+hwIhALtDyRpHshWZz9sH3C/rtnEmEKm+ujxnala6GNWky20Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNtvJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrk7w//T+c3+P5WHsyoTw3cYM3Zh9Xv8pjtQ+ndoojiptCI5FTZjq59\r\nYWfZm21C1ec0Lc78LPeS6k3UbVU0FkzzfAtlFzwpUWFhdP+4QFGrNb9v8Sfd\r\ng/8YRqd/WJq/n7jxknMGUvxIJjIZO+sfdU9fLxMuA/VhqQNifz43jfTMy0Hg\r\nax0prWHIxKYX3ObjA6D6PuoXQaJyMKn/MmC++xtrUE/lHVRyNtaxcNJ5Zwwx\r\n221n2S4DpML+9mDVF0BStvfhz1kVOUcCdyYiTNnQdVkWdZehx+pmCXbxe5Oe\r\nB5n5yxobA02ivzAOnNNmacvJnjkqANd7Fmrg8919fr7dj9dEQI4EGwGU7nMl\r\nFz4jWV2O7POkXLg3gRalLRCMWrbaQoNvGOOA4hiN0ndMcE29fHncnuCZ9xkV\r\n0KzgpDZG/EBYQLTZ8QQ1BbLyOkC4yuUSBbz2eK91IwAxcfju3Kr2YFg1z6Sb\r\nLYhV8dYNdbUlo4peSM8tIIyGYFBDT4jG8OtdYTzXbDptyfn9/3HQBz6hSyKS\r\nTv0fRTb60pY+xhJG0oq3Qrg+u+TSPFZaQelgrB/ajNtFgY8usL9xbcxxDpi+\r\nZ9qxlk7y5tVcBpD40sZFoBC5Rp8jm+ywve2C+oKp2dEzfjtrOYCWeSy4OGY3\r\niilhOIyU31Dhn4cjWIkw9pvUiENFDtPce/Q=\r\n=TZQr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"647e58122607cad8e853045fb6324b7543d473ca","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expression_parser_for_extensions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-647e58-l8ofvqyp_1664539593141_0.613852886528095","host":"s3://npm-registry-packages"}},"4.1.0-feature-a79d1d-l8tyk69d":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-a79d1d-l8tyk69d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-a79d1d-l8tyk69d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"719159a94ed13284c99fae377c07c1d347c49239","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-a79d1d-l8tyk69d.tgz","fileCount":159,"integrity":"sha512-/j15ajQphzBfkr8h9VNpZ42ac0MydQhDdigcE0AR3zzMNli7+b12n2SnEAVMdvXoupWC5vmkj7iziKy01KOULQ==","signatures":[{"sig":"MEUCIQDDVYsIkWp26HNDMjwo9QRai/PWHtq187Uh8uuRIRONNgIgSmyqBKediEpeK9C6YI+S9B+3rfrltbPwIx8a0lJ36KI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO/NJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZkhAAgKEXdk0xNvMs1YUQ3lHHjzaFnDNks5nfkffKASF+aXqi9ygJ\r\nnJQdAFXBig4U7x9yR4gr3JJ3f2eHtbIBLTE1n5vcT0edCnNeoG0K2F7z/C+3\r\nhccK6e9HCsZhlkN//m0zMSMkAeUBk6Mpxr+z2TmaWMI7QwrbuhTyBBiJQ5Od\r\nj70SOEa4CBzxTIHV3nc+Ysjdm060bLd5VOKfkpihZ14eSnZ1QyXVFwxxI2HV\r\nsqY/xiflDi+GokzpnwZMKzMjs+Vfg5FZcZ5ktkOydQdD6k0P0UuytaGcKP+q\r\neiUI41yo6Wq9J0V25MrkVns4W2bn8Z3C0g9XMfkcxB4vdW0wdIp8iJY+tGyH\r\nQSC2TG+PB1CQwZUL4xRNxkj2xU1dmMJSk2c3NPFVNhod85omgT92U934/VVS\r\nESm5p3p6bjYbEqui0meRnTcLfFqMxIm+zDJ9ONTXc5JR18TYBSQAQJnG6Goc\r\nG39zMXjytXq9uS/9FL4TWGYPaUhjjFy1fBq93Vbq3ux1kA9S9fX4fUcGRwfw\r\nStxic18JPTPNWSnxbtTv08bfwZum2XppvyZVqpEyGJTCOrLx6GzjicO/D46x\r\nQJHp7s2nx7N0TGV8Wq4z0Umxsedg5Ay1Pij27g04gOwPei1mBlTEKHazp/Ts\r\nQ44GreqDFlyNUGDuGOCOZuFA9YjlaZV3FgQ=\r\n=NgR3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a79d1de7d545eca168e2de341013742bdb1ea434","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expression_parser_for_extensions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-a79d1d-l8tyk69d_1664873289126_0.6741690241242657","host":"s3://npm-registry-packages"}},"4.1.0-feature-bc2a6a-l92k2gnd":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-bc2a6a-l92k2gnd","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-bc2a6a-l92k2gnd","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0f8a88dd3227cae6b44cd692ac0a581387f23bcc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-bc2a6a-l92k2gnd.tgz","fileCount":159,"integrity":"sha512-VXDF+DpvfHlreU9Coj/fn3jTloC4OlFCnEsAlzdQVHhzZYT0SFExMwm1SH+jFCaBrM1YO2KCugXYt04JVUy7Ow==","signatures":[{"sig":"MEQCIApu0E/ruuhhOvznygEI3luiz/8xPHCFozKWsz2C+yiMAiARMdrc7GQVI++7jyLDnVERsH1iK/dTwlG2lmsQsmCmMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ+H8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5Pg/+P/60WMM/iQOjAsealN2NdcdwTnWq/uDQZR56h4mlr7sUnkKf\r\nQyJYWPFW412XNzpA2BLCAWV6kIbF9AVOHjDw5igMyc9cpnwIkFPCePhxmpUD\r\nGVg08Lvt9N67Ail4n7I1UZlmen+4g9pgfBTvBlW9tJBlwxfVAuwvwHI3Z0vF\r\nJdgu/8YFiRi/5OdwxSMe479LGGvk3r7s0sUhI08Wf+p6YT+ODKy1wffHnncR\r\nfdSxQaDlAtYTvm6PiwCojF2N3591q2hyQ78ZImn61FpIsBAAv9eXYxnfeVKN\r\nWUMB/KcIc7lyHd9kHd8hvuDJp5/wAbz5FEsW7geQk9kz1wq4TIST80GafzT3\r\nZst4igqGgcnd7pq4eBaRegiGFpQ6y8Kb/TVxgwiRL3WXM/PQn2dLvgIewj3q\r\nFOMrS8xyCokj1X0cOlWxwIeiAEG1RAgm4GNbjpFsczzCENDhRYOp9nKT2m+4\r\nsyiapQJQYz+VmI8iB45B5uLRtmrLInw3KhlcGdB+9/fMkHf5FGu1XVc2cUSy\r\ntnx7PZV8PZqcENCUJr7tU8hyab0ewJxafFwOWmrIlyUEdvqWinF+9H/Ly/nY\r\nUHyGOA5yTozViF7XGjXiasMq3aP7hsN+Re1HxLybjV/6OswFRSVbHp7BkLQg\r\nsfN09bgJ9TjQY0lJ/IQs53dyWclAOpHmk+E=\r\n=I1Pc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bc2a6acbb24dbf8fa30ee4963b79a64264950e55","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expression_parser_for_extensions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-bc2a6a-l92k2gnd_1665393148135_0.6429720190498589","host":"s3://npm-registry-packages"}},"4.1.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2ece6e3d602cc77c77f48a3b47e408f40713109b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.5.tgz","fileCount":159,"integrity":"sha512-T6S2GQQdGwzv3IRHE3q23EXDzBZuDEDXcChRbNXmcHrcgNXOSVlToOkw+jq74cweEdx7SYYk1q6uIJWU4nRY/Q==","signatures":[{"sig":"MEQCIEPcM2JFlfh2JPWOuFQea9MBJUZZyVZxfgVA/mMB5C6lAiAzoLPxqQ6h3bH6I6RW5abiACcXRu3Bwz2pat7aps0kQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRBelACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGwg/9F66eqlLd6ojC6BDxWJdv0aMvFoKJIwximSUcCLA0648Dsyfq\r\n375WGmWfdv6+b9I+OVUcP2+Lfeo4aeub76qdSRwaeC2oXs69olPZSxRlb1Pe\r\nTX2lAP7OVXNihjfz5OeRQZjo5k4PPWgHcd0R2+PiVBhTlA5auAWL5Lzsx2ns\r\nV34vWynCA3IJFV3B3sYnavnb/ZbxhfgurjOUXRBlXSQnCyRr0H9ftRcxeiX4\r\nopkPbtjivdwrLWkKQbEeVGnOzuxuHdRDhWF8CCbjT1c9cLG1Ou1XmlXtNwYz\r\nwlP6LC9cBqiuj0BjVCJVf0xQLt0M7/0u1iD5qHpK/WnKImzyVz5HduOe5sRv\r\nXvDSVPyI2PIHkzutgN0trwfvqHpyXdXZb/K9b7vvYxuZSzzQYnGdAEFfHmit\r\nkOgjuR/EVuswuJR+lJgeCAIHbImcah/hky8QQGOs8XddzMRLf+37svyq+HcQ\r\ngwAjm5knIJWii8eALrq5FtmpP3enZsX5vtrf2N2SqAIXItPFDSjz+yxTYvH7\r\n4TOKZeJOGz9JspnbYVE2NWhrxKMjInsHB7i6LdobaV8LY2s9u/unt6EMOT4G\r\nv3YomtrjAlG+w/fx373yET8UOWGvZ9jeYuNgkHjlGA3nYMllOsZaXrrbkwt6\r\nFquiBMfW5SgPDd87Di1k2qS/730D9hNrWSA=\r\n=z2fM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1ff9f69657b24620b1820e4fc5d86d612f50b719","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.5_1665406884991_0.07546969017517657","host":"s3://npm-registry-packages"}},"4.1.0-feature-7de74c-l92scbkv":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-7de74c-l92scbkv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-7de74c-l92scbkv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4373e5974186cd2e4abab4b9692a51d130ed775b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-7de74c-l92scbkv.tgz","fileCount":159,"integrity":"sha512-6cAQigkPnysDBUg6MqXamk7FAlAgZgUYyfyrPrE+m5lxRGGOaiIfjeYmM2T0nqccOAlZNbsJNLGo+T+Uxx9Lnw==","signatures":[{"sig":"MEUCIAhXyQhCf9K7S5yf7vR6V7aGZ2xW5vhZKenAga//C6+wAiEAsk/SMyBso9QuTaNk/tDqYVy4G+9DlLECSCVICpQ8ams=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRBhBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0ag//b+/9sNZAvP2vMnP9rvrzm54H6YgUFcWyr0yIaOLS5pbSKugV\r\negn1FwGNe+2e6ZlxsQkzhILIaSVcTAZHY8O2BE0fwZINw/FXjz89Uuhgw7L0\r\nBmLcozw04vyEXYQoykjXNYoucr8IwhdGZ6UWBrBi3lFL7xMSb3Y5OcCNdiqP\r\n+eQ+5hxJJB2eVTsYttDXKQdIY1du/pLo4aZ8WOZT4iGrJhtu/IoH49WnIofK\r\nDxCBEsJ0uYmnsKb1ya8eUBWP2h3oR/dUs/lNBwaC52Jeg4AJSqktftLnsrMR\r\n9Bx1SrZqQ8x99ytuom2JoceohxuPuBFAqQjHXkz0vo8li7vWvry/NjxAUoFH\r\n8iUIgnA9uk11Wrm7qGk1E2QjiC99xilYIciMgITF5NOv6ciYLdfHdTmf4tDq\r\nLzTBp/Ted/rEoRZ+HuwFCmAhA4YOwlL/NNhYQUZ/Ol+rLi02rFC6qzZjxPUp\r\nPZAH+Z40muR4ICw8qQlFz+vQh2bfo1qGptZW092tWOI1nl35GNvcGKWyL2zg\r\n7aAhJTJxQuywnsZPtYX+qBHbR9l4hJe1jrohhcvC/4IJkjbcgPvEq8GFMixa\r\nso2TZPCNeCDY60RIxohx0PSfa81fV5jIorpFCy86fQDXF2/fw2KscdrXOQi2\r\nUe9AbI+gVqQ42NxSpgMqsZfyWWYETtPAP0I=\r\n=iarV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7de74c1ecbc399e2423ed6a34b7bc7bdb1a663bb","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-7de74c-l92scbkv_1665407041117_0.5729524655211453","host":"s3://npm-registry-packages"}},"4.1.0-feature-f43890-l95b6wmp":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-f43890-l95b6wmp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-f43890-l95b6wmp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8d3c6f1c1f5baca932c59379bd2c6fcdc52c85d8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-f43890-l95b6wmp.tgz","fileCount":159,"integrity":"sha512-Yd/JWv+XqXedzKk2bt491vBBd7MA5LYDKTVKWir1AvQoJHf8L5arD7sBgiKS3vkU0uo2Iq5DJLOOor6X59Bfxw==","signatures":[{"sig":"MEYCIQC6RkYi6vPz/iQLCuObM+rYtjBDyaxYMKRxGvYx+2jjYgIhAJhfSI5YvutNGlgBnk9fyIRnYl3uXfJWJjvW2xNsO2D9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRmxVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFXA/+M4LltRtxmGtm5ZOzObNtBnqFQbGjVUHWSt8YIlDwaBtVFUdw\r\nPdi2AS6pGxPBZ47Qi4JtA9Mn2uUX6KWz+I8Vr5mm8IfDTAIwrMQxR2X1brjK\r\nrMBKaLJMifKDIUwx1YnJuHpXryj7yOuksHuLqjmtkhwArW5kRyOmniCORdAh\r\nUEr8gZLkM84lwUoPKFeowKkB2EaH0jlqALWwNoYaBAipwHx5abwtODOgqZJf\r\nAmkOcbjW3cxPjG3BIEgoqt2JhvirucZ3bO4S81mOC/4t2VX7oXjkx0IG6Ifx\r\nQjrdJG2WRJaNiZip+fwgou9CAuGUgkt6Y3UEfasCRhNvdcX51Q4AiVUkpySI\r\njUEVc/pwXhcse0jxGKVCppNGiA/tyTN/bpn/GbmkwjWjrvwAcXXVOXsDe5vm\r\nBEtA4AbxGfOA9/aI6ISyXzEh+aaePJ9CXiaBuCKxwqYJDEHNtSunfcl8QlQv\r\niJT/OOQfwQ5dLALEl3YuQwbkYVjHX3/wOO/bAlBuP/6k3qJG+sDxC986Zrf3\r\n7uEDz6MMAkptsOb8Iw3mIbe1b9edDdrrMreqvmmYjMLqNezLNQrv1tbaT1ul\r\nlxtQd8ITl0RjljqLxFziY8MQVzCnzyOoCL1NPlFnuYFmEb4I/STo2Hn8xNZ2\r\n2+FmTJOj84huul3TaVN/NF4HhKyFwAoYnCk=\r\n=cvU2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f438905c1f1efc3c4f8e80544d92b0b6f9574388","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-f43890-l95b6wmp_1665559636739_0.3139359268087758","host":"s3://npm-registry-packages"}},"4.1.0-feature-774983-l95b7mtu":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-774983-l95b7mtu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-774983-l95b7mtu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0463f276dfdef687afc4041310962ddef72bd4a9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-774983-l95b7mtu.tgz","fileCount":159,"integrity":"sha512-4yXRMmJfjr9eVekMA93n1CORA+4Fct4SbeDfsMEYtU1U3/xvfg5nm6Eklp1fYELuz7xZuLxkR6K4xyONK+85wQ==","signatures":[{"sig":"MEYCIQC1SF8Ya+2KB5cs5Miz/w+vAMA59+2mwFZeoVVWFTw31AIhAKGrKeX2v8zbgOwF7XStduXA2Ae0rBDnNxxKzFhoGQIa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRmxzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWchAAjFUsdPBd5sf2fk3J7fdpI3TepeCkv9GF1iPagyYrrx0dSpvA\r\nd/ltm65RIQXJZVqL46jpeJ7C3i5DMRKJ9GHO6eHv1TFP7SzSAXZWpQsQQ5sh\r\nw9NXdN1gMcxZ1GYXX/2SGjqt8wLaMkOcj3D0OdSBGQm+qviqjVnwt0lYa9qy\r\ntkorYaj+5xzPVMi03Or3dTcYdy//yArEmUDRQIBMOgOpk9cGkWaN+74WpnHp\r\nA88Bk/QCuYcDRPcEVkSDq2AQoE/n63De6a8a55DDpGLVxAuehJ6nntWN8WAl\r\np2MCHY7KeuLCstD1r3trIBpiHReLSOJ+4QVzkqXoo5lG9CERO2UmU3N1adbx\r\nV1hKlLnAO2gKeWVjFuno3fd0PBzZc5gDtl5xySTQVco8FbTwSW3efmVnA+m+\r\nFWFg+BQEzuE6Y2IJVnIahf0qdBqE+NJi8qz+y60dIEk+ve1Sz/gCUanBB+DR\r\nD0eGWDSXuZJ2xFB5ms5BuvvW+6LLExzw4iKDsagA1n9E9ZBM+DIEX4u6BrJ9\r\n+zMGZwbQWRcyWHefhMqptAycEBRq8q15SNDfGT6dcqpD9Pd9TKn4Soaa1WBS\r\ngqYl24ZPhI+UtOVR7NaHK2ySVEJqrienZiHn2l/yad166htT8FvaotkOQAmT\r\nIzNzST80ptmWcUvpL08WejHgDvZb+EJREPU=\r\n=M8Tz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7749830e71909bf79eb8b5d9243616c066facd9b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-774983-l95b7mtu_1665559667449_0.5553039852968034","host":"s3://npm-registry-packages"}},"4.1.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"aeac8d9366b90127bbd5879380a12ea99dfa27ed","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.6.tgz","fileCount":159,"integrity":"sha512-9C4xk0qNNofttIWz931pvnNtRnWonJZnIfr/AlLb9TW5rKGCncxuPvnykarATbikr4lO2yQqokX5m9GqU5GPOQ==","signatures":[{"sig":"MEUCIQCfHpZr3jbUFFPw871W92FG+Gc2aQPvK88jE/0nIWDj6QIgB87zG+8TkDd0kuVho3+G/Bc3fwxndbDwSauaUzklhdE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRmyiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkJQ/8C/n+BQJJRdBGumnofC4+jHd/j+L4dgzsRBcPWjKwMP+EF9fF\r\nbBiD4YhWbEDsc0T2P+n12VUV4Go3klNIh9Abbn9kBn5s5ktea3Q9uYnEPEhb\r\nDRJN0OJBfZeUjddSQ8Imoh6Ycz/IZ/Mo15kOeLbdrXxA2G9VSkAicavMMksm\r\noG1ghs8XToHY3RiADi1LNzogTcGvjnmzl8r2IlcEg3SqAO9ZFAdue1cCFb2B\r\nTHTGE3vCswylaPE1UMDFYROz/Q+okqeAI+LaersAZi/IbF4vNp5KcnGxjvvg\r\n4fsyD1f+wNRjPYYzDPfyiN2jnP4T4jP1xfCPPcU2wrnAKeQaHWm585SRSMhB\r\nojJyg86KUQL5eajGcGtMky7XsukEA3tTRexA/GiBJxpf5QQHy5wXkBBMDN3y\r\nz+5nLK2OF9fm5LvGpCi6QbPVSLgJBE2fbfBiGxCdOetsgvaqGe+VEAw6yoLW\r\n62TK+6tmoNMUwrAscAP+845dzvtIUm1+wsCwSCmb+ghN2lPjN09iu5TNwobX\r\nF4kv+RO/EWx9SlHJ1sudG0FOQX0nQu67pm5l3BTFNgWx1AmzY2P+6O5M4Wv6\r\nL7wXCm4KHvmEanzcrmE2zBhhbck0eJkd4tDwig/PgZ66MAak7jdkpq9PtMf4\r\nUt8yCOoJeqB8NS2dEunbVOuCNB+XdZajWpM=\r\n=SFMd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0d0d1f61c6b0cdba4cccbf4c8362f50af3a468e0","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.6_1665559714210_0.868777826650788","host":"s3://npm-registry-packages"}},"4.1.0-feature-86badb-l95bcla4":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-86badb-l95bcla4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-86badb-l95bcla4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"91a8600b63ccd440f38bad7305e58db2c53e0127","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-86badb-l95bcla4.tgz","fileCount":159,"integrity":"sha512-k83NowLmXQ5eHrswo8+3FFizWVWtWanEJDjV8kADtAic4QfP79+ZGbXXNEPyJf0K5BMrjHtresYvOYbdgOtbzw==","signatures":[{"sig":"MEQCICJFDFw4kR6eOLdHe3akEH2jn1XNCTa+Adx2WHDcRGNMAiAmHT336EsvsKYT8qwN1aounJJMRVve7L4vgZKRt9fAlw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRm1gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptXg//bqnQhA1YQkdy1Dv92ZctMB2HExyjBZ54xOTTmB2az3zlKhCA\r\nuq3p3VjBegXJxN7Kl5753A3Z4Q5SjKHXcNbmiTvAA63DGoUCnlRCqvEAv4dC\r\nSNcloUqL/gL0YTMBKTzh/YeB6EIUFTKifpRwlSnX+U1kxEutvsPzyN9yGg+b\r\nPMBqIycf5O8STtk11c3x/n0716+p2v+VnZ1rAeD9qCc08qofz0KOIKPW6mi9\r\npOMtiLNlny7ucK4JcvrdfBJ56zBsXfY2FNbFJrfSZbItI+bNNyk+rg90gTgD\r\nre/JRL06JymTTnkYVeCNh2Ze0A0YtETkgewN6+tiXwpNrvoAFplVhOtdbgfV\r\nJlYGVFkikoQ92uRViAtU8wsev21jPPgAhL68XMzgRXvrZ31j7ng4/MmDysmm\r\nFfVgQzK4dyPtCp2axwmbl/2Tgr3FrTZZXGjpKQpQmpVg/XzRNLjVykhn0F2j\r\nU+ooMmFtUu6Zo5uENK70nyLy7+LHz6BaU1Ltw46Rjhm8bEOqaIhT3TBQ7dDX\r\nPm3UW9WQIX0fICwDwThObNLrKtAL3btuj7snln5F9XlxDDyDGyxCD374RB8k\r\nYIOqjgoPOC9aXuJMLOkLu6fkeFHP7+yOrQoi+la1TLP+FKMqlWU6orQmq6M4\r\nuZqg2dxzVKSTyOQGJbogaxo5Qzd0jzYtHz8=\r\n=qZfA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"86badbdd1e8fa3641164bcb866abf00251d7d4a4","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~attach_payloads_to_send_tasks"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-86badb-l95bcla4_1665559904299_0.47373915590137394","host":"s3://npm-registry-packages"}},"4.1.0-feature-9fcc1c-l95i8zk5":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-9fcc1c-l95i8zk5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-9fcc1c-l95i8zk5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bcba1f774b74dd96a5fcec3668efbf4d0964d586","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-9fcc1c-l95i8zk5.tgz","fileCount":159,"integrity":"sha512-R34S0jO8kKHiXAuwaGJroc8l0xdqYFZ7/jEq5xiToUETW8QDkITL+S5+4oreEx0CW+XMKHcWwS6qkYG1ZSnY0Q==","signatures":[{"sig":"MEYCIQDxsEogbRsWt0DwtavE3tWfUvdfCc+qtNXw8THLjl1vuQIhAMkwxq2Gyu/puOVoxoy21RrBKSBJ3NIxHK008osucGng","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRpqgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDshAAkQqaQDDIt5fA3RpOQVBOCBk6+59rPjJ/8q56e3aJp6mscsTq\r\nREq6nISWjov6U4AO0e7Y3nD200Fca2QwYvPcCh4TwLlWkHBXUjBlAhmqNEPV\r\n8VBMgHdLYc1pzY7ajh2wmtRKRqi9jyCzr4woYH3qFnPLVow4w54eTwqXYYS2\r\np5+z2IJEDsdlpsxBBLfWNipxfI/AFzxsDIKx2BwSwp382KpUc0AcYZITYLUx\r\nGHlgzKENd9ZXhD4CvhMWSr0Npmi+SNBM5fa7M+ljJlSLYW54HdyL+X02uNEu\r\nWAJlQB0bSrXoulDdumtiqL3dzuFcOqkkkiW6Qt0GpFNCBWSk49l1bV8qqSru\r\nhubitpx+rLABguCRehMmz0wVpkkKnwQj89zgFb0YZRSw55n1Fng5wBDwdVXT\r\nz2fdoKBhx5njy2qVrXiQo+O4oyy/AY64hQxIlNqrkvnipJtwaUcCmlhVQZ1D\r\nOzh675Tpf38S9Pnz05HUiLF8+n2jvdcQy4Rn1vRFPmgn+d7izfCxwAi0xElp\r\nh7JQHeg3rO82u3uJDDp5n5HJBZQjAi1+EY9fK+kd3N0fKDQVZTkpOznqsyN/\r\nJaLHekvIBb/43dxBReZC/KeUh+rCYBt9GBPnNarlwYamMkFqKp/LfzBatnix\r\nwKOFbkf7QeS4+Wd/RfaI/dtDjQV2Q0Qicbo=\r\n=PBm9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9fcc1cabc91ef5457d07b0aca9f969132757f6ab","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-9fcc1c-l95i8zk5_1665571488231_0.9339217652617269","host":"s3://npm-registry-packages"}},"4.1.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d47a22e2c2afe179ef8642cd527c857a6ec7a5b4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.7.tgz","fileCount":159,"integrity":"sha512-9f72lG8Irh7DWSbn/O9dF3+GKcLbYxLzG8cZRQsZ//+CXSsJw/9peX1w6GMt8k+B0HT8MKcaPMMhs5HDMFfuCA==","signatures":[{"sig":"MEUCIGWnIJ9MRAPJY+APMmlmsGG/DHFdeVJxYBKE4A7yvdyJAiEA+wYEFNiYAgSLVMqWB6ZQFG6XSer12FuzhpoXoBQgJL8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRpq4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJsQ//dQC8YBQvWYkwlhO4jZ4HoBeIr47QbMLyIKhc1TsS/QpBxuAQ\r\nrnv2OGfe5jUd/4lE9FOZlnVTFpH7W2pQW99j/iyQAoixMRgv3so+abm4/xAt\r\naGk9kEmeoEp+gfudPizFtdFpsX+xgNuN5tDrBpzcTSjkY5bT7v69/at15xBm\r\nAJiK+GxhGrSuBMBbyAy0xBnHWFOGT6VijjkuYBDD1B3VZOm7Xa0vnhO9WH91\r\nFxUzpxkb/JfmBVxq4/YehrEEp/PAQY8pyq1fToFzr1QK/oWxDNz3y0hpVvwz\r\nkO1FDxagn11RBzoYFPGm77d/tY+NC9IPN7wtBxA9HgPQ9jiocce2TznEvbd+\r\nv6EQzmZ7KDUApoVWM9EaETxlX2rC8Jz1X9i7NyHt/Y1s7k4NrXWbFKhQ0gMg\r\nXTMWXsBqjYxNFlx06hdaSfRH0vPg9Wpn4tXy/+aH+EMT8oBUyGrXxW4hmLh6\r\nluX6Cr9UWgtK+ytHs7fCGbU9s3gQi9wJxTuIC5zWELkVGT7tEOZeMHlbEq+g\r\nnq7IJ9U6XTLt1GGwGG8bqykh4hp1EhbGe/zhTlcP+bQc33YoHrp5mKgS5E7F\r\nWnFg0FCu5UJSU7KFAYSyG02zEePBhhxVxZtcfGlEHyekDh8tV3l45SnIvv5t\r\n2mXzagasT4KkYY9L9LqzHgLAymRWKerLVjU=\r\n=UuDG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1870eff43fa7207875faff86369703c4e0612ba8","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.7_1665571512671_0.5365987495035827","host":"s3://npm-registry-packages"}},"4.1.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"78fe255b2aacca98992aaedd9a16b64ac3efa1b5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-beta.2.tgz","fileCount":159,"integrity":"sha512-MT6rDLTLcBEut+kxuLb38vbJ4CB+P/wdm44o9mPNEIaeE1bPiIU8CPuuw7g1eFkf2ezch/ABFlTfuY6nb9tPlg==","signatures":[{"sig":"MEYCIQCvzW1ebvNksjxjz+JptGOoVYMU4oim7z3hCNoDRnLuGQIhAO+AxAHDcptN7gvRO465IK9OY+JWWR7usSTK/cScA8cC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRpv2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmrRAAg/oJlMoOvXxCpQ1qpHAyT6zhsv1ayVeWlWU5XL6U9mfzmA4x\r\n4JAU6MWOo2Ele07nQaB5JAFOb49ap+138WFxWta3PBeI69W4hnKp6jCUqCQ0\r\nHMBnmlaaRqR4qTJ0rO4z32MhhlyI05fvVIEFSLBBawxS1dJXyIe5uJw2x5ly\r\ndPgeUBrwtWFN3Zh9tS+cfGYjov4THXb3uJKI6hWdyi1v78dPnLcNGC8+OfFA\r\nMmiKl9NaGo2m/mkwcqptQivIKM5UsaNlPAjOaAg4zxb//v/bqvEtgD/IrC8N\r\nDdRYusbVk7KBqRNEEwZX8AurediKmQFNIzNHWH1JNJxMZrXXkBaJHFohdEI/\r\n6ieBxR9BXDJFVhX4qNWwCSp8FpoP30IFVDqbKrCIS9licc5JemPE4Epqzn9m\r\nPjj8Chix5mcBx2E/IYsYu3rHkPCDwBgHZAQjvUntPofev+AF1pxo/jmCzDDb\r\nMb1OcYIrTABax0Op/du/OSmckCP8lQWsfjfWU4kptTQRjIlA0pk9fLVWNyXG\r\nbC5PuAkcWidaZIUpRhRdaafSwo3cVjGdZGGpSkMdqEaYIwVAt9R8sCeP0H5/\r\n9FJ4wJRwKSdhGva23xAYKDViYSZDWViIimkuLU/UuV62hlK7DUB7C5HGRnAL\r\n8Ps7qKcMzecWmQxngY4QBBLPPAo94uqDruo=\r\n=rZfs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"87863fdabcefba5e78b28110d903b484c946ea13","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-beta.2_1665571830653_0.5563558314854211","host":"s3://npm-registry-packages"}},"4.1.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a5712b958d6fab3fb79d87cd3eaf6cc2475cb03e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.8.tgz","fileCount":159,"integrity":"sha512-8kX6rNyV0lhOXz1kfjTjQU8GKbmXeu4kCmQ/mGvZCV8k5DfQQp1jmV5RmW9W/ueWvRc+eLwqbGNAa7faG2Qcqw==","signatures":[{"sig":"MEYCIQD3tY+HsKw9dHc3DF1ZktNm0wetcxYMjY3JPEiU82Te/QIhAKpS6fFtE3idBXJcbtNhm7GyofTu9p0tkuymJTNVBh0l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRqgJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRbA/+NkVaSEHTJKQ5GaXI7dDpO1HPgx/mtbzX8+TPeY+xx1rsoYqc\r\nIWT3Ma5NAUPadu0ZQM9KeNwMkwQg6trots/j5ryPuYkYXAYBwRWoA43v1J8+\r\n4tf39x8ojbEamSfsh4LvGCUMptCVDZo08qIqFhU3E/7E5hkXmYBPFEu0Cn6+\r\nZYQk8rqSVV5jxrd0zpeBd63gKCbTCB5GOzdmXLzUjL+PqTOQZCdBuv1AVhBW\r\nYjpaEYIACiV2RzBbAS3hbeRyTiyStgD4yL+GYWA193w0Jf/sFTs0REzUed9P\r\nl4xa9lfR7R6L5s6i8YVRZ/e9LQhhhoFh76AmWmRz0iNMGW8OYNjnnzwr/1uq\r\nskEFgMmy9yfhivFaYQLDPDC4LXuTZWNp8yTBDIS9fYQjEMpfYgFcmWKsQ/gD\r\nZ/4uTuy6zy5FhN+aJTMWtWHI4ISstQMofIiSW2jvEDU/TggGQkJTm0WOA6pr\r\nQymBbG/5SECBTFx0UPMJ2wUpJ1VRcRpBPbLkiPjYFRoAetjbDh/KYMQS2T6j\r\nhls17k8u4Iog2ebb8IoFB4G03GwAu/lTB8HK8ZQpiAVendSs2ibp66hwl5zM\r\nMCQoJvJemtDLZVrbgD74Pe02qf9SrwMfBttk+400HHStGF5uHtdCs97/L3ir\r\nX5j8uLU7dA1SM82w5k1WmQePz2xlOy+FEiw=\r\n=gDsv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e81e398946eb54c112756f063c617076f5b9a996","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.8_1665574921443_0.9681728261278362","host":"s3://npm-registry-packages"}},"4.1.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6fa878495bf6bb6788217d153959cb2da996bc74","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-beta.3.tgz","fileCount":159,"integrity":"sha512-JfzJd7taRhhiycWESkjPSbkgIg8NUEJ+SS5+3Vsoi3wFNWR/aLUcGtvf5D0tNRCPtNFYuTGhFkgbgXCeBI1Y0Q==","signatures":[{"sig":"MEUCIQCwdnviXnfIPKHcwYoSpNHfWnmAT6LjPAnFfwxaw9NMkAIgciItjS48lS4WbEq2RAM36OWChyQwFysqzdHqNAu7i5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRqgRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrX+RAAmThh3eIIonKAVJR1gWLaBbotlnWnuyjt29nsut7lVS9+Sjtr\r\n2296Ji/8LSqaW8bB6MOQYqfU8lLW5ia1k0HloDclMNbW15z9BDUTpJyCJdk/\r\nWPH666g9tl1P3Ak/wcW6kbPoyxbMezBAemNdmr83b1+POGkY2qXDjV/ga9zb\r\nuaWSzIRSIEUTi6Xf6B82lqYXS8o8DukL6Hb7PKIlAGZT/VRrQnMg5U6u406j\r\nzATVBDnvODhaEJ7LA/zAjW/Q6sZMTpamkvc3bIV5SSpMTCjYNlmKTflZFfec\r\nAVTLv3pGq4GkKXO+W6CmSRWn7wAa5F7z4lFLlgiYlxb/vLpNqhCg+uXDFrxa\r\n1stzG3u9PKdVUT93a0NnsWh7h4aO3Tg6li0TApV874xsmuyTWBoaw+b9CAcA\r\nvbic/7PSLbh/iDmoiXzE+RD8ffONG+13nHqVhZACsWG7uBlnicHJTOqueQnJ\r\nea7NTqAfZiIwEjg9FEipoGhh+9ouRXQKRGSEyvedAeJ/M/XeiylfWMoUmMTx\r\nPXVmOAbgB0FDGKiTFLODQtOZLHeDxZeYTolE3vCdwFvX2abCYo1nJNzHsmq0\r\nDXOvq54piUwngSX9F+BJgUn7OwQUj9oQNJTL2J0SisbfZ9AjztPH+1EcsOID\r\nrq5l9YxSmYjK+7znxyUNoFfNaQlHD5j1bZ0=\r\n=9lb7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f6bdf124127c6c324767fcb5c6c1be4512826024","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-beta.3_1665574929495_0.7543704024304145","host":"s3://npm-registry-packages"}},"4.1.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d4eb7d0637a303251079ce65b42d087a9ddfd9ac","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-beta.4.tgz","fileCount":159,"integrity":"sha512-C1vIkqrCUvLmew54cjTnXYe+7EBwHWG5owvAAWoKua4GUvrQkX6BDq35UKN6G7QeJWxkZ/wLbFa5K/zelFMB+w==","signatures":[{"sig":"MEQCIET/3EH3/JuFWIyskZUTwLFD638rCkGunP85i1TxWvg4AiBtKak/QzkSBvs/cBq4CP7EDqcrQ5r2sQzD8lQZEH4YdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT6PqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5GxAAhaTU9rqrI99M2VlTbO/qS3TpBrVG3jvgjFp3kekz+yjlIcL1\r\nvxklJIT111k4E3lxYf9rbNt2mst/UrtCNvj8FBFDTvcUeFb/FVrj9FMb/vQH\r\nkJY2dFaPUF6aeSp5e31+WuH9aWX2ZJuRamTxJJKV0VXj79D1HGQMGMzUjzCd\r\nQrPbC3PsODL7R0pXjVEHN7nJuJEu1Osx0TFyrVefP5MomVQASgFqEucpB3V5\r\nK50IJllrHOXDQE82LQM9kan1kuUkSRG9BcBwHCAy+8ePd7MXRJQaULlD/NUZ\r\nfLXBFTD4J5QXEXlDOfEVcFU2azxECZOmfKqhYuid3KC5oLXx+Kz2r6yAnt0e\r\ngGfMikx8xL3C6Ccnbq3BQR/3WkYA8BYAxTjOdAYqB8+VGEEmzu5Umo9RgE9r\r\nweGav2hM85g6a2ekpGpcOMKUZ7CqxGBThXCSNVjIrJOzI0OpQr5MsEP3fffM\r\nz5vd2zJwVrXeu012A9yveAAtuJEyLOtH2YQZhkw8sNT6XF8ytzof9nMJ39y4\r\nKGAYXtRvnNuMBTI5cA1vj6a3czDuBLE5N1ev3qKH6cx+bBnJVLZ2ukyOaBGn\r\nTWQ9cJI3mQFQdBtgNDRspVfzd5Vhoc51vZqLD3BPlboxZu+amPBvFmtD95gf\r\not1mColCNrID06WYDELsHbhlbXbbjTPyefc=\r\n=7NMa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"58eaa1e4bc26db5038a3d8377216203bcb15ad36","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-beta.4_1666163690333_0.9733850076140897","host":"s3://npm-registry-packages"}},"4.1.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b48c88bdd3311ec47a7a8b7962e703b869d6e7c7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.9.tgz","fileCount":159,"integrity":"sha512-+fQxoiULdN8ij4XT0DgCzlNmicv2sTbQAvg9H9UV5Du++yEAJ57vcXRBl/+DgL3ZH3Ye6wmwxaSzgPn5fxxd2Q==","signatures":[{"sig":"MEQCIGEGkbWICq8vyiBkdeOk4GBoV9Pqm3zX0k77u5YQmivrAiBdClahuEhahpuP4Y2qL35KHwwPw0m0TeppaLdZAncnyw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT6SuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/aA//X9Xxol+0atQwVO8bKggd1A8B0kOhR2VCgzs1g9LfJCd2KesL\r\nS8Tz1WDHxNtoBXRA/NMxbBt15J0mGITxoS8DlSyBKjVeop7vPHh/VfyzjtAX\r\n12Xdmo7Z5pR2j60HN+BhUXzJhMpJsGyPGe2FIwfoJsXz/hoa+S49bTXidYyw\r\nCyqFHb0ume1Ev0utnhC0u2hz/SpGJ4WnfVm57M3UuCOgt8pnYRv18vVzFihu\r\nGH63xSlGXgway49iGKNX2scdfO+qMX0fJOXT8MZbkvPRt5yXhfqLsHbCiGMi\r\nZZqQMnhBfsl0lrGJaetbU7O4vEP1EbxDdszllV2ULDU4MLrSkQDPs1Wji760\r\nQD9AsrxwpAWWNC1JKNSeA/OoqyVsObojlscoH48HviNTIM9oJKbNEchK4Xg+\r\n9jqQpxKaYAuXX79K0LImXUXxnOgI458Vwoxrh7JN5wGBNfYRM2pp+Zd6P4P3\r\nndsbA8bFMKyp/hd29Tf9VIHSQthnJH2b05T8bfhJw2jB2nvi+KNiTk+0ytTD\r\nh8BPRFVREU64ZSOpp4N3/Qsj0YU8VFgxBufCpqUV93z07/L8Q8Ku/iU1PRdm\r\nWkbMAwsj3PR4Rm7JS01Q7/qWIay84GGZCjTHu2HUSn0Tv3aW+XWt/ARhY4Y+\r\n7ru/XdFnh/JfBgcv5LPyXdPhIGk9L1ynzLQ=\r\n=X1R+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c0e477aad6f1c0696048474733b1440ba698fa6c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.9_1666163885991_0.12085620515117279","host":"s3://npm-registry-packages"}},"4.1.0-feature-9c11bf-l9nsp9c0":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-9c11bf-l9nsp9c0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-9c11bf-l9nsp9c0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3f2b9906e6289ced3e08d4d2cdb37b0bd45e7b6e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-9c11bf-l9nsp9c0.tgz","fileCount":159,"integrity":"sha512-LTKyiN1053Yq68dadG5/94phP13oGFaLYrLzeM92KEGwjYViHyxl+ylyOH3AkJ7HkjIMtPkZHDfy+h8ZtrAYqw==","signatures":[{"sig":"MEUCIB9rkaQQho3XsvnbucbbWz8CFuJq7oZlXVURZejj9sIyAiEA6EIWYTgnH596dOZrSivaanDlTv/vJ4cG27ASW6qeLLM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV3q9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeTg/6A9Tn2CY0ko0velqjuxByVnCWtdU9QssvebzOYTGYedF3Yj87\r\nQUMjgycGwebv6Bg0NwE/znM4jEpDFmK2hEX9GQfY/UgzkAMRMSpnT8omClDl\r\nAuti3fYZpp6vovCaZIaIJyezpNNF1VN5O5UXMBGOoZCYVHlZzgHEKV/gaCCd\r\nyelHrvZfVHeE70LI/bgRz4z6s7PJbitI8RvcFjQ8N+X882O8cW7uTFXkB3r3\r\n2b1+3lyNk0nq2bZkXJ5bOcmYjxO8DYC0ZLDKe/5cI+0UvKpe6TQDncVJVLY8\r\n0jk2Gpm2PDBQL2XenaUS2XDPp8MAUP2ljY71B8ZJGrbBbH6Rc7dgz5AlSEtb\r\nPDCflz0hCMtdhpVoop4LsfVLV5zejuvF0NxVDGXJhLUs3z7+2AZTOcro+dfL\r\nq3rdHbi44cAPb+q8Iav29+S6yaOeJ8ex14p4k2/KfqZppjZbd0Ukp7auvq9N\r\nZKeeZmvABajw6PmH7wjYrSrq9x6frCrRzha1JD1XG1vhQLgRusL3imANZhPF\r\nG5+NIVGdPtWN8THBjgCdzw8lQTH7UaubNZytr86ED9E2urNRdaOQQRgXr4Jv\r\nAEEHt8s7slAWI5sUs9IFRrtSQG7JkofDZJQr6XUl/9BitcwYlV7xeExDMOjv\r\nLSLwQtck93fhTtrU3Ea0Q9r1Jprchdi7VLU=\r\n=W6Ih\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9c11bf98556c5be0e6afb8bc32ac820262407f2e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-9c11bf-l9nsp9c0_1666677436884_0.1843199340502797","host":"s3://npm-registry-packages"}},"4.1.0-feature-fde9ba-l9o43es0":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-fde9ba-l9o43es0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-fde9ba-l9o43es0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e4050c32c343d2766ffe66d0ce62316b5fac2655","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-fde9ba-l9o43es0.tgz","fileCount":159,"integrity":"sha512-+syo5AElkZ1/bbGPRMd3u+6sizmMTgjitzuMOQ991n4O2JHxTJj4REO1wvvHKzbKcooDnXj++GMg6v9DV3wlFw==","signatures":[{"sig":"MEYCIQD/iSYPXj/jwRsEbOccVvMZYwnOlyQKWhs59yWCFpPFMQIhAOb48MXR1/xBHh1BO88mABgEyPkDx1/8rWV7ruNxxJvA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV8V6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUiBAAj13a5at5QAZ6kPpwf9NzXLt35cdp/JJHcTxxCfZWBvkLWpZP\r\ndX0sKtWcpEE90wdiakuNbjoGcXmkz5pyz5asx9DAeY5ltFPJx9yH+n+w/+EX\r\n9cGhJj8c1Ywex3AxDLdqU4qjzYxMaYaqhkz1CFs7pTOjp5G/zctq+Dm7A2dh\r\nPn3a8/MQUH8/niFflqAz9sWOdiEqqVebJ2hfEQyRY4RwGIJ95GSzZz4f4CwH\r\nj/xVIXgRMZBaUyLgJjyYPmEpwiTCoAao4pELTalB+1w+XLL49RJp8zkdVD/7\r\n7O33ho9fpBC+o1YiZK9y/5eO77lJ4uhX/MWmsrbXlYr1gyBPlNSffH6u4JlX\r\npwcolzbWCfsOE8sbA8LdE6edRKh75YbNi5Y0qYlSQ+yqjhL08+xP+kGWqyLt\r\nokGYgOjZFoxZ8MRsEcs8jZwVJzycx9eUA72Xzdt/eGEhehf9J3O0y6TVrcI5\r\nDN6W4ib4nRL6a3TfBSBYlE1sI7MHASoXWogKg2/Kjynd1Ttxuu7fwwEvfLNp\r\nw+pIqDDld6W3iSOSOK4ch86Vfs59W5Gk6n1PItlY55rM6B8EVz2Goc90bFXD\r\naFTtt9GpE+2kY60IridpmhmTjJb0ypDy1j2Evivad6HXTeFtzbOPy71idcaJ\r\nxhI+od1h2tO99cBW3saGcYr1cgCOsLByYf0=\r\n=CztR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"fde9bae21d778131f26997d6d7acd69d60adb56b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-fde9ba-l9o43es0_1666696570153_0.04115820096822653","host":"s3://npm-registry-packages"}},"4.0.0-hotfix-a0a95a-l9pn56cg":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-hotfix-a0a95a-l9pn56cg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-hotfix-a0a95a-l9pn56cg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e5c696a66fc23a2341fc94bd720386d91f34aaa6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-hotfix-a0a95a-l9pn56cg.tgz","fileCount":153,"integrity":"sha512-kZNA8sXfKrlN8l8oNkx1fQaAvFD0idlxFEtcM7FTFGZvV/Hg27jHiIUlIyozu3STH87XupzM9//ITEN1jJNHag==","signatures":[{"sig":"MEUCIQD1Tb5xhEWJAjKQ9jG/rbyI4/FwGncqjwLZqeQDBtU29QIgXPcHlef8Z3MvfzsLUKUiL5UZ3A6j2UETHi3zNxv9AUQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWS6rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoADg//UMAuHDG2HVyTS1s5Jt6SrI1s6O4DNWVEhnF6isiYbK554L1s\r\neTiX870PwLyASqGeXiwJiBjnjiq3ySxZzNr6RRQrcfQZmAB7HGNDkHYLF2db\r\nBV1PHlZne5RV5tJaZ3LA5+BXnfMmKPFEEIltX0unUDLCj4DgAyIxERP8R7CI\r\n8iW0a0tf87PkbXHtsGj7iCQNdjz4VMLyDWrgmsvoikSDyEZR4jMeyOSJNErd\r\nU2PQWLlRmYQnyEtOnOWdGI8gMXeE0MyC2TiPncTqdtWKeWRudRM91KIh7NJQ\r\niukk4Wrtfep6oImoDg/M3Ysvog/Mf12EuE88499XGUIiCg/CwG8Wp67MadzT\r\nIXhXVTvk+ibIkpIaqsr+Dnna3fuKaCJpkdbAz3JUbouPFq/0HBFGULXvP+SX\r\nGtJartri97bdfMYaOB3AXlKGXj+57FaBR+N93cpgX+8ITuUutM39ayjif6H8\r\nFxcBaUBP8pKHfe2hS5VYLkeuBYKO6UPyGiha/sJMa0iPeaSWAmaANPJwqsk2\r\n8z7Yn2mX7f/rFjkBsXqso9qExFAvWg/VIMYbU1xkxV1wZN3ege6ZfYef1VrR\r\nXg7RQjU4IyEJS1BCYdaofF0Og7JZYUVGMpP3AyiNSjGqiHJKPJmpYusMzIzv\r\nqA8oGIf61X/9LkC1TN3ibaLxMq5uYvZKngA=\r\n=tGvu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a0a95a76ddf54646f23ebf5c92e96d72e0e4780d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~split_maximum_sql_connection_configuration"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-hotfix-a0a95a-l9pn56cg_1666789034965_0.9362050572167724","host":"s3://npm-registry-packages"}},"4.0.0-hotfix-34771d-l9qtvvrb":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-hotfix-34771d-l9qtvvrb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-hotfix-34771d-l9qtvvrb","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"117ea66bd514a456f16245747aaf08218f871124","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-hotfix-34771d-l9qtvvrb.tgz","fileCount":153,"integrity":"sha512-g/v0g83ME9shVDL1scGSkIV5L7eB96qZuZsViFOgIEjC6LZXot/Z5/mNPswgGVNfH8BWvSzwxte4kVHcU7fyOA==","signatures":[{"sig":"MEQCIAhCUisQHssquhQY0Q3z1PkPA91B3vMWBZSU1Ib11RcpAiBR8jCtmyvWiCT4I6fW+i4MbccFbWUGPqDehCUPn1cMiw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWkcZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1hQ//ahBnH/mvWda/XKwrlTgqGrz+wCIXnUkQNruJ4lHdvF1bBQQd\r\nhlMxJsEvVh+GU0g5Ze4Deuysirj5ROUSQPtvE74nhXUmAsMW1to7wc7R+zaN\r\nJHpplgWimsWpylcZ90vCr2/TkzIGdK5vAw/EPOwJjb7stWPL7ISpTIX/tlxY\r\nSDNXazU5oxNhirufUHEFWpkfwNvHbl/b3KoLQGEqea+lAWjp/VyshEToFYnB\r\ne0B8amlgt5sI6iAHZqHpqIOTl0PrKG/TQzzHsR3+iRL7r5H5SMx437/z6HPg\r\nueh+aviV5eDbOlvjeJSSB4iW6tCURg7jQ15YYMI1LtHf3cM8bEtGh+ZNoVIz\r\nJYqa8V2ohZNe3QXHULjVuzly+xYKsCVFQJLxJ24wIjCqruD5WEjGIkowTGex\r\nUuwUHqsTBUp+6QbsNF2xvXk0MM2VvmUy7b9rIGVsymbsZvjrw3OMf5DQI9nc\r\nOO70oKwqJRFIecCzbJ3UpalDNP+IXVppo3I+UYaxTBxR7+5bCBjf6H4OvdNW\r\n1zdj0jpdY+KVY6Ei0eqdPHucnHrck0cNRwDl4StYm5r82dE/+/UiozcNV9Lz\r\nSED3BQalHmqPf4RSvhRTa/dbyUB19KHSRubwBIb6+39PxrDZ6Ba+gicT8/rY\r\nupBTFidPNNaD5bNgHU0olAsJzz5Y1o0tMc8=\r\n=HGAe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"34771d103c21a4388906019e7e557a9e704ce1b6","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~split_maximum_sql_connection_configuration"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-hotfix-34771d-l9qtvvrb_1666860825319_0.0758672476962281","host":"s3://npm-registry-packages"}},"4.0.0-hotfix-6ad79a-l9r46ot1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.0-hotfix-6ad79a-l9r46ot1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.0-hotfix-6ad79a-l9r46ot1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ed632dd0a5f5e110bee7185d0e4dd16982462698","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.0-hotfix-6ad79a-l9r46ot1.tgz","fileCount":153,"integrity":"sha512-AloQ31XwpJ+WGffRWQgayC6t7n1wqXS01ZDosdPtZUkQrxd/XpB94Gy6lrcKNAIBbwHlCd1bHTTPE75iVCAcTA==","signatures":[{"sig":"MEQCIF/H5qExL4XZQtnzfTqLM5HAglCQd2jiBFiwK/41QcEOAiBRSbpv+Q+87u1wnF6qlbnUK5hxYBxo1rywLv85exMh8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":497078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWoqtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovsw/+JDvx6B3YP+XDvZKxWDObqpeqtFMEjNWlg+pecMYpLsN59rw7\r\nqxaIvx1TkToy5WsKMbp3eznN6yFjEKI3EdeIaay9f8zxQD4F1c/PLZzUVvm/\r\nRr9PtTzA9MawaT1p1jrwGEXKkk53dVoNzJMLbae3sGi3R5hM4VVDBnrjZ5U2\r\n7H2T1FyDVYtqqdnVGExb81poHbPiqhbocXZxCqDRWfkuziW/jtHb16XtXvKa\r\nCqG7j0bfHbkefV6fJxu16Y+pDwE8v7wLhzDaVtZvXaqBBtythy6foSKGpZ+H\r\n/d7rbjqcHfYix/PGvf7YLqqEp3jabfABtes6GGI1jCw9TJOoIcSZQPc7UwzJ\r\nx0D7/fuKTeKZT5whhIO9p/P3x5SgCE41kCrPvYSa34ikJLub7HLHtTjyk1fD\r\n8iHkzto8R9NHjvg1sUtC681OX2+XCEd6P/y9fKNZ9oQQcI7KY6RRphk2RoLj\r\nc3sYNcJBCUpZo70oH2+glwxpXUXfgFr7Vk57ZscL+8mrlgU6p6Y6V7guSWKl\r\nEeO3Ppp08yCZUbis+hLhjPBtXc4RVOgYJQI+ld2LuVJl6ZLaiSQkTwvFoxIP\r\nzWGyTqvDWLR2da1NrTlqELQuAivSbeDA5Bwa6uJAgdl4nCyKf/MWfyev2CsX\r\nhvJ/Ps67sCcJXrNKdb07vVYABGcPTGT61Ok=\r\n=kA8z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6ad79ab50c4969148359f334374f78218015cfc7","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~split_maximum_sql_connection_configuration"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.0-hotfix-6ad79a-l9r46ot1_1666878125573_0.09260816741080657","host":"s3://npm-registry-packages"}},"4.0.1-release-687db6-l9s5as1a":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.1-release-687db6-l9s5as1a","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.1-release-687db6-l9s5as1a","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4afd1a0c117eaffd27adec1a838939b7a27bd6be","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.1-release-687db6-l9s5as1a.tgz","fileCount":153,"integrity":"sha512-2EOcE/w7LgoYbWSSD1QY2DcDri931+WRoCK/hlgSPZPjdr9VEepoGQI4AfAV5hxd7vAkIad5gqlpPv7n/pLFGQ==","signatures":[{"sig":"MEUCIQCFp4yJ6/eJOGC9Eya3mkLkUd+33pYFRzMZnTWG7eo1RQIgAUOOwIl7z0glJdSLcM/i3jDdDsHQMwUjTZ4u4JYGkDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":499014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW34zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdOg/7BkKIMPJzgY5cSu9lE2np9Vl4rsclSHrXwm8BFwQXQGIEdPrT\r\n8qVj6+FureOeHhGulvxrMUWE76ODjYKha3WQZ8aXDHf/qlSJFUQL9P0/MNE3\r\nCyqVEpinD8zQkXeRx1AiD4YHl2FrCqwqd/tI6b4gYb8t4M/jTynuCMSyHizW\r\nfSClL/OK9AWaJa0S8HWtqTd+7OYkqsSHstDTOJZ2K0E9I82vHP4LG80L1yLA\r\n4uaE7psL1lkXmQ2vYZjPprgTlgD7DL8vJ7F1ITEolZI9f/q0UYNRl3i5umuv\r\nQocBkNSrnereO6TvOaAU0Brm8p8VsWf893OZKmJwJFqpowwSsP2i6KM+RG42\r\nNR8TuR9UEBgjngaA8d/jwCzDX/2o2xgTvkyzkpyyRrxlNMlqRGJZ5QtxMh8F\r\nOyvIDY2xr2lNUBvfA9h4Gxaz8KrQk1e4LE7YGr7DA6H5yFFlrgFElftIspji\r\ntcQnZDdiLj6fL8c9XJkx+kKEUp/5ZiXEXhrvuyKLRPM1RHdRe8yu0Tt0YANS\r\naqEgcutxhHHjg5N4nER9rPr0kFH5ilhIpnzYTI3XkYap1yjWw5yh+Q+eASyq\r\n2jcq4OLFSapFHa3kQ2/CH998KKjmUlRatI57JXOT+s3lAYgJstw1ch74Nic8\r\nRe8hQtebJGscAYdce7ErrK88+QRWkJ9FVr4=\r\n=qgh2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"687db6377bee2d12b676997e489f4ec2ecee7b79","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.1-release-687db6-l9s5as1a_1666940467327_0.6329649014206515","host":"s3://npm-registry-packages"}},"4.0.1-hotfix-054a4f-l9s5fpbf":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.1-hotfix-054a4f-l9s5fpbf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.1-hotfix-054a4f-l9s5fpbf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d545896543c1b63d24e881cb2665610d12a525dc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.1-hotfix-054a4f-l9s5fpbf.tgz","fileCount":153,"integrity":"sha512-WjfCbfUh7xdjUEERcoM+sVaLqNuK6thvvqzAw0L2b/oCBhhbtD7frjIEwAfLwAWfNeK8xuHk/ePbb2Qhzk8ygw==","signatures":[{"sig":"MEUCIQCzA2BTOQmnfCjFahqo5AptM4mQjpeNhkAIGANzubIjEgIgcvad9FYsDBIhc33ZBkHUKQf/tUuPt2AYAerEV1wGTKo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":499057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW38VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjEw//XoxQW7bVBFDEsy4+5Y8UBCIQHZMc2QSQksfwZXLZmRS0Pd+F\r\nw7rB5ijqMzaysEBJGDnTX3DOsQaqI8ZhtKnl+j2k2C6iHLSXURfSxzTdFPJN\r\n5Fa6R07B24e3a5eXpo6ySybOn6pObat7TFbdSn6KW1cG1HKImCIjBbXC7PBY\r\nftyi7blSZpdff4EXrzZnZyv/daA5ys6aX9GGiS6qAq0fBxIjbMEsqqVcQ7Ep\r\nkOV6GV5ktaDMWLs60USqeJOLXjA1L2Z+qYAvpB7up7mq7uC79t0rISB2fCuY\r\n3BEkosJJyz8j9t7eSeCrtqM28sp/cVn2Vw2Oej6cMX7IzvoqI+fdjVvTq6FQ\r\nkpkyxWZVKUqvowF6gRYIZzk2HGFaLFuWZm/m7WVRECGJTJEjhbGexOLnJ+mm\r\nT2UWygVafWQ0N9lqnYLXUN6QUiH/klskZkQR/bS+HtIj0cUGYpkJ59CytGXw\r\nNB0sp2Dk5gKquwzQdwBSyiz1JcVsIzSjNKGIldBB5JlVZKS0dI15cCPjImXG\r\nET6Qez/QZX2OuQqb8GGva3xpIxWM+KHNo+q8GeGKw4TglQY5FFIjVi3FExfT\r\nhOfR2xHRswk7Gmgz0zHuXqS+F8UKdlWptb67/4jrmDVRmJkCoNfi+bZLytCZ\r\n5NYoQVGOkZpaYTqIQnsoa9YqktRqi3He7yM=\r\n=4/sB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"054a4f8926b76e8d3e4acf55ecb66b1bde03807d","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~split_maximum_sql_connection_configuration"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.1-hotfix-054a4f-l9s5fpbf_1666940693417_0.39147047884828234","host":"s3://npm-registry-packages"}},"4.0.1-hotfix-91e544-l9sfh9gg":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.1-hotfix-91e544-l9sfh9gg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.1-hotfix-91e544-l9sfh9gg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"0472bd4127503ff5bd40409005e8e994225933dd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.1-hotfix-91e544-l9sfh9gg.tgz","fileCount":153,"integrity":"sha512-sBSzF8p/p2CJqx4Tz3Hgjs/F2YiiDdyDJQTAN+47jJ3b65SGFDLnUyH1on/rpTdi3sZg8tI/x6DJRDYCAkh/wA==","signatures":[{"sig":"MEUCIQC6lYmwWSnbOt63Aw7w2FFcRrcX7z0fCumberd3kA5oMQIgDv4Tzs/rO3brPj0cTzlLH3eJ81P8UZXeORxmZ3Zex68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":499013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW8D+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqD2g//ez5P7nd/KxSdGbh9G05GD+x3spN7vYzA4PZ4Bl8dWZNqWDaw\r\nZl808ib50ej1LgJ1vzT1Il32HUQGmvFr1U1Bkd59Fv8MJg4weSHeiH3xCoPs\r\nnRcs5VwHW8m75O8j4zpS+8Uo6nbx2cW0/PgzZy90MJJZ/3scAjexP14Ic3pV\r\ntvjP6M6tw3juqr9e9rabU4Htdal6O2tzAoBLl064WveqnrdILqj4x5KGrh4b\r\nimQOsiEc0+1cr8HVd3aVdIX6EboD4Ch4tMSv8e6z1OA2rYUYz8wNPgYepUZJ\r\nHBwOYCFFzOUZJW4v4A6nJ/mds3wZEYsA/9VcQ5Xt2s23W7WxTmC2L9C/64pn\r\nx5KgTBRAbbZo5XZ9H4vPooZ2c5/74ZwMTcxl7+dbPvltRfR7AfIlv/DM4Rik\r\nWu7SbjwVsS9+qG/P1xE4esQaE0O8Qt7aXcPuB3Ha4nO2H3s1Zl4TtHvCk5v9\r\nmVzPS2P+Z7PX+aj0zbn5Epv2cH/gcYLPoB/P590lVgGHS+eZCTBX3g6YbGMu\r\nH+kcRDQ7oaTV9DC7smSww0ZMruCWhsuLH9jAzQgO5PpvqJJ6bxTOy/phCmGR\r\nMXJfWW0zXpIKuF6q7bjXImdwYF8qI5MzMmMAnflTl9OU571pVd9XvOr7abHH\r\n3DC/wsz5j05tTMDq2zknT9hgtiYBOhXxLd4=\r\n=7vk0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"91e5448101216de4d7b526bdf5c57fab58ca9ff8","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.1-hotfix-91e544-l9sfh9gg_1666957566355_0.39249939161996594","host":"s3://npm-registry-packages"}},"4.0.1-release-1f4370-l9sfj6o6":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.1-release-1f4370-l9sfj6o6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.1-release-1f4370-l9sfj6o6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f284173a8dd4cd15740cd3914d2f39a386f7fba1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.1-release-1f4370-l9sfj6o6.tgz","fileCount":153,"integrity":"sha512-ZX8pge+gN+tyVNAdlsEh3nJ/mZsGr37sd4F+cyeOxKnBTNlFN1dZ08CeM7lQt9ZWff7C/mWihqu/cJedWc/uHA==","signatures":[{"sig":"MEYCIQD51PV/cHCfA4i2agoqJrtOJVZjyAxDRX5169wr3Vc+1wIhAOWJnOEVO1BdmZ1pyMpVJy5+Tmw97xfeoctSiJk2wNlU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":499014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW8FSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrY1RAAokq8dH5SwjlxFhZrcw5ZB3bBPKPJe4cGwGAyehT9yVut4i8i\r\n18Znwz1Ed99RQs3xiE0GkKcoRZmf3esWvGWczwZ9D/V8yjD1BmuiODD7cnMQ\r\nDeNTUzSABrHnEQPQvRJ8m+ZBJtSU9JrhUEOfkPBtpCiOVGFmQAc1Pa9rIc74\r\nFMzyfV0ZWIyPGdPe8DL+5T4ktQda+WTbVF8Bg/L4xZeMcZHHccTU7nrwnUed\r\ndkPxfuWYkj8Rka2Sx3dcw8p6w0wmr00C5irwVk6VIgYBegn418jAvRIPfgSz\r\n/936MxopowO6Y2/Cf3K3IhC70JiSfXCUpMGdIWviuEK+PpnSBqhoK5IwFy3L\r\nyfi5fK2yh1u5tKgvDIzyMVhO3FfFtVNh68Br1Jpf+Fvn8YQu7manWkbDEC48\r\nVt4KWFcghnGFPMcTMBVU+V+fC6MLfFi1HX7KsXH3EGbcMdQi+kvDpsbxDBMK\r\nf91kdzad3WbfwkdYceQMWoi5FXBDU2Yd2hzSdT/pW00/GEr/GsWYnLnPGzcq\r\np2R1aMNk9+q3TOcpTFoVpT71jxy4KJHV8cov+YGtFkxZvI8BjzGfoAaC0SvE\r\n3wWCQjciRzEzrdjwsTVztUeMsoiJ1oks5TU4hezg1LJieyoT3jgBGddzOcBd\r\ndzb8W880eZOlJvNAqs2HgqaVwHieleUbEsU=\r\n=mxOw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1f4370a76bdc6e372bcaa58397299e921e7ea0af","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.1-release-1f4370-l9sfj6o6_1666957650403_0.493842052880372","host":"s3://npm-registry-packages"}},"4.0.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.0.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.0.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f638003ee06384cc10df2e671b7a6ccbc1e481cb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.0.1.tgz","fileCount":153,"integrity":"sha512-5a4CNJNV+RrpvIBph3RjvKdJHysrbWqrineQMkp51rhN/hF93nlfavM3970hu6cYjpvNpQq+DXaWech9GkVhxA==","signatures":[{"sig":"MEUCIG85Yg5dlyj2sEpmGUQgw1Y+v3n2nY9FYnkbjvoKYyKmAiEA5FPEdq4onanlsp1m8ncMrpXfWikYg67A1SR22rBOdsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":498990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW8GfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaVw//bEqbHPWXmVhzA0KRtJXYAoAfQQuyuaYpzSsLsgzt5YjCzgJo\r\nK6MszYE9+pbWpxkZgJXQlEecBbCy5VEXmIfhSGOOeaFVdq8+QkucU/iKv8se\r\nWUrum2uAtLRLqY9i7dhUonYk0GzIUIwwvTpH9b21o3w2n0dP9ijaLa0fuIf8\r\nh11IrMFhTLGV7ZqTQpg6BpD2q+y78QUUkPWgW7zHvdDwaNmkmcs+XHMM3SOr\r\n+KQc9c5le19AtWT2mzEsOgY2BROmOSHm4fhoAJWA/BRuu31Al7fViYuv+Pc0\r\nSpUKJjHH+dATG88kr/Tjgi0r+d6lMQFK1uF3Dsx0MPhpUyxNZfk6rOzo+BNT\r\nMwwcfAlN2Uykb6GO+h0TPR7/uAfPJSVtXODPj1qkL34o2vw1Z8M1HUwXW/PE\r\nj4Dg2BfbImxSjO4MZ8o/EajL+Pe1A5fNFwFMAggYZwRttyUrdhdx0MBTL/SJ\r\nvrvRfTG9zxtmf7/bptl8GWzvPYR+R8o3s3bDD4gl6FMJEWCjNtbsKFyUPuqw\r\nfFl1F5aMxrjBLSvhieaGNuiF51xJzh7CqCFhkGfGkx9v8FgYGndzi95CPjHB\r\niSipZIq51hlKV2/pCPmIlAvOl2YUZg7EmmXSg2ztc3VwOsQYrE5z6LoQfATI\r\nGrKepDs6oZhZE7636EaFGk/6urb6+/PZACs=\r\n=jylI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"16dc1bd5ae3c1ac0414bfdbc245c209405bc713f","scripts":{"lint":"eslint \"src/**/*.ts\"","test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build && npm run lint-fix","lint-fix":"eslint --fix \"src/**/*.ts\"","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.4.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.32.0","typescript":"^4.4.3","@atlas-engine/eslint-config":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.0.1_1666957727018_0.8574973751529344","host":"s3://npm-registry-packages"}},"4.1.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8380bf107d63c282a70484092110b856c67873ca","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-beta.5.tgz","fileCount":159,"integrity":"sha512-KNK8ZPrBMaQLs3xb8Vgin+NxkJe+fWs3whzfHWtI27Nc2NfR8n+diTblt1LdHd4IlzAzs/Z23qP/xyxp7Zhzuw==","signatures":[{"sig":"MEQCIENxyFCWpHWF/OVtX4EWAH9FwghutJyYgZjXZwUbt6AEAiBc++ZQKJkF3+pnlErw7Z3XHj5nVozZErdWVXpH1bNLEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW8J2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLEA//WfQLVfpP+nKXRFStiP98ievx6gBBPzvrhYpzB5huhSYITB7h\r\npVvc5iYuPyPqyfedhg7kxs3J4YgPvEmF+egBBh8RpRrxS4gNJyKpuijXEsYU\r\nrGVrAiTW8dt0MN1mSnglGJNQpEVWZe6EKGTkYQNIWpJ9X3pOt4xd7br0ZJEW\r\net/8vPHwQkIKxsMmQjg6veqPXrEbUHxWnCDNqEl4Q9POPGZqsi7fQhSpBEcV\r\n/6fuCYWckIQVOmy4OJhPTH5TVuIYOBGCtbhkzjp9EpcSUIl0/c28cKuG6NV4\r\nqCwXh+PZg2dhClRrI0I+JdlbDR4pft41iIOCmGZeFxUJ7zLqdutBEW2GrwSt\r\nMESP9YPycYyFKBrcPwgeVm4MwqjB1SCk4k9cH4/nBrK8EfFXOW+ixk0M1/5C\r\njKXWUURC8tQUh2voG+g0E6751vnFKj3vR2Rsm+DhfAYcjQSEoE2duuyzDzWI\r\nP113gZvpcON592qgPOn9Wr7MycRzrZez7Jqc3cj31/19OxHNmmfl5M3CKfBg\r\nrNPy1Aii78gehtktuqnDngWXldEiiInglE4iscxQUvORIWUZT/qBHMMB0UYC\r\nYIPLSJcL0Lx8CxiPi+y8qBpRqFXvw2CLVQrVLmEFWCl8RcyIkHsdzWPEM3yL\r\nAkIQU5Kg42MmDnkxK4IN153MTxQB3iryYqQ=\r\n=8hcH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"032563f46459f59a006b425289acbcfc8698c90c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-beta.5_1666957942704_0.6213899316714313","host":"s3://npm-registry-packages"}},"4.1.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.11","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1e8793cf19a985088c884f0d8b966f3a836f8792","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.11.tgz","fileCount":159,"integrity":"sha512-geFiUWv6yFeXBzMzcbTr9M6jNReUKz9+APK/K1VR803yD0hJQTyuZBS6Rnd32ZHnG/Gt6wIrR8bSeTupLYxfZQ==","signatures":[{"sig":"MEUCIDx73gv38LL7mddX/LF+sXpGge+uG4pIUPCFHtpRUfJdAiEA7lKThLRyReqMNBrP5MUDuWX0pV4O7oQhMSXpNmIM0jw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjX4OgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqobA/+MOEQ20PIMN5LFZDVHbeQ6xDQ01yWsWs6+uC0tA3/XPf7psxV\r\nKnEcq++uSGxJr5ePkKnPyjRw1MGAEelot/xrBjfwg3Wu1VZvZCbD5YbHuGvp\r\ngtoYRl/x2qzM+5NvEQyYWW+YwcjZMsXoykDpO5gbJAhRL63i+RMgj1kaaZBV\r\nAbSpWIP7axlERzXTotYmPeXLtQs0OzbONsBEdh/llj9h1POXhJeszpVj8Ijl\r\n2VSO3VonC3RzQusrxcU19gWOVEIh3enu+aJksVCl5cN0MEN4eVhbsjlApMar\r\n8duXahwmtvr/ELf/4RwHmruFkuT+91RV9UP1CQK+x3JrwDLQK8zAGicDGd1O\r\nEYK6KSD6958ipP+RC37hRhKkpBLzMt3ifEixi5eKFURHJxlgD7upAZzyITTK\r\njBnWvt5glBp8kOriPhZ/nMnMnjSpfj3JKZupaVISmIPr8SrZkjc2cVFJf3Jq\r\nylUrKrHhFUYKrxCK/KlY/NOnyXJe5R8vt+6ZwC175r1MenaiRuFEO/UQ9JMC\r\nTK/r0FTTOhZaDb1Gden4NrfJbG9qjCIoMTy1sDdxJrbVuz2f5pmIHdChbsiP\r\neJagjLsU9RPt4g8TD4eU+X471+QT5rvnsgp4FwOtixIpYSNEVotRnCdEtpwo\r\nrwF5d0y2lBH7405GBkdiJ02Q75jR9i2wFGo=\r\n=pjdp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7841bb7a36ef9a3759a3538a3cbc578fffb0fccc","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.11_1667204000061_0.575056068229266","host":"s3://npm-registry-packages"}},"4.1.0-feature-21dabd-l9zedcio":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-21dabd-l9zedcio","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-21dabd-l9zedcio","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cc737402ef01aabb63e77ba228ebb19bc99a4eeb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-21dabd-l9zedcio.tgz","fileCount":159,"integrity":"sha512-J3CPHnuFmgwruPCXL4tLdVMsOTRmxsELN627g+CMi7L4DTYWuXpF36OtfqMD6cQBaOjuJnWw5VIRRETTPqyIIA==","signatures":[{"sig":"MEUCIQCuo8Dh4vUYpu/7mvcO3C2F1Zglazz8r9wrKDCwri/hnwIgaEQrO02pLYJnV21AdOXl4upkuzTpFngfcoOVlR93TSE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYi8PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmob/w//faBwb+tPRa6ZMdoz49hfBFeREr/MZBXqv/JfjNzu0OOh9W5e\r\nmrHH6r5quzMfoJIV6OW44u3ReOYJSPDjab+FoU6uYCJ0A4qXuGoYPnxQEJtB\r\n9aFM2sykqJM9IkoSMaNOgbMdJi5XE2znUbUroBlhGl3F+mY32iaGpILqH7BK\r\nNfXRtGUPqRLV68etLp8BGG9hcWh6B2BDcJGVic0DxHK0rx9I5v3SBHSiLoMP\r\noR8Xzs91IU9zC8JXoboPcJF/IDUKmamLNzAjfowZS7cijS0KVqncHWqJ2CBD\r\nLrLrechrKu/Q69OVi93Iz4RTCSYMdm2K1zNlDbKnItlpGzCa3JF/IXHdiqrm\r\n9lgk+1A5CC+1b0wsGTK8K/SZVf4+9e+Wbfef4gl+19Xzem4qRMY8wvmxd97c\r\nQgK6jit/JuMX2fZAW/Q5pmmfYBJGHP7bRwAwx7Zd6hyixX54COINgEWfPj7g\r\na51ZGDJKBs1V1bsZXgwv24n+8aNk+f+vzL5h/Hxi1/EBE+GfC2jcD42yIISL\r\nLz8pYoZXrnkGOaX6Xd8zRXlrryqmZcp4vs6gjD8omrcteOmmX2Gbvv7Yq+3+\r\naeax5aJOmwE+VI9Dc4k/4qsqbIkE+pvBkF7QvkelMPy+gFIpNtYw8lFsxt84\r\n6nPbMDiSHM94xSVBk5UNvuAKHApgzUeGOCs=\r\n=0wqJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"21dabda134f74e7b7530ffd57dbfd5ca57923dad","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-21dabd-l9zedcio_1667378958923_0.10661103028319441","host":"s3://npm-registry-packages"}},"4.1.0-feature-baeefb-l9zha7i9":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-baeefb-l9zha7i9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-baeefb-l9zha7i9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2657b61fb903f1ed31f08993a2a166d9a8ab8af3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-baeefb-l9zha7i9.tgz","fileCount":159,"integrity":"sha512-UhK7UVwZvHgdSGsiT8Cbty1sHKSAFmlsQVfryaBBdEkWGi5FOIHIxcYCYoVfZ28EiD8DiEa3r5/e5m4xV892Nw==","signatures":[{"sig":"MEUCIQCmHmw82Tf9zC/af2EYgimLBvo420rohxV0zvNzoKn8mQIgYXRwYLsj1l5Rv+NLk3BeGSqeYaastUnMyX+FAz0O1iY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYkIvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoptw/9G0c3u9GK6u0QeABgFN52OcTZQDzv2lyjZ5Cg4pI/OqSwC+Fs\r\n0Xf83haQkarTDvqznaj5GGURLm2hQPRqTHjkgf6PamDGhl4DrkafpVuKBKkN\r\npPnmsTevuh+9+SDE/RNw9zYmQAzU5EexTEiTA/Ks5h+Issua3rOXbcgQ1dMY\r\nOatMm3Q3wgBt4VYgfLNtSlnh/MmVFu0Lqxd2x86KTeHjVfwl7G+q77g0yNJb\r\n1B3GZkyc7ya1E/fBQ8aUYgUZx1JgEOG+pFjvIfJupP3qct39CJXV8ivwxZoV\r\n3oB0wnolODL/zBuAxLMBQFad2HcB4e4OEhpc9u4ZEXbNtbMtkooh5qmloTH8\r\n0OIpzRObHThdRpmpUBvWqcWBTGnDmKmRrKPrLx2BgAxGxxR9gx8coNCtq+xH\r\n4LaAhaHo0PsZDa7xnstqMbo1WjuwpQ/fqaELNZrbzyPChFTaIoVOiit8VF01\r\nVatsyFDmy4V33A1mb9/ywbwO2juHp+FhEW90/jd30sImDN0MoszeBLJbqrE3\r\nJpbq2iw6PGAi0a77o9UwRGBLIH2NVcGumAdiSaCx+hcio79aUTIZxThvMVeV\r\nSjDb/hT556WuotBjWRo9a29eM75SrEKiYX/bLu/HA7Jfaat2P9nIKGB1i0CB\r\nCyGEcPFUoopEDyGZqoSaHrMqMVG274ebcKo=\r\n=TeW/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"baeefb8e1d11de96b201ec857480a6acd7d11104","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~ehance_extension_expressions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-baeefb-l9zha7i9_1667383855031_0.47820062004087394","host":"s3://npm-registry-packages"}},"4.1.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.12","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6c7e64771781cd3123e5c98cfc2ad9f20dd117ad","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.12.tgz","fileCount":159,"integrity":"sha512-DOW3NK0EpsmvSdm9eoF5ZhDOm+Zjht3StRJa6BkXr+WCS9N6cTkR5V1sK2/ykmzFxATaxPC+gQ4NA948f45hqw==","signatures":[{"sig":"MEQCIEORW3jvKtkYlX1R6uAxbJOW++dBi1blb8ww+PBQl3poAiBqbZFDMZfR9bxelEXfrawJgj2Bo5jinPOtih3Ra6UFNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYkKzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomMQ//XMVV+1Ok/G549mtlhzX1e07RszmIrklN1RH1gHuvoRKRLQVl\r\nKhil/RHzsM7TsOcBA/ImDTwJVofInz+sbUdj+cM1uuYAMXxVrJL7nDAMLqbZ\r\nB83OT5HF3ieYddhC+cbr6EFjoifcqWApbRZ8vdoSWDL/y6jorjPd/uWghEAl\r\nOSX2K5gG9zbATb3yMJrB0+Hr6w9xDOWzEhndUarTxD4ZmiH9RR+tWOgbwrBH\r\ngStCjtmbaLWyurLbHfA86+w7CDPvd8AafabhYom6hJXyFIy0LXda+mndQroH\r\n+dY1ocvKuu0MCPB6tTxT/J/yr9gFt8E1MygzRtqi11VAzlELT6NBMRHasdv2\r\nqYvx0iYDR5quXA/BNbej6ci67X45IRqbCvnPzlF7fJvDu34U09CZpNgijKaj\r\n4PNvGRhgC2WALpS0M340vMSU3AplBXUIXF+bGzkgEnNwQMSlBsBTPpUexdMS\r\n9oM3u8SBfYjQ1ClotJ9N4kVzOhYQk/d0nQwyJq8dI3hrfG4BF/afHu5Q9Cij\r\n5Zt5NQgJwS264hShLwZxg7Wtxnl3XQv5YFEvdhp1c08SE+eKL61+/SMfpgGP\r\niqVE6OhZdiiPvC1BEkBsoN/HtqvlPEnB4DZfG/shmec2n+IDja4pUoVlg85T\r\nBU2sopSdrTHX8F5KFvABZn+ohLa8DqvlyUo=\r\n=lZeC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"26c23f471ea3a99b6fa95341d75aeef9f18e1d5a","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.15.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.17.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.12_1667383986938_0.05615438496772329","host":"s3://npm-registry-packages"}},"4.1.0-feature-9cc08e-la0uot0o":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-9cc08e-la0uot0o","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-9cc08e-la0uot0o","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5a6694be478e8fb900fee96f1071bf34a8666a55","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-9cc08e-la0uot0o.tgz","fileCount":159,"integrity":"sha512-OUNmjpZ/A6kMcLxP1laLAYXw1hsMddMJ97wkzrXE0O1c+pnVux/D2tDCIZ803irthZfxAOoRvzjteomWoR0xsA==","signatures":[{"sig":"MEUCIQCS27aijKHreUq9ZTYgCMo3wuQpbsYDq1CJ/DUwoeoUSgIgTwXV8xlBfn2K8OnTKSrFdPnfcT72bHAtvn4B0qO6goM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY4ZRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJgw//X0E9Vy0nOZd3X8HrFrRRpRGJ2EQvzpsnZ+k1n+H8ifOvrXL5\r\nGmi38PQLyj2UmR2dzWpvJzFfx9wNEcBkGfh8vmjB1ngpWxAgU1qdEtdNTo/b\r\nG7+nU1yPUY6WGsfqTrfz2vnMQNHRMB62pGnW3jvNXfjUBG8UJjwDoZN+m0bM\r\nDBUiso2eUph0GMVMQQibGejlrKMiElyWOUkPYQD9sCAbQhhbo2LjZG3VG3Fh\r\nM+MAG0FxCRztKFcQLQZYGGwgcsggP8qLPlKweNliGL0jxlFBRbVq9H2qnXH0\r\nNrvsfI89yPyNLXWfITX+c8meaY14hLmOnorpZjOK1v+1divKU6MtNk0+IJyS\r\ncHT83RLeq702NAcvD+m7LTrTdlQHmEV3lomce2fgNmFOBy3rlQyLfmUvzlwe\r\n+x8wA7DnRamMeh476AxRgZgl968mfTN5ZU1mAoRlbtv77t4kcju7ZpTUBki4\r\nti1f67Spx/Z73Y3t9iiR+N8JJPvcQr+H6WrYHx/2/4yOFBur1f36lAgT761r\r\npAEyI/4gcYi7lm7N9uFRqcnnnbcw1JupGxOl6/YkXEu5E07FKAsVAgDECZwh\r\nJBir7KcVcGtAMjph8eJjV6+Kzy4afGx76PgnqI5tmCUA1HfLaYhY/D/5vz7G\r\npaA0ktl8C1nnI0/iFbIOd9Wii11LtTDqHGo=\r\n=CNYh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9cc08ef652ef09eebeb863be38157d99dca7d313","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~ehance_extension_expressions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-9cc08e-la0uot0o_1667466832952_0.7534707016048692","host":"s3://npm-registry-packages"}},"4.1.0-feature-d21198-la0vasco":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-d21198-la0vasco","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-d21198-la0vasco","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"160d2986c80fc7f844bba189d8e7bc606cd80cdc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-d21198-la0vasco.tgz","fileCount":159,"integrity":"sha512-O6r1FDahEdAAXN2gmyGcvngqPPfx+gPXHNDfxp86Y6CAjWVAbqOk/6jlx9vdwDfjlspxuliAbLkgZJykmqMjKQ==","signatures":[{"sig":"MEUCIFIzS/CVhjtzrA2p4j+JJybhJbvxKlhX83uPnXhxaG0fAiEApPrD/3Mh0PstpI53pZUHeSl8nFYec8/dAqFZB9NFHNI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY4pSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolRw//VWx3UVtwOsYqJsWQ7ZImynTOoqrQtAAdHNrvmd7ru2HdbL1r\r\nUHJmQSFcm/7vKm0gkOksKwpGKF+oEW80YJkveJ4QFwNGmZNgwLAOQD6LLY3u\r\nlvFnGKqpiggi5eQgQuzS135trQk7ddsL9FtOUgcytKQ/ZzJXjan7eK/ZVeNT\r\nDxbIH89/mZYTKSRPPmEDgSIjAcukMePgjfGNWhvp5HvaTHtQsmzYOqiZRS5R\r\nCM4hO577Zb79Ie1tBcbwy3YRjnK2u+ZihPlEa18ri/fO5uS/GoWA75BN7V+R\r\n1UObM8JzAKiK0cYZLrse8HUM6cW8V2YrPqyP2gQmQ4fIfYozZeKzzEw14Yo4\r\n8Hf42K/6xXugDbou07pJDIup+LjYGYDvaVOaLj1/yTwyT42I06eUA8K8PeD0\r\neoHNaAv0MRMjUkrIXS1HfDfihIiT5RvFcDUe6cXDpC8WApnTJIsntqYjyJTg\r\nVzvQQq5nxu8l0YFI1e1OfuG9FmHLYc1HNLlsJONDYU1JvS+WZhS02YK89qH+\r\nyUVaYkZQOFKVLTN3F7lNl4+hrF21Drsbk3kA9slo7W2o7umi+6Sy26fCR2ou\r\nRPxI2tVyIN2UbqHBD6CNBAAS/L58STbnuSi6N93rWoKcj/jF+UMpqnO8gqz+\r\nsWZp2x4asyHa/J1MmcLFK4jA244wxGogEX0=\r\n=8V0G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d2119864234b3487e5d831e452e4c778c077ce10","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~ehance_extension_expressions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-d21198-la0vasco_1667467858431_0.41061087641010197","host":"s3://npm-registry-packages"}},"4.1.0-beta.6":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-beta.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-beta.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"af45d6e1dd27882b463bd7cb5ddcf98c31dc13dc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-beta.6.tgz","fileCount":159,"integrity":"sha512-Lby2S2k7xyCAavwRMOjOsr0fkYXEECMZiec12Wzqamah1FTBvO2KXa3FKaG0jciLXf1PtW8hQ2xZAYCpF004ng==","signatures":[{"sig":"MEUCIATQMddLrN64LvBAQYCP6Rcztw4eVqHSzplmszRJULopAiEAuI4ARXWZ9OxzE9ji6uSnpF+01dbdkFmZrqmNcREIwCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY4uaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPbw//cSiBqeWx6y42HV9O5GsqRRb6u4EgsfBJPGDyA7Y/9j2OGQeq\r\nQLsauSc3PCQdkTVM/vYuKZjPeUsNjuiQ8vEB+kXJXkYEUzzrikcyncgXMIta\r\nVh/GIUge4VdOPDg5ldTUTUHfnp4QOsNYsSYDZaZoqLIC411gothqUq1VhI16\r\n+pVLuqug9mKtIPb01f3xs4cg3rDmB785SYoI1HbDWM2REbCL93n53FCWaij1\r\nTQZrsf9J5BGJW+hCu5mg+j0y8bP+V9vN8WVcO/FUe3F4O9nTqWFLxy6l/Fo9\r\nhfZedP+D8bIghkJm11K71frJwV8/oNwPJ4CWOjRzArFAXFd+DSjwJkFf63QQ\r\n1u7JiuGCJZVTQWoW7AaZliQgkQMsMwlWmZ9xOzMAOyUxMF0mkLJCsttIq+Fq\r\n5V+cLUEw3Chfch5uXHdM73pqAQConrQVSkbNdjOlF20toLWSUOTWUG5KApJu\r\n4Ei5hmlU9xzciUNrbZTnH+U+6yP72ZaIDS9UA5RrRbaee0fqj7vhGx3KB8Ih\r\naW09bfFdsGv6Gk3bLnmHgccj284jq9XuJ55VkxLc5YQatQ2oDdHp0H3+ynZj\r\nivQGxbB4SvggE7lS/OpPLrxb5/6OdtRRjEik06txhhk07tY7ucUjzxjiRWS7\r\nm6h629aVzQO23f4dJAmFWSLxvwzNTy8KoaM=\r\n=s5Nz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"54477f518c2653e5755c9bb87928cafe687576b3","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-beta.6_1667468186146_0.39735155164413527","host":"s3://npm-registry-packages"}},"4.1.0-feature-6a20e3-la0vynb0":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-6a20e3-la0vynb0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-6a20e3-la0vynb0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"93bced6d0e698e7d5ee552ef78e56aace14b5888","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-6a20e3-la0vynb0.tgz","fileCount":159,"integrity":"sha512-3PMVmrgl8YztAJHx4SrqocDBFvNvJONQeYvmDiSTjAi/hDIsqH9NUiFSLbZafJaYVAJ1wHTvOfMOk0YT7K3iLw==","signatures":[{"sig":"MEYCIQDbg9ceyvSs9KzjDsXowb5C+QzeTk6KGDyct5NxXEO14wIhALIYnSbfA8hya9z6HHRttB48xu9QSAeih+IuLs1e7PdX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":521964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY46rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq43w//bNraX65V1/M9aR1bYDa/kYkyubdGCxJWQqRrYgIYJdpTIEEi\r\nFDiEjZp77R4MCdsWpkrKqescKEt/p7uoQMhOVVOuTWoQiy4CvrNfOyqK7xS5\r\npfsar6BmyQ+ghts1D8I+ltmdlEcsi89bmgGIiK+4ePi1Mk916lIe47nFB7gQ\r\n0QXJ3XUyCktyhwRvm5sJxu7/dEN40zTeUOg41awX7JTQ6nai+ZsPCnvanq1X\r\n52amPpmdtpiRhXRC53bdOtiFZFiB2TFtIOX2FKUhnvdNjCbTBoXit0k9FvFd\r\nMVE1uJRKbNphPrrHZbids7ppBPAQ1Ei6z8CaoD4mj0ntf/mmK8FFB06h8LlY\r\ne8lHvKKwC9sHXa6l9B97g8lHqJxlaVarSRj0nlMdRKLEOFYJemKkIfFF9R49\r\n4PYVhj3o4HJlwYOk1uENGni5P7PIsWcZ2Rhn7RSn5x5MOldProzxLD5rQm1F\r\nY7sqDI2Yw8QcsxSDKIv7ov6k8UulS7sMAVj0D5YDKbkqXIx7s9pXXWDqhS+G\r\nyQWzit2akDb9Z+LTIU+t7tJ9Ejyap/8iM0IhlL2/MiRlgxH1Wx0yFQO50Bn/\r\npdDOLtowNFG5TeGPGg9tbmZTmcaMTQIBtG6B7q9V2mGkWU8fOOHVk+uFvqty\r\nznthYGv2pTXfdHtz9z5U2/DklBP2++ba7s8=\r\n=tFbc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6a20e3db91f510a03d8e2bad9deeb02764ea9c65","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~ehance_extension_expressions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-6a20e3-la0vynb0_1667468971532_0.6959170052343828","host":"s3://npm-registry-packages"}},"4.1.0-feature-803efe-la0whqz9":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-803efe-la0whqz9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-803efe-la0whqz9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"813fe494dfc1a1646c86c0dba1d3382ff9afcbbf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-803efe-la0whqz9.tgz","fileCount":159,"integrity":"sha512-yrFdgdtY7jl+TngU0Th5kQLzPNeU+DGEtIHFathZPF+UmBYHAvpeP0HFkEMyeM2nYNaCLTMt3r1clowgue+gUw==","signatures":[{"sig":"MEUCIBUfp+L5Uh44ee4mS/YMiU+DoOi4SJrNM3oJulQ8brYKAiEAgqy595WU9+al9Q2R1Jkq6hgZ87vrsKZVN4dJpeSXHWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY5InACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgUw//cJNSeA6eLosiknfKt8xnsjoMNYz09NaXEnuZ//cj4EvTqZHe\r\ndVE8e79QO9iyPHIJFWwMzNLR6eOejm3eJIHGwkD/+b8uMksQ2mrEL5IC4Exq\r\nzYn+OvZj2KA3+5rYUctBplZen8rjBdJ7N0aNadVDwbMbnWpf0Z3IBywc/kD/\r\nGdLspvyl1rXh2okwq5kcUL9ZkkASLSxmMUoRU09/QHCeBzYJJS2U2Dhhj6d2\r\ngQ+BjgeYTLId+V6zqamVAWivzCCUxw+Ll1kiRmIbUG+8NlUuHRqS2odWq8L8\r\nm7o0jZtm7aROmnM8NqEVfKHkxk3HWsg+8z7XTH8MIcfJbLBr7tYoG/oGAS0k\r\niZzRSf4LQeFPytsnqh522R37et6J/DHDgtELqSusls8ZOQAZWxPXbKgmdVfc\r\nVh/cXI/xZWO13XJyTw69cOKbDISi4BhW1DkLh48rx1YIqOzZv3486ewLtxht\r\nNGyiV6ZB5zykqeSUBGA3fz7TBD+V2gryLagto1Yen0HPxtSeebMO25YI5wXB\r\n2qNEYGzQGXxcCBch4iGjZsNof/XePRmuAL0p4AuVguXYk5DgR4aQF6DzYj2d\r\n3APKh5iq+uDVT1BmZb/Ao5hOVDXWOcUeGT1WAJ2QXRjsF68U0sBF1exhqvTB\r\nWyElMrG84S8/k/ivvjYmsQT2YUahax6jvDY=\r\n=NVxu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"803efe8b1ef52400fc68cca05aa6c8feb1b2071f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~ehance_extension_expressions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-803efe-la0whqz9_1667469862829_0.5170518707377056","host":"s3://npm-registry-packages"}},"4.1.0-feature-153458-la28cjxz":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-153458-la28cjxz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-153458-la28cjxz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7197bfae3ca172c0c84988dfe2ba409e62092068","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-153458-la28cjxz.tgz","fileCount":159,"integrity":"sha512-QsrKvUSV3smrAtyY8NwAuX/DSaSAYMViXs+v8ggp3VCAU39sy9pG0BRO5WnxElJd3mgMW9dv+/vmhWm/boaqdw==","signatures":[{"sig":"MEYCIQDPQxTQDMr2hll4ch+kdfpNut3eRbDKqy9+uCdFc5w9bAIhAJPXDV80+RgUg87XttH08g32fII8RnSwJZgjpVBzyvcA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":502265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZMwdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2Ww//ZfLOik0vU0eVET0oJ9hfVMwywBpz0ICLALphL3HZhTHAuVf3\r\n/877G3nhR8qF1Iu94cReFFIy0iR2jnO05RTF3mPrg99sa4857ZStIjUpzQ5y\r\nMBc5EBrxIi1n24IEo/lgvj3Qbxwfxk4CEQ1C77lME+ar71otyGdWLj5kxIm0\r\nZd+e+NiwU7SxD/MSUmSvX1g7WdUmKkrJy6WGabX5lNW1BGV82ql2lGMjvh4m\r\niVtZfrUP62LOKWC8OertM2tip6eyH9/AA3v+NjHAs0ze4bkrkfi3GzLrf60j\r\nERQE5Wbj1G/GSM8OwhZks9zByfNcpyc/3pBgRY3HxrDEjnGH6b4FQNwMw0gE\r\nb5TcRInkM+TzsFsxgUw8QO/PuEvTBotM9CWxog8jelNBw+JtdNmo/YSw8RLX\r\nsWIBL/g3jQ9DzKY1BZYxLeqddqhXUaGfRqzK8FkHYxgiUuGuxrYinPGQUzP6\r\n9jEuQBwhirmp8T9nSmtRRs5OKllQORG76cZtSnohFtwbsnyFyY8r/lUD8Ab5\r\nlsVZaYgAc+QyD3T0ZD03G/9RHMs1UNf3rUCPhVMM+EBDha/mB10InrsYAGhU\r\nzUinM87PYzD9xdxA0Trc7k3e3ykb02ANeo8RFPJwktXqBttzSbi0EOdconMc\r\n7IATIEti8JSPhZZmtEapyWNr8LmdcyM1C5A=\r\n=/gF7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","browser":"dist/es/index.js","gitHead":"1534588b144e1df2b1744cad0ebf9c4a7aa09ca1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-es","clean":"rm -rf dist","prepare":"npm run build","build-es":"tsc --module esnext --outDir ./dist/es","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"sideEffects":false,"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-beta.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-153458-la28cjxz_1667550237652_0.33198398142651797","host":"s3://npm-registry-packages"}},"4.1.0-feature-13d52f-la28ig70":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-13d52f-la28ig70","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-13d52f-la28ig70","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"21e5d994cbb0f723864ce379a1de523513baa34c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-13d52f-la28ig70.tgz","fileCount":159,"integrity":"sha512-jbaSPKJWnLHASORaLlXBAzeHR8o2xRdBxcDFdnF2eXWGIlvjl3j0Po+EGK54EGIQhtLEdsr2+McHaORLEPofTQ==","signatures":[{"sig":"MEUCIDowtzjabeS2AifUs/z9Nq3DPNTP5nXaZSspc32dJSfhAiEAmuZuKPaCT9RZfbVDlmwoEeAO7xE4LLGQhoDjRznkVNI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":502282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZM01ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoujRAAlhyYcUhk/wL7ITsYHTD9VUqa/u+uQ4jVp5BxJx4c3OMnNZJd\r\n8iCc3LQgJ0siMsNS3TFf4mIwo70qYIt91lpowhIlbryDMG9B6eLzCt32EOJU\r\nuzwRch3nCVkGA47UfmGIB+jA7m8ieH7i85jI+ZLhTwMY4oL1MLTJNqiyRpGD\r\ndH4nD8vpwyiFvhLhQwj6ni1kBdL0SJzg0/41Tdp8Y2N7ZrprUbkh8Ib/x63W\r\nKLBgx0IYzr6IFLG/YKAObJxNviTIaFtWgYTXz/fH4874nNUJT0atQzMoA8PQ\r\n9mF1CmD05YCk/n+HlgvqPfxPzQbFHUfo2y7eESHxw5L5rROAZQuq5v37bxDN\r\nxDmtVoNwgEgskvmvcoIuYCMJXndHFKVtD9LigkvUbpk+jM4Xvqz4JRQ1qM79\r\nYsGdhYQeUyfSDrw2FKFIA6jo4yCYLht55EgtR/3cIixD0Zt0fb865+3bhiTC\r\nCWCDOlQqpm9RJxpXAsFafYYDT6wzGasD79xkp4s5g38mY4/jsQENuco15BjR\r\nFgSlaZwRcCrkxjPVHj66glT9/WV8IIz26Bus+fPflsJcD4Wrs26V7ReMDwrt\r\n+9yb3TnOy7CszGaNmCB3BCjcRZnBZs5EalJD2dF8EswLUiqKHPLclJP8EuE/\r\nSg/SWLD5o5+WqNWIQs6axLaDx+25Pzi5T/g=\r\n=CCzV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","browser":"dist/es/index.js","gitHead":"13d52fa30852a8e59f53ef107d7691511e059c1b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-es","clean":"rm -rf dist","prepare":"npm run build","build-es":"tsc --module esnext --outDir ./dist/es","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"sideEffects":false,"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-feature-8791a5-la28f4nd"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-13d52f-la28ig70_1667550517290_0.7162426858782902","host":"s3://npm-registry-packages"}},"4.1.0-feature-91d658-la2hapmj":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-91d658-la2hapmj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-91d658-la2hapmj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"07fb7b957e0aef8d7b52d8ad64c545880ab66737","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-91d658-la2hapmj.tgz","fileCount":159,"integrity":"sha512-jTrfeBg0bs2uEqTH3Hrv4fysHzk4aHXvOVIqQqkMT4tomDq+VWxogGcmA25ZeUB22i9u07P0cowSNs25XzJAUA==","signatures":[{"sig":"MEUCIC+pmgeGd5v50l7jkvtPgDUuNArFAvKGmAXu0Nh4qV2AAiEAtEpzTv5AGG6JKw1r2SMnQUNIXszPmr4r+njrW7pkgR0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":502286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZQbUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbDg//XtNQv+GJqDY8jmTCNbJB81NN9Mdt5X620XFlqkJmFKaK55TP\r\nRNnf1DYkss2Q8BK2nEc9uiEWtbPXaBq2jci5BiXaENL9O9w9s+FTsTPgNk4X\r\nFNx+Tem6hYSad8Old8iJEmdtrBqXVYi2cbKXM9C5dmYqPmIps1c0opqwARpN\r\nLYB/QmLznQr8oM7x13OxW797gQyFT2bEp/IjjWjp6oTV8dmHm53c/oDcNPtD\r\naTTurqpLdB9Cp2/PduDqo7i6hX3Hr3/7Q2ZaSnJMocGDThNq+1jpcTZ78Hib\r\nYpUo6UOrNyvMnVkVnjxrpPhBuK6EhECwYd36RrugT8TADUFukhE73gmjci5L\r\nDdwaifM485/0EnLyJrRrUdr+yEy2ZN7KUUCeLi0yZpjmegd4axqwCle/UjuU\r\npDzqDp4mH++pzuPUJc29O9c7CWL/2QEDoV09UuAa5GILjOWin8wBtdO9GQqQ\r\nE86kiQetBMcZtcp8o3jk08V86Ofu3KF/PdaUid221Qxv79ZX9qgQvwZmpPYd\r\n+nZsLGFKr+4oY234+obxQOZ7JDy4sNH/FSp8IGJX/Z+mlg6yjsQ86JKWE2zW\r\nMseEWWWhC35TKFY00DabkxrhAex2Xlhkc6MU3cskprYWZYXA8YfpuubvRPZY\r\nbZyQmnu7yMozpfJPTEsbuQWY/mE+84W3agM=\r\n=uZ4x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","browser":"dist/esm/index.js","gitHead":"91d6583e8146553c62e304aaaf71705353dfacab","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-esm","clean":"rm -rf dist","prepare":"npm run build","build-esm":"tsc --module esnext --outDir ./dist/esm","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"sideEffects":false,"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-feature-a6372c-la2g0xj5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-91d658-la2hapmj_1667565268214_0.8728944386092723","host":"s3://npm-registry-packages"}},"4.1.0-feature-58d275-la6ittuz":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-58d275-la6ittuz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-58d275-la6ittuz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"faed23b2f48ec6915f0dde89ce9d3d172fa70a5a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-58d275-la6ittuz.tgz","fileCount":159,"integrity":"sha512-CEiJWGrHGsWpcSk99Ob5LuE61OWDRqb88gKm76KNOyBRiOT3/AtOhh63ZV9c6WmaAhG0XPqM5syIDzymsuYUIw==","signatures":[{"sig":"MEQCICiOaQD38MmiLcfpHpECM3VJn4nbbNIoaIpBu7RYO1BfAiB7mNAl26ewURCbcjdr0WEt9dGf47UBqfhjnvQiVaAEHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaMGsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTXw/9EM/jHtwy9YEPf88JRcOT9NTpBYQgPD2j2qTl1HF7HJhhvczW\r\n/lobEhRVZ2jm6zhOJ4/glo4R4xg/DLkt7xwEcbPtbPLGg74/LDvxrUjZkyyz\r\nuX0BwB5Ca+jV0vuJ5QhkzNivIh50/ul2V6DJA8wVwUyEbfONK5F7xUGtO8o6\r\nu5xJ0J+fN0VIY8BSpGOXyucNV+ZYDFqNEh8zWeIaSme1obOJSlVQp4arU6s8\r\nZjRN9W3jeGsel2QokP6zUbnIm8MbikoRMnl0t4auWLUQupFFMDDPtgrFaW3n\r\nVF2HtVUzXE02yozFf3awtp0XpZ+aawxsAaEqncgVO9G+xQq93MiooaPR8gBt\r\nnXsIGO2FXpn+QU0xct6M6TG/o7LeujDXX4vw5ahSHkqg1gc77zgiuvNBCS2Z\r\n/TYhxLU4MV2+5j9w1OG9dXmGh8S+/O3w8lDHGShU/ZeP3C/b801Q08Oe66kn\r\nyYSXUu+juTgPNIakZcR2/wNCuig6Nhem3ixrrzy83s639lre6EH96EB7iosz\r\nq46Tgh89Y+aOHJUVSU7dBXxlJlTCX8bwqoNKhKEDutgvt/WNdLiWHSqFtOC3\r\n9r7/mYqb/PbPxoMTwiP4wGCALttL7G9y1wNOfxzqP9jeG21j7OpJ4xQhxQEA\r\nDRHeyDv0T4PDvrd7h75PgfGwm3QYFlplqME=\r\n=9bqa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"58d275374b7cf62d54ff4e744a11995416bf1727","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~improve_loglevel"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-58d275-la6ittuz_1667809708682_0.3241477754566857","host":"s3://npm-registry-packages"}},"4.1.0-feature-55e9a7-la6m0p3l":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-55e9a7-la6m0p3l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-55e9a7-la6m0p3l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f9aa9067c37d007c4559bd792526a04b6378bbb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-55e9a7-la6m0p3l.tgz","fileCount":159,"integrity":"sha512-zK9H6jdsU8BM3tUpdgBPoNZ+IEI5fvSqqMlCttIaMmz8w6U/fhoeKCkPjhmBJTtzQbHcb0+Iqj4m6ZyBoLw3MQ==","signatures":[{"sig":"MEQCICRP5XhIIJLAQU7IMU1iJv1ct/JjruAmWR6bAdVFDGytAiBfX9KD58btDlQ2AuSz2BgBfK4M3UManX42dlN0JUAcxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaNaeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZog/+MEyQ/nobr05xSFnRMBioNwHZgFBOmKtTZwy/DnZoIv1oINSV\r\nd2oC6uCWg2c4wY55E03wgrzzmvcBkpvz6uPDxP9FY/ZBTwdJITy6YYVA9Dix\r\n+48no2cnYFEavtUqtVi5utJNYxkc0XBgut3QZAyDcY4ED8KWx6t6T/7c69kn\r\nxx1NmVuD4K5zUOYRTTI9A0yhJyQnTNsitmf7z2sfEL7OoZqrwy64BDmriQwm\r\nFOozWjyddQX6RGq+mimtrLt1RwvXeEJbWOCfYqnliir+nKQRAdu69tE7xWQJ\r\nrVC3CaGkmn10Way38h2Vh6cYfLzZNimxBAXneKDECD2VkCC0u7bV+PGUeEo7\r\n0fIXrTxIGi/r1g1UgxkiT6e30JlhfPOrsjTkDNCeAJQPuw3IIMAj/EUbqkGy\r\nuYTYxac4/WNiez6eFfxe6PnV9ndBmgkJrKFzstZ+X7KbWCUufp9Sbdq0M3Qh\r\n1q9Ve/mxTdM+3ZuAiibkbn2XVhVVOACrr/Ypd5axVSZk+C0PXPVwVVgWUghC\r\nOl0YH4ajqzipWbEKTZvV2HoVVpsRIJsuymVVTm1kHLny+wpCMQicmIAOD7nf\r\nN8djc+ZLQ8uSvCMBPEITOyz1QXSmq4TD2ru22VU9RQB4pIK8zxrZAO/+0iAr\r\nud/pMYpcRQfApCj+2N5RqyzcmcILKq1rVf0=\r\n=OjV7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"55e9a727a7b9c9798fc31c5dd496666c3da27231","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~improve_loglevel"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-55e9a7-la6m0p3l_1667815069886_0.4772641477148547","host":"s3://npm-registry-packages"}},"4.1.0-feature-e87fd0-la6mirbf":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-e87fd0-la6mirbf","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-e87fd0-la6mirbf","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b37183fca51282a63117cb4ff4ca7233c3a5379c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-e87fd0-la6mirbf.tgz","fileCount":159,"integrity":"sha512-DiNnTW+KhlPOOjEzVObfEhafpOhnY4q4mj+G0/BbKJyvKV2R/UQOIPienveW/ZMi84lriJPJrSiEchoxRNiJQA==","signatures":[{"sig":"MEQCID8VxPJYrwHNUQtWRXdzIE9E+uR2aRnkhafYKB14FfGiAiBRI4S02lt6qoy52DGDGGEAZFv4yKuf64JyTiDccVUV5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaNnoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUwQ/+PzdEiX6eqbLOhf4d/mfb8Lk2wODTVWBstHho1OhoZPnftmQI\r\ngXyQ4MoS0qZGuNui5zLyRRckVWVKF8h1L2WWPcNZxGj9easaOW1s8lZLilaD\r\nuBKcMXSqCbEKCj93Ycf7LTr1q5QNX9Mnoc6M5dc8KnW+ilUpjZfEsB+6ujqT\r\njNCNf3NrhJojGifyK7M7Ip5TN/G9HO1y8KBUFybzGHw/PfA+UuTh1cdkiQNw\r\n+/AH3nzzuIGtUqhsHtXKJREuFbbidv9Q020Pb/T2WzxlOgbF/xMOyg9Hx6C3\r\ngjSXj/XdLW/mPiFvUWdyBXpXPjgvzb+RxQfxLwuZLKvpZevjR9Da1gYQBocU\r\nHHE19/7D81Yv1+aVyAZveW9vgIkIjM4oPsF2lltS7eSS8h5GrJWj9z0l2rlW\r\nFeyshjT0bIW2ws5xGnCiPgW1ZcNBTcl9AzHOTVbSk42Ky1qzYgYlLCo9aWNQ\r\nmYp/kiCTjJSooVXteAS2W5wnRMbc3n2GYUhQ1+BkkMfoByW1S81NEx5S2rAQ\r\ntiq7VsGG8S7v5TyGu5m+q1OHUG8lF8sjR6MtBeAnh7xDObFH/ubSuA+RtagR\r\nJKDxdM6QbMn3OA38XSLt39WzmAfGWHfwUlRZSCoN+nuKZWtY8W2dRIq3UQvM\r\nMswBcolk7dTiX3FNSBc0g5g/FEnR0PCWty8=\r\n=kDLG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e87fd062b3bd1c32cc5c31c617f907c8cbbca3fe","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~improve_loglevel"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-e87fd0-la6mirbf_1667815912594_0.08415113440812827","host":"s3://npm-registry-packages"}},"4.1.0-feature-98dcc2-la7xn8mm":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-98dcc2-la7xn8mm","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-98dcc2-la7xn8mm","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5a72ec2f1bf7b9a70ab606d10fde6278d2e0e403","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-98dcc2-la7xn8mm.tgz","fileCount":159,"integrity":"sha512-bRGimmiaaLGw+CGnnkisi8yorIVC9zvYY27ljPLm1mAG3kD1kqllaxoqmYgUaJccsyeIxcvaZvFE78MXuBtl2g==","signatures":[{"sig":"MEYCIQD81mI/ObcRsRiOyZtNMM/j0pbTUHvjGNMQAxKz3p8EwQIhAL2qD15CCM/+BwH7lqoYWJrnxHHpnh/DcJbDRBPW+6EB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjag8bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmOA/9FHSvx6N+Rx9zf15yCkVPa1aX82m+cHCp0pAbWgbIzJ69Gktx\r\nRB24sLko6nzjqDPyxo9Yz0LvBqJVA+f4pJ0HgFI1pfLZsBgacNkb0G5NRWG4\r\nQLLsZqjV+qMBQpGh5+u+rw/qDOOmbW/uYCq+6gjgvBXYrlK75PvpdJGrXUO7\r\nGq5xkk5UVFxrEVZLWtdxsN/gn/0yXO9n75510NdSnL8FgjJQ7ZZVEa/+MEr5\r\n40Ua0lGib24zYOkkgRfLZM3ww0iQ3KNjoLmUobrUeWsvrBUUZhAJXd7lZzCC\r\niZVKyvsmYaYYZgZiFgsXvYTkKuPg+tioweEfhzKC559i0YN6DiZLVXIrxblP\r\nlWczXsE71oVgH5iuzx5qqxV++31grVfXhp82FaT3DYeig8qxYw4/VMgdx9st\r\nWAmKSZLhX5LWW3c/xor3ECFl6yYBgeNE1lFc7bBNGis1yoTsdy9250TEkgEr\r\nVL7II+BDZndvETWhIt+AydZPiKjztG7HeNML8YJ1w2j6yFhFlBl7CebSqMuR\r\nd024dFFRy6jXuIGFlnB3+YQnJ98p+d3RsMA7O7oncx7p1LpZ+6u2A9PM4Vjq\r\nYkTof7MTyzqXIXIkuKZPixV9803IpTa7J68jPe1YzrrQanej3WrypOQohKvH\r\nVHG/7B1oLHal6IbuPzk8UflIGtmUnQ8Zhkg=\r\n=GhLT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"98dcc23dfe426096dfd8e1774a747283ceba31f5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.12"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-98dcc2-la7xn8mm_1667895066840_0.14425262746146905","host":"s3://npm-registry-packages"}},"4.1.0-alpha.13":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-alpha.13","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-alpha.13","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"91fcfbb28caf3ad209c09b46d3d9b64b610345cb","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-alpha.13.tgz","fileCount":159,"integrity":"sha512-9D5RR3nQxN/K264W6xwAOszS6ZOTq7rNyOQckGOBs/Evj6IxYvorN4R3JGwzz6VeYJgrHdnjqZIHnzkhS2U36g==","signatures":[{"sig":"MEQCIEulsktkTtdvlgN6I4yrijid8LnzZ2yhSSo75GPqIgc2AiAfHi63x8TE8KS9YUIe9GdR/zXMBGLRb1KGzdAy7nz1Ag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjag/XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWhw/+O7Dezy1snrhIbPTozXwwV/f+xYJI/GqnWATaAx0+J455ejrw\r\n0klcQVhpyw+HWQCv4w7jJt8cEvLExovz2+qA8Ks+eMSSZPYyWEqD3/iuKOFw\r\niPLkHKdJyqrBlaD8hBVNfyamGPZbMa8h/pnF2j+rG8sj5+/OCiGDOpVobhd5\r\nY6ZfoSopxzHhmwsRnKWWlLP+As2DzF3C9ToHNs6Mm3jS8FugSy/OiE5HdhiU\r\nsqSr6b0lZagQPmdwfRv+yfuJWHwAdLBM9LSS0XXgbzUI/HG7YdHOt4MzJ6qT\r\nNO/IHUKRvfqKZEORe4J/wpd2/n7JxcNBy530Fg47uOOYVYDq2OhtOucHdR+k\r\nOG0a71bDQA9VPsrZUwRpDaS1GnCkw+DrRnQ6P5GoPTQQe4QyjIDSlVpI95Pi\r\nbmJbSHwxhgUJ8s+t5JXLCgGQSDW77vB7axoOtib9TUv+LwthJWvRTqCxJJg6\r\n9EbiZr+K8KoP4jDmTujz4WXp0dZRqeMv8X3JQymtQy1MkamBe0qWc9hbZ8+k\r\ndBgZ7VyQoD959jbD+8IESHfXJJGuACWdAxBfA8+rAEwD6N4Il0cKjPHhzUtS\r\nkx5A/QCw7KqJIP/UISDHG/as55z7NHMcBTvokz6a5Z+BFOcTLxaOz+JRKSjs\r\nbU1IFi8x/sRIk6DcUi6iZyyUxQ6qTwVnJb8=\r\n=SBSV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6296ca356f6fd8dbe1ca683d3e893ac084e49e5b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.12"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-alpha.13_1667895255758_0.802856024215538","host":"s3://npm-registry-packages"}},"4.1.0":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fac1004f0246cd02d99b4c6cbbc326982f4f1872","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0.tgz","fileCount":159,"integrity":"sha512-eZn+kKM8yzOWwRHMENFsgQ282ZGRjyANOuqbSSHviVagZ0ROVI7GwKemMAqaRGIqJPrKZVBBWpJFGMbjgsgNCg==","signatures":[{"sig":"MEUCIC1AvOHDBrr0/A/tYbB9jEM1hr6yx7rekKOw3TRcksGtAiEAxkPnVpum2/DHR/+ySWfANQYaa0VLZivgJ2aALP++JKI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja1uEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKhQ/9H6tn2HGsVIrDHA7V+B8/SSLFScWmG6feYYR3WLq7o+xKVsUz\r\naaOQGp86GYyPV4qxNmIEM9iaM9DKNwMQO9XozsiP47DPA3G+43kGuHs3RByF\r\nqPKIQeRT92SI+imqm+hZBwv6//Vph8g8wqH82thFNFNsOhf2f0+9VyygHfs5\r\nJscADLw93xlMXH56f5yYqCWgtW1EN9hkuD4lOLSExSGlvg6J+8I7F/CGN53C\r\nRKSgo4BIX2S98jsE1lHpnThkEWrGYLna1cPCBGTdHsSHaRb4xJehn77UAks8\r\nJ3bGGDqFYJoFYBMAqYLGjbggD8gebXoH/lvWBrtulE+VfZ/qmJvnHkxRLfSu\r\nfVDN9BMAUL6zMgLRsq2WztwpTfJaLVZj5lShiJtElztwAZtJP/zDf4W1dtTf\r\n+kr751AFLo4d3uYxcivm/htYp8UOQuuaYpbrMGyklvWyDp8qEJpv/rD8qIiw\r\nOwccqyfOOyLRDVQolDPPwqV5IyRxeZCfyc8nLD9orm0ekLz6ytnT4eiogTvj\r\neJCwR6K5E/9Mh2oIohhi74cKOqY9tiQFn5qRxi/2bDuyvIVJrwVZbkdcxc+d\r\nPS9Z0RRQ2uRSqCEv5CxYp+oqHPT3yxdYmhBRa0vc3DIiNPF4qdhAX8Jxff7P\r\nez1oCJC5zFrWhI5By+y+xTOZrBb31ivyMxE=\r\n=6PzB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"3741196eec9614d59704a63c36d1b80c9c540562","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0_1667980164506_0.6187118126258029","host":"s3://npm-registry-packages"}},"4.2.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fdadf1ae8a6e4cfdf03b7f3218bfe1c09c75f825","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.1.tgz","fileCount":159,"integrity":"sha512-B9B6rUrwHbAw539I4EETIbLLwNuClhH53nd9mr8USYQvo443gNoht5xVUjgFA2zCkFqw59wrPxhpriv5DR+VDA==","signatures":[{"sig":"MEUCIG4Gcd7ZcZX19MmnAAGZaXg6+x3JGVUth5HXuFPSqZEnAiEA5eiDURCgtHfKO4x7o4e0QAJnPBkuM4w/GQWqCNpzg8c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522570,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja1xfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaNxAAh4KrfKryyxpVwglRRVjVUVFXPoSl/gA2Hf8crOZLxwo5W+1b\r\n2hAzTkwm4ToZWCcNavS9R73c8zOENibgxtLyU8Khiw+FQlh3uC6dFN8lEe/a\r\n2bYfpmI2p7pcPetUIe/ZLwzv6w1qFAdRoCdhI+RcAmpMZr4mgGVHrUcDjwxC\r\n6AeR27i8GIXA42aGfFrcOLuzpZzGeMtC1PA2T46tzj8zwIibQxJpRurtxsHo\r\n5oN070lJtRq3Yzf9Re4jg1PVb0RQQh5gint6dKFxkqFdUX3GWTa2FPyoPfUG\r\novf30tDQnjj9qr+DYFM2VTzZvClwyRbNulqswQk/fXm84GbBBk2vl8FUaTIM\r\n+ilzsy0qK8yqW337wt2byhRgGKJpoSuADlH4AXh329XV1DirD6HL+7Bk2DUA\r\nyFKH2KDvsGP0R/1qK388sWxR/BtZK1loPBa35jCCuly1/xMzWKfYwQYg7JUj\r\nYmITHpxzznv4I4fFoWovctOaY9uDBzaInlzLfYUBlM8xi49qihoq2tXypSlh\r\n8LGfefCzfYN9mOXc7isA7oZb4w0va0e52N58uiEcqTai/U6RuH1ylCmGzk+W\r\ni2kDr0HNP1J7uKx9u+txtJzmMhh/bap/JadQc+jy/mWfYFg4RRHI+ZCx5tfP\r\nfkGhxA1QTBEtc/MivBIJjag0koNjd6pjbd8=\r\n=DL55\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7c3c7b8138e1c53a67b19a9721d280561bb1cfd5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.1_1667980382769_0.5595226163256461","host":"s3://npm-registry-packages"}},"4.2.0-feature-624583-la9oqhst":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-624583-la9oqhst","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-624583-la9oqhst","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6c8898219c37cedb695aed0f8609f38e921923d3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-624583-la9oqhst.tgz","fileCount":159,"integrity":"sha512-dfEViOcMmg3ceJo8pyhcHXhd2Za6hwNcn52WRfwHTiTmuiKLKqROD/E77rHO628xtGtTDHJxsMLUtOMwJAtoKA==","signatures":[{"sig":"MEQCIAX1agWucPUUxwbnXzNdtGM7ekOGww5DzooJfWIjEpsLAiAp9+eBcJ+g7bD8oTkXk2zlrtvlB/f9vKjTO9WmuacsOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja60KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4DxAAiQ638snPBiOylEXFSywC0q0iL7kjm2Cdh2S6R/75luCR3eF4\r\n2Dj+h/X6H/j/3pB9xj/1XHJY+nWgH5u6dDfKcMhQ1GQag7T/p5+TD6y80cWw\r\nGIPA2dZh9SOpJuqD2QxC+V9Y7xPeImAZ1eRs6AfWPSE0HoiqZnPOh8apGt9f\r\n9NvzaU6qoh+A+Ls4EKQQaQ3xSwOswjsWxvF7wWUZdhO9q6ajYgJYXZDHa619\r\nBJ8+cXYT6MG9Ga6CXccwwtvgYYTO4HQqDM9ohhz+kZiSUOCTNVF1Y//3SA9e\r\nIupgEfZIFOyaEycMZhPEgxr8MSytGSRZSh8HVAWtz4HmbTqHBcuo4HjnJZNH\r\nWl4UHA3UyafAHUDPHsxhRnH6gZZ2XO9jFT2srwkAO82iag6E90rbPgUQPn+B\r\nQ27DkYxqDL8vOAcM01N08SQW6JTC5LtsxjuJOdjAqwzbAqYncvWg62vwNODe\r\nhR0MEN6iYO4LZwCQkmSo3cqCVwbp/OPeOtfLCnA+mSQUG6cmFSQFp/vKNq5J\r\nzEiQXzkG79uJea/gvwCrwih2f5npnZCxmGGCqXUsYn8KfvjsSCYzadceXYyS\r\nF7MWziECvYB6X3xB/CWxDD/990SIOl8bTK/WBuelRYfs267u5GnawjqrA0P7\r\n5wrzQWx78T3qbUvgmlucfHu27e8Tyu/giok=\r\n=r0zp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"6245830fc81f85dcbafaf763008f825b068b6097","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_enabling_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-624583-la9oqhst_1668001034231_0.658568817118548","host":"s3://npm-registry-packages"}},"4.1.0-feature-75f182-lac8x4ea":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-75f182-lac8x4ea","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-75f182-lac8x4ea","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7831bbae269e6ba842efdbe1d2d25345bf2101ec","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-75f182-lac8x4ea.tgz","fileCount":159,"integrity":"sha512-pbQhgZyKYmgKyZQdkDvgkJABwoWhN/cD75AYUi0Zi4US+eaWus5Z1qJqpqF+ejZVUPfIFnilmjAUYxrhvBeskw==","signatures":[{"sig":"MEUCIDyZ9tQ8eiucDRDQDX8/2o2pchpwvqkTOMlyNMYXjeE7AiEAnff+wGc5+Jq0Li+FeouxqY9hbMMBufyvGigTkdYC91U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbgnbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKKw//e0gFO3n2jv57Ap2TWN//aa57Kw8IPRnXsGnIt1ZcI0/VMoBW\r\nVmdkdeHJYHDEKCDBR/SjcUqiI9jbo4cafH+BIcRBGfoNN/lvLHzmuwuJJYhl\r\ndUXVg9r8zeyzEnBABsC76Yjuuoid6l7HW1azkx2I866FXLclTFAAcTBTcoiB\r\nhcO7EfGgVVeRNf6oVIaaum94F6h9jwcJJ2ZI634IYiLhFtevBrklGxrSZ5qo\r\nY9p+/ZX74o4u0w3mp7mGTV15/rZUA1L0D5dUjIOqxhr7Jm+kS9Ac5tZz4H92\r\nnDkBHpoJMmXVnnVCP8NpuDBI9AyqJwoSY7/zVhgKVun8u+vhbg8xe6CREgQT\r\nkFVEoIGOtVObSd05QmOzSwWYw5VjNY+jjMzwiT9TluxqKIjE5DPQUWBlcv6p\r\ncMqM9Fw3SECKKRhGB28iFd8H2AuoHS+o06HbhRHOK7pyPJwUrG01hP9f2Rp1\r\nPS8Au7S1LiEhzM+LyEu4CzLOLVmlCOW8q1Dk3Vcjl4neSv7ihjXxSmNiM6d1\r\nBd/PF3+gmKiF16MLvQCEmMi0m2Qxvv1dJAcBVoqTR2/ZPfx9fMNZtDRK5FtI\r\nHG+o+uYlzCCtDwUtw8gr5w+2wpYZc0NX0TjayRDIA0hh3EEYIdecy7AubaHb\r\nFGn02uqbVdw02wXrKWA35wbYaB9xTs5WitM=\r\n=PIPl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"75f1822902726563d614c5c2f1a0490d3f6d3b68","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0-alpha.12"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-75f182-lac8x4ea_1668155867349_0.053989638938350515","host":"s3://npm-registry-packages"}},"4.2.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6fc64a03269a17c034ce3a443064f072424f8879","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.2.tgz","fileCount":159,"integrity":"sha512-99RHSPyHjeEJZeqdPqA5uUxocoZ2j7q9NyE0z8iq+bTNq64rbrMe5JHAnGldJe9hvhS0c9TI41qZBbXqpceihg==","signatures":[{"sig":"MEUCIQClRGF18apwyoV02gTZd1gZJAz9r9wQ8sp0ExhyuG02gQIgYZIwfgNSbwQ0ZeMvqkT7lFbcsC1tivlxQGP9dWyEYIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522570,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcfv3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmossg//Xf6BDmpsKuciJqDXfnXUWfZ9xJ7YllFlwPo44OyXa5xAhXko\r\nMg/aWvx21CXSFagC3AobTHtRu8m9v6uG8RJyGQFSGhA3N9+8CitfMVFjfQV3\r\n0z3zYhnZZe9eCRBkFOn8DRlR/3zqitqDoOLYlPWsFyktQbANncnWaudtn/bN\r\ngZzcJw8A8hsa0oiIb0+Addbd4oSoiQv1GgcVXbbNyRYsh0XRBl86i4vKUCoi\r\n8XMrVSgm3QS12WcjPEQ6u2ZVLVRmftpaFpTzAbusaEXHN3xSk3rguN/HD71C\r\naWvvxbsgrAo90A3/Ao278E5kEjPIIIoCMh8WbagW5yDdmQ2HbfwpyJiMrmhG\r\njwtUTyaFaPuilD/4QyAi3/paFNiW5NwM+NdYpPtPqw1nZhuM7OLSh0YieJKL\r\nXOuPNEqFEoo6bWjCZucy1JAfn1OteFxI4mq8820Ghl4M5RZKQnGth+zah4vK\r\nGXCbApC7bcfSdF67kpByEeORXZhYCYG2nqUebPi6q0ZcCb+p9NERahwxoMs9\r\nGICqHpQ4EJzKHcvO816VpJ2OXmX2iIHNVzxwo5NCYN85E/2g/grJuvrHFMys\r\njzQAGuj42kMiaja8cNBLd6FJd+kjx58BD3u33H8I1+NEZR+KZbLsqpp32NT3\r\no3L0Fqpghx0ceh+o4wHmJYkZkI0/Y1Z4zeY=\r\n=NBcN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b33a907211fc826fa3448820f74b7972c9242aa1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.2_1668414454814_0.039363748941813714","host":"s3://npm-registry-packages"}},"4.2.0-feature-9cc81a-laglgx8t":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-9cc81a-laglgx8t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-9cc81a-laglgx8t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2d040ec5f40cc910324cbf7514ba44f0043c761","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-9cc81a-laglgx8t.tgz","fileCount":159,"integrity":"sha512-g22XKb0+T1udpvjZwhWNyqHAgRubDsLWnWhTIPJaB5sf2Vtsl0f9NIcIMeuMotZ1lBrktftn48jP4/HjMjuKeA==","signatures":[{"sig":"MEUCIQCO+h10zwQlQllyqty31AUv/80APvAXMa0R1AndRLo6SQIgOW2nbA93m1pMezuK/WV+DSqiA/xmHDqf+9TyLTfNQBY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcgz+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpylQ/9GxIndIVfbz8SmZcQsEnib+UG0DEtVhB5djHFrniAySFx2P58\r\nXuMzUb9eGHKOwS37U2QS+Wk48Azg7xgntIEHhaPyy4BuH9kLOHNoH25kjJSZ\r\nmndsMV2TPrUzBVFkiSmPCayKer938pI/jr+T7UuwdqqNoEKrPC3+B2EiJ7f9\r\nBnYN5Qvc14bGkBbSmOwrUr/fvOAjFy6Pb+3IXh/n+TVtiX0HS+KU/xp93dxu\r\nv6a31eGetF8aayviitGrc1pv4F5+oOkchZZwfSIKemrWEx5obqDwKts/E2s0\r\no6nP8soQcX4auq0fVaeSUcVGKNaGBDxWQjcaZHKKkQs95Cj5QMmjggJG11oz\r\nGGpFX91sT9SOd1PkATUWzTUSo4612XmDyupmTMQUnP2W23lDplCR3BZb0Hdz\r\n9szYxuOJKP8K2qKDEScJ3q+jJmJoOkbSPP+j/1cABsB/c4DNSDHwOjfpI5zb\r\n+dVxn/dLJo4/ANEa0jiBfA3KHCj0tdHPN5umthIxpYacGLESw70P5/QrrXaT\r\ndyIY2peWZTVsZCSThFgTx1DDJml7mpYZZzBEvJaPxp6vqJZ9ulNheDwgJn9f\r\nKjiGKD2+xBp+H61DBsvkd48qhjPuBYdo+G9hsUyAJTBEzx41UTEX8BReabiZ\r\n+6M3zfxgl+2D2iX0BfMBaYOqExqJD7ej3rE=\r\n=mywa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9cc81a933ecc3898082b51f23b0d1f69c0f47a22","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_enabling_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-9cc81a-laglgx8t_1668418813766_0.7129782175873203","host":"s3://npm-registry-packages"}},"4.2.0-feature-762a42-lagvww21":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-762a42-lagvww21","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-762a42-lagvww21","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"70847e626da177c2fe087137c69d207cc30a9e1e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-762a42-lagvww21.tgz","fileCount":159,"integrity":"sha512-cLFi7FLaRtPaN8QIRl5CrMEBkyzNIG9yby+tumSpbhj0Mb42El7Kd/Gei64IhYL2GENY4vrkiBr22lLhsdQl1A==","signatures":[{"sig":"MEYCIQDvk5KonEvmI4ENP1aCBJqG3T6omv1me/hjr3Pj0sYkPQIhAIidcivynjNL8A0aQu1Oj9gLB3SWg14AGik5+Kc8dKVO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjclF8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpizhAAo6xEa6DSVFV5RkXOsm9pGMuhCr6t9fV1L1mG1QonJ3nAMFE9\r\nBn0mVQ/s6q4VHFX+B8gbgWvbIonK+zVJ+7W597iGE1NxNg5dqBpWPPA87HMb\r\nzsEsB3CKf6G9mEtrakMP/3TEuGtk4mpnx57dj8Aw79lARPo988rC0DOG9V3m\r\nSb89n89vYRNCqWgp1EI5YxXxoxUpfzH8JJakmHcuhBG2lblLvaCfpG7ZcSvn\r\n5TRy1piGtLoDNH6xq7c/4QEKhNbWllhiAPUGzZFTLDt1YOJki2tPu/wnP7uK\r\nJlqG6yrxTjvmeYKBeuCsV6U3m8h/sVuOnQkASiMBvbiH70Mxg54t6+eP17xl\r\nq1xwlvnDvkMV0OsOfnwEFt5aZ0Rb20eZL+wZIPPg43QNekOpLCxrVtlngdT3\r\nScBtF/2mKA8nYE4LuCu4UurYUgqJE/QwhoaqnDY7yXIzr1vlK1JIHOxV7mfk\r\nYtB8SS4OI2WgewjcNjRbIYSEibWzm4MpmVgKVfKKjvaeYb0qkBap/qabKjdB\r\nP5xFhlr0SPZhI981UTdDHkGZm7OuzJlIJqf1EIzcIgUoW2dZLUo3bwdROivh\r\nbBrjH9IyoMGt2+kXDF2NcJLmOzL/Zry3dNyeaqUGNeF5Ak+9OzYAG+SWAnaP\r\nrnPIJB3jq0ExmP1D9JoIzB7G/UStiQQANT0=\r\n=r3JI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"762a42a54cb8761a45e01e0dea092435ab5a93c5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_enabling_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-762a42-lagvww21_1668436348687_0.10877053399884451","host":"s3://npm-registry-packages"}},"4.1.0-feature-0b4126-lahxc6pg":{"name":"@atlas-engine/atlas_engine_client","version":"4.1.0-feature-0b4126-lahxc6pg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.1.0-feature-0b4126-lahxc6pg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f3a2b1b69a76e2f4f70c8c443e55a5bf62895b19","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.1.0-feature-0b4126-lahxc6pg.tgz","fileCount":159,"integrity":"sha512-N5XKPvCGf5D+mLhwmgLxDywpPek9UjMGrrF8CLU5yMto1+jivmaaKXlSW10Nx4njzGHdBcFqROMaZynjM8YgGw==","signatures":[{"sig":"MEYCIQDU5w5E7MKjJVJ+Lx8TJ9ne7+wthf57W0X0FqL/9zVzTAIhANdv/urGb2xkCYyorZOH+e5aDK6VAbQyD6Bp5WeelAbw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc0cHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWCA/9EZYE3dcEZxccpSiWVEwkPdkkWhZKgyYA7Q6JIrHkmK6X+54B\r\n4RqL3486poNGWG9shhUpqlY+WFexkWCrz5C3xmGgKFa1Ocub/WJOzTbFBgWe\r\nsF+ph+I/raOChkG93PNnWY9NvzB2rJTR9mBhhW5KLxmahki2HCAuk6i2jNd+\r\nCVTDfWZrQBQsMBG/mnL8WJi2LXwZOsuPeJImQdDAzSYTHQ5w+lpa3hH7Y9KU\r\nfMifo1vFMlsoPbI3ibbK+LjNJ86uHAdMppZKdt4DMEjeFjZ+FDSP96Bz/9dS\r\n4DYLyCjGluP9UDmTdinNg18IM+qn/KAi50DaTg3k9jali7jV/x3CWslpkSMB\r\nfsi/ELtgDkd5zPNWEbj4NOX6lVnBRlePbT2TpYy6WVIFZJ3Xses2HiqmI5mR\r\n869flpjFh4cejV3iUnwmdt72bK6IPUSZJsfdetpBsAqVTMi+q/AdG6lvpOHG\r\nyA77z3KUULYjvOEDr0GVzbP+8FoRnAY54Uaw23I1QeeSFhvOo57X5J2sfdT4\r\n7aJYXFy9VkpbZ8fQso1+7S1/SPXvvh9pXN6jyaRboP6K3GnGVBb2LrEwStv0\r\nfmnGTupnqrYGm90V1Ua1OnsGQhpXboPbWbEwOFXOqEUOiWY0ShqvUZthXBkT\r\noX0kGl7FvRFw4qv55hhI2ekTy8iRAsH+mG4=\r\n=WeJN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0b41266cafce49f4b82a7b9a6f7cb620318a8ea5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.1.0-feature-0b4126-lahxc6pg_1668499207613_0.8849873768079413","host":"s3://npm-registry-packages"}},"4.2.0-feature-26290f-lahxedo0":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-26290f-lahxedo0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-26290f-lahxedo0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4ba13785e041468ab029eeba2ce90769faf474ef","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-26290f-lahxedo0.tgz","fileCount":159,"integrity":"sha512-/WIt0gX7IgkUiC0k840Fbzc8Y4Uhv7wzFOoFiHZeIKAhHwaB1cLy1SuuYmqO5K5A9QTd7uGV2TeamST45g8gVw==","signatures":[{"sig":"MEUCIQD4QvncCp7oQ2mcbcfeIdo7mdZbikgpM3gA8ZSzyp04SQIgGdkPjsCe/R3LP1QQAq1uDDKAfrLrL3NP8kkCO4kSXjY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc0dxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpefg/+L9M24ihQIluHpoinAMbk3n0aSmpfBtyE3TUbpJJYEbASOgBE\r\nH2rK7p2+ioXnJagnAD21af1Z1a2PQC/N4TTZzpyhm6FTTpeMGOvsZqeoEdyE\r\nghZjun6qZalxdJXn5KejzbSSTPxGonInINAGgnoKx8wIslj7mWTOutAYL4Mm\r\nysQk8/Md6SsVNPL70s+1YdF8Fubefi1zITlzrjX7cR2/ZMadytuGrQivepyS\r\nnJtqFwTCPofQSOfMUR6l5c8jeKFe0ZaAVrOQ+L20K5ZoDH8+iihoHEQwtOaZ\r\nGdjmouF9sB+6ukYF9We9rYgp7u5yiWJz2fslJ+xIgWPIfNudxhsZVI+pb83n\r\ndFZEv4Ngx5oBf+/6DwVZvOUOUscKOWDtFr6FQoJ273RsLzb0NUQ8Vhv+bw33\r\nrFqjktA2haTfMFpr1OtvLa/2eSy6quQVeoFf9HTEBQHJKDvNaJhPkOJuYrI4\r\n9remJMemjBiykYmjJbGA50V8aL1nuSWI92oNG3z43oghlUl6EahV1hwOkvB9\r\nFFWl427peHNXnYVww7blEZZSKx0zlhWxDRXN94jxanNwqua0NHAYWBec1Clf\r\nt37O591jzendGLbyGymQitElafH0yMJIU7XxWNZGUtYw4udsIu/bj3MoLI8h\r\n4HxK0C265ijqLkzMtHFhZQdLq50lLvHs9qo=\r\n=bsZb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"26290fa953cf7fed91c656c90626b90f6743cb20","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-26290f-lahxedo0_1668499312962_0.18801779076717517","host":"s3://npm-registry-packages"}},"4.2.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"cf9e9a277a55dd51ffd4aaf79726c00a6233f706","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.3.tgz","fileCount":159,"integrity":"sha512-Qk0aOR/X2BkCYTEl2hmI8Dgp1W386fJOVTgtkyPlrg2Qe+TVrefbAJse6L1PCq70Jw0aSHKLzO7E5vgj2qAiCw==","signatures":[{"sig":"MEQCIG+cHsPXHnwX2u/veYknF3oWAawV4hRh0jM7jE55nckeAiA6dIWM5wZD82pu/1O/Sf1OFLMSVa/vFbliy3TqQsBjzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc0eBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2FQ/+JgfL54g0w9SRNvyDp5iP4mGL2WOXecZI74AXFTq6HtoNUwoC\r\nwogFIHW03gaeyS2RWABY+6E17Bl9Cs+gCx/bQyT8QWccRFVpeMfJ05qYH8cO\r\nS/WWW7P2FwJqYi2WNk3X6hkPU9u87EL1+WEaQ4MfBGqDxVJgEmJq9jHZU4S0\r\nhxRN+CtkHQz2NDnZdIXRa8JehvxPtzYAA3J3CBNWhWW0YCuN1nIh3IvWuuVs\r\nPEstIQbw+T5CMjbocvU/G31U798cm/L3bQyohgZcPu/nQhBAqQkNP1iJA7o3\r\nLVgelPBjFKy6UDFpv5QQP16aQrQXmEiDgDmcH+q/9AfDbzP3RUAgd6pBMabL\r\nL4u+X6LhCqLNP8H6d9bpfNY75o4xM1TxnGkd689XGDrg5gh840NnFu/oIon3\r\nUrkuMzBWlRuiq1apQG0LRsr/xpzircQBQ1iQiF65bq5ykTKSkKk4ZmLPpG5W\r\n71DQTTn4wQoFVGX/4Ijl20q6mSNlr6ZEjbH+FukHNF2eo0m7bt4ockH3i5cn\r\nKb95tT3Bd0QB6DxTIR26ZJo15pYvgIe06ok2lLTR4He3jZRIXgP5DorEDUNK\r\nIiz1pIAo6gvq4HVz3L/UNRQwzyLEzcPs2fh0XV+aD27akvY4wyMowRGOY2OH\r\ndzD42UGi/XdSfHqwDACeV3c9xLSU+maQHn8=\r\n=prIZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7322e46c7f7e77a747cf2a183372163ae83743f5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.3_1668499329156_0.2670839655137973","host":"s3://npm-registry-packages"}},"4.2.0-feature-b89c71-lajd1bv2":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-b89c71-lajd1bv2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-b89c71-lajd1bv2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"576ec246dd752938ebc7c412a0ad3118fc4c1706","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-b89c71-lajd1bv2.tgz","fileCount":159,"integrity":"sha512-GozotyPVal7I3JDmY6IZyXZzzbr98gCGIeJY6bBkbJwMQ+lRROH49kDPG1rjFnSSL0Y9ZgZ3o54ZsU7ep3OyVg==","signatures":[{"sig":"MEUCIQCyoxyTjToQ0sFZWfnGNwCfIton53PGtRk+NH4yVjsGWQIgb4r5uKL9LsveO78sbqPf/k1L6NPK2I5u/hOw9WQhqxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdJo5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGVxAAjC6RrHHUTrDIrfSOxFLztIDDHrcVDeZQYsUpsTEJ7Gjyxs4F\r\nBiZjOts+EMA4oUvPWmd3SAPWBJjWPrPcrdgPmx1HzCfjfxdTwiETZZSYJSYH\r\nG/7NAkCbtHv4xblHpr7yySWltoBrr7W0w1XDLqAK4OsrwjbwXdby2bSZ7fRx\r\nOVDkR7ExO+yFN/w9eg2QksOoBy3nC0yJQLRSohPiKLqaTH5eA2f1lqlNQf/b\r\nlKM+weVA/l/3H+/yTc1aSiUFQmA5d99Hoh/lEs4YsSs3HMuEUaV9ZmpYYcOs\r\njn75MUxoV7iJUS8bz8cqw2BtLkPSBfxQArfPh92h6HFxSgeNwRuKG9vsFSmb\r\ngDSqjPS1msosJgAfYpBTk3Zb3PHLEYPDQXsJYD+HJoMB/f6royU3GetNsY7t\r\nE3Zy67N+jYmMdJfWdeN/1gql6hMl7eA02X3SuQPilj/y8f3DHXibvYLwLoam\r\nZzK3iMPQO1fhQw7u1ZInJQcSroc9EpRvrZeOHO9+N3glnl9MoZ9WmA5164HB\r\n7IiWKd8dShXNfUqJeof7EzwtLk4kcIl9LcdwqGS5p2vkRjmxGxvgjXiPXHb3\r\nulSHbojtdLjzQFIxntATsFnBGnR6kyOxf05XyPMkcYaXybtmsi5qx3oKtzqD\r\njtsp0rf8STv9ZzH0NkuyozDNNQ1HUXnJwX0=\r\n=lO4L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b89c71c4f4e2f71daca50f76484ae0bfca51de77","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_enabling_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-b89c71-lajd1bv2_1668586040661_0.5414278651977102","host":"s3://npm-registry-packages"}},"4.2.0-feature-8891c8-laql438k":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-8891c8-laql438k","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-8891c8-laql438k","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2c9c0237ea36e3d61e8ce015d2142b726447b5cc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-8891c8-laql438k.tgz","fileCount":159,"integrity":"sha512-Eg/l6245BWAu2asD7f3OacZrAoh5FHZeklcwwkErYD4kSYDESvF8vzrz7W/vqVqQSt0WtprAnjvk/5H3vpuysg==","signatures":[{"sig":"MEQCIBWAGLYIsvu1vy7f0uTuiOkXWlcwH1RlOdESksAgVfPZAiA0n7f/wqbh5aitgq3w8jaqcCb/HjTheZ8QwDOT4IswQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje0SYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMVxAAgpqmBDBsVMInmEV27vZpGULS6iRBny/P9INuX15PyTUtHaYa\r\npl20ZyVdhd8KxY+0EGefDWHJ9xA5PTPfIXh6PlvhvVxEQyyEtqvcI+AO0NqQ\r\nbRkcsnwfAdIw59wBBBK6O4F3yOGtQBs1dCfpp8vETwAKIxsP9zfAvVm8tYYg\r\nj4yaBiML8mKZcwrskrE9qUOBAiKmHAS4sQ2v8oZwbV3ZLtk/CZD8/QO4AlFz\r\nZB0s+ZKtUSyzrZRoqQ5TFsgS4Uqs30Pn54uuRF0kzbpCtp+CXYCusfS69ha3\r\ndNl3jU9JC1OCi/nmCuYTeAjIm0tfg9dulSqAqIxHprzPy4blT+qx0CGhDZh+\r\nb+FgdsurGGbSrbToHD3YD6ufrgP/MyBLQG2R24cbi2CGmfucKaIot6L+nN2y\r\nIvNUW7ivTza6beYBQw/wYCWULij+KbjAGiYgFqxxfa50u/PmT6IQrLYtZVl0\r\ntETOxlZFXTmZSfB+5fBNaLXvgEMxkYtBdytf9aOI66/oyxJ6z/ijklYW79yj\r\nYDXoCPbbclTA45lnXG6osilIk/EYHQbHe/9BSFZ/4loYXJf1YHGIV/X3hlbE\r\nkZtEOPtSrsrGex6SholPTVOdCFFimUuGbRz9peg8m+6/pkrJ6HlKZ438CUmw\r\noTuSLjHwmajuUFFka9Uv+PJRUACYbx6pvhM=\r\n=NA0b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8891c839c2471dfff961dcfe45f7277b5c07032c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-8891c8-laql438k_1669022872533_0.935144402213518","host":"s3://npm-registry-packages"}},"4.2.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fc40b9d152556262aa403c1acf6248eea994e8f3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.4.tgz","fileCount":159,"integrity":"sha512-qL3rpETnB1bTGZFQh3Ph5OebEiEDudhMhs9AVhb605yKA/MhHm+XgTiILMX7KHj3vrFSF0wfgwfBImqQvh7p/g==","signatures":[{"sig":"MEQCIFYnQxYF6hRYhdmPzKwpqslNKH/vKVrt5yHGXRHYXA8KAiBFPgzwl67PKfbPDxlPQu6A/iQ+8QumljTdkL4kQfNlWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje0VKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0Xg//WPTyef9wdofJQFX8mcn7EgO11pglkUNhSycBTFcCO44Mw+qk\r\nqKrDWd0XQk2IeOuL3PZbdxn2kEg3k2DhtKIqQnQ64AtaIUR+S+QtMzQZeYqA\r\njl5BDz/N04s26QdI287lKo33LJUVywTLaDXFwpxrB3BMBBQKg1ackaxPxEjj\r\nbDJa2LeniRi21usOO5/sCWWJFxpcLmkOqym9fcZS8JuaCZecyR7qNjtjPRdO\r\nGJa27VJv8wmT/+uuVp0/WDpjkgcS9PKB8Um/Hy5lkvMTNV8aVPNkPAjLEeWs\r\nzvmbnujHLaQK5b3oCFnuo3GjpjIAhJqhohxyywcbqYTi+QkOQk32mFLyNTip\r\nZ8/LPKWa6MlGIjWnaiz6ez/b6SFV7vL8+Suon9ejyzusEuYUCzXR7spQ7n7G\r\nxmtFK4bcccdDzWzZCfeDuxoKQddtr+4zpNqc0L6nKwyF9g8e4aTKkR1yK0Vx\r\npaiktYSfSnIuPIhJIa3qhjtJJFEhK4ucRRXTl9pkwaLFyyaTXxHUTU6RS/KD\r\nspAJ5hZ2oN4RSb1sI74GA5BNk66+AW38L2AjrZhup2V5h8vOXdIFOpZIC5Fw\r\n6dLmO5vVBKbGhoW2RA0VVzoZ/iMiOILn2ZGhWskNAvUMlxZCUUfHpZUMOBeu\r\nNCoXIUqmTJPMiSmbfCit32dsQ5bPDERlr+g=\r\n=vfF6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"eef2bab44b59af190bcded469c05b8d330a96395","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.4_1669023049867_0.7499085682068245","host":"s3://npm-registry-packages"}},"4.2.0-feature-0a81a7-las9doly":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-0a81a7-las9doly","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-0a81a7-las9doly","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b59c03b40c1f76069dd8fd24b2ae988f6d3864b2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-0a81a7-las9doly.tgz","fileCount":159,"integrity":"sha512-Be9ejRvSgDGxix5GBm4ZrQrwvF2T60WJyAK/2Uoj9EpiqVmmjejzIcRvwvdj047s/Qbjax1iAnJTbTKDDPj03A==","signatures":[{"sig":"MEYCIQD8nlTby+tQLaxq20n0UWAofjQOOPDI11Jd9REshB2hVwIhAPiZIMWVac/ch3Gh+U9w5fwQ4Ilbf47ebgcOtyfOG8nt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":532147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfNABACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZhQ/8DS255rd47wbmxcO5+exNT1U/zeLE7AeJrt5oKSddUNbR5z2X\r\nPz1kxQH+giU4JiDBAKma2CaaRxQjumZ7U5hOdWW9wwKGmc33j7+0d5UlvRlI\r\n1ZXl/8i4vNK2EC2CfyzuvPnHqC4bq6m5vSpisgGADTmSYpZ2r8jEfUwBvbtm\r\nwJEINcxoShmCwkmzm7vxSOB1YYrPZG0syuM1BvZaqcL6Sw7ilzRYW2W53U0i\r\nl/9il2Y631me27AjMv3X0MRiVryw0xSUBdHL3p6cGdJj2n2YKZzb3nzZ+E8q\r\nw8sNaSSJeRhcMP8Yt4ACJqhsjvk2cpeNXr15G7ZFF9hhfLquN1hrPH+O7Pty\r\n3JVtONC1IE68e1N9pmovEQtlBEa0fCaM1e/bDOViScXHv+onutwmFlE+Atdo\r\n14wqbgXspNxEj71RKU5ND/BBsCeiPm5AMHJ9ZqOrjGOED8QgV8U3HlwwPn5A\r\nWN+mKguePb8seWl8jUA0VOh7RxWbgQQIn1Q83VTHNAt6HspjJZ+7GG2gILhj\r\nWC/Taqc7KIlfZxFQoBX7SWhKR0yBwiNNP6f+Bgjeu3ym/ueQD7F3JAr4BwnT\r\noxNJDsdOLtyp1rImCqax4Raja5ox8a9Y48WQOZNXprD7Gof/x3qnj5W77JVR\r\njNEhuQB7RHsF1dex6Bo9wv7NHgigSYojRow=\r\n=deFF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0a81a7444765e0e3f391d04fba0ab23788cc3dee","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-0a81a7-las9doly_1669124096753_0.07555874158533693","host":"s3://npm-registry-packages"}},"4.2.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"83b0045b5133bd1b60b8fbb92a4efbef2c873e64","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-beta.1.tgz","fileCount":159,"integrity":"sha512-enUVH9jid39yWnFlBnRGq/ZvRbSX7yRI78hx9r2DVxrhVcvXTc+s7BsEVh6xhnlWxmtnvfgrqmr5K1O89Nf3xA==","signatures":[{"sig":"MEYCIQCw+drDoEmjnxOPUSUui9/qjFo4+nzncK2ePFIiajdqegIhAN2B4QXsDX8KLs854zoZjJ4hJfDsvtsEwtQLpXzAIgp2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529525,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf00CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaLBAAnc9+MWOm4LQgmCwWglxBrgZpJsXVoNCTRN3ExCBGUCpY1F5d\r\nQ77834flH93isxK3IuSv5mRVAwVIj/YKdL16niGYD9MpTsuMBZxzfQsE779K\r\nUU1Q+R1R2acilO02gpQ04e9VKo7juMlrFQ8FKQPaU7rLVurFbpaFBSJ0gteB\r\ny1KSKrRK6Lx88qwx0lpaAYEqZrXJJouhfxhVgC5XYcO12lo4q5lwSdgWFuK3\r\nNHAgp6E6BrkWXVvC/z+vDrsYme1UPNj75iQFUuodUtot0zZD2IJ779nCD6vl\r\nigBmx+8Fdz1mlZ3eaUHoZpGG0CgFJe+Q3Dun9qfPqAnnB6IZ2G631Mog0ZBH\r\nIcDMS+SKD/F0GkhY5T+Xj6jEAXdHGywE/4N2QShnJwjaI9vwsDH9T4PGZjnS\r\nVhA4hXUChllDuGLkzp2SLjK9z/MM4iMbG3WSvV2aGJmKpRSh4IJ39Xl+t4nZ\r\nOqfPZw/Xf+XdG80+tKdAwKrOT2skZeug1qpd5KWZtH/u8dwZdD0DvJK0kVok\r\nwTmTQcuvYCTGSaQ0nTizW55/7OaEgTuXxVhRPoZyoy+Ng3vtB+6BgUnkYA0t\r\nNCJlTSxD/qjuKge/g06r54en5atxyQQVjlzQpJ96/rSjFO140DgExPXdAQVt\r\nMDEZ7kNEAy1DZy+Rxz+4poazInxPvlxP1aU=\r\n=VPmx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3b1f6be0de989ebcb964e0536368a8f90aac7cf8","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-beta.1_1669287170519_0.74286123383166","host":"s3://npm-registry-packages"}},"4.2.0-feature-712d0f-lb0lr7k1":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-712d0f-lb0lr7k1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-712d0f-lb0lr7k1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df6bf27de7eb0d8208b79472de1cb5a403f5b936","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-712d0f-lb0lr7k1.tgz","fileCount":159,"integrity":"sha512-EooDz0oQEXczg3O6mOXJpy7PoIgazm3jXu1YmPXj1GE+QiJdOJENjFV4IJo3dxVKspxZUlNlklz0lT3zkshIZQ==","signatures":[{"sig":"MEYCIQCR7bWuEXUtAvU9SIyBalH0Xfxyksdj+gXOHv0R+Kvq7wIhAPfqlYofiQN0jpIgVQT5uFsmiWzVmTYLoHg47fbdTsMZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":534517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhILCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2/g/+KbTBvlM4HKi0pBcjm9IARB7kJ3M0MJNKKSyOcsxrUM7FaV5d\r\n1dI95oHPBqBewAyxTTWpIQKf3LxXOqkICkgBRvdiaEr+d4KtQ+4lDR5+e2AL\r\nPlsETgfIihTz3X0Oqdfn3bL11bpXwramFmulRfYzdwJycFp08Z9vQ+R1obHA\r\nA4QgBjm00d6Ql60mcCPrNakVMRsMsQrp8xgXztQ5+HH2fe0OLpjA9Bv/LJBi\r\nZgweo2ZEWOFP1JabhyMZ3Hxy9STXqJJxnuFjFbnmDt5O06JA9GaM5hKNyX4O\r\nLtRCjSmKKLUDTa2/5lnHllx0UMFhZBVpdvQHS+fPTAygafwADQ3IPdW8DRuL\r\nLIx5osD4EbkjeyhHtBYpWXdTiccbhku+UN3f1ijt7bCn8fKOo22vkHoILx9l\r\nLykA0f/hGl7OH/zqtjGUjaijAZIaCxOR88jrAeX+cs7rmTJcxv1BOR+nSJQ/\r\nMwMQc/D4ibnG6qxQE+4N0Xto7HNPI3JNbbgzuPjDC53yrzFPQs4Zqx8evfe/\r\np7Fad1A36UQ7WKd7w2sozDpQCRrZAvcelJlFKp/PPSz5EyNuFY0bhBFWdN7r\r\nnIzKEX9StT+SUW9fiaiemvukwnqKXbVp7M6u7u3SZB2nb3FDIa6ve4OPO+fV\r\nxFDHt2XLqcYZxebiFD96yyCzgVIEXd/ctPM=\r\n=8TK0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"712d0f60c67bb6c0d91f54c7ec4da8c05a2058d0","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-712d0f-lb0lr7k1_1669628610598_0.05608381760114067","host":"s3://npm-registry-packages"}},"4.2.0-feature-8c1ec0-lb28ttcj":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-8c1ec0-lb28ttcj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-8c1ec0-lb28ttcj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dc8b7f21e82404a8f55a84d33fd89ee850a97a1b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-8c1ec0-lb28ttcj.tgz","fileCount":159,"integrity":"sha512-8BYwQv/2TVEOksvyhVOXDQ53tXM+Bx4hXh2VA0Vq3ouynt3nb1sEpCnpsScxEx0xtjYiXZJrEuq7mlSBMMaHKQ==","signatures":[{"sig":"MEQCICqFX0TpRrA2yS1LRs1No4TGg9lPrvJFkwBsFGnunAsPAiAsOcqlrVS7gZmWen1jLhPBauV98zsRGLlotpDVpfpUHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":532965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhgZWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrz7g/8CO+F17DYR3inEhkSGQ9/9PuBd3fcwJcS8+SQvj80GRPlJ49q\r\nceV+or2jBBG1wq9ZuuEbW5La2H030sJducazw81cuiYcGB6Vxt/pp6gMvG+3\r\nOPOLDTvwPE27qOIDnMGlBy/1Al14JhR9q+zWeC2cdOZCqmpIUuBo0xvc1BSo\r\nriqd1Ze8IwobkUYm4hsvn5pUWpwJ2b6Vk0cyE8dosWaHunpHq4/ugadC3ndo\r\neJx+wu6nQOQHW63eokYjtTw11gK8HANs+pUwnWcqc9wy5pfgxWJmY+DvuYPc\r\nrp7OGg9s+wvxAN9vAVHkk701420b4qszFBttJVKIc/c5Y/JDy6h9hXoPC1yU\r\n79u80TyP4Kc1+2gtZ4/qJ8GmJxv41mOCjHMwtHnWV6EKX+lRHXQo1HULM7ow\r\nZcY3QD9RL4iYdm4swRBSwkvJwN12Rv22hACRI9v16aBPSYPssWQTvJQg8wZm\r\n8aDkHpf/d0XbPQj6GjCwwDZ4aTXaFDwlW5j/iZsQihzWOz7ATQzJhI0kysp3\r\n2/iQ/uOrATCzO25wBzLPs5amPhA2C9s1vSBRVMSOY+5rWJfQ3e3q9fXhY2Iv\r\nkQPt06c9iFp7ATeTo48wxedRFeBGctos/JbO9SfvPnEjuFIylEwY6EZVTC++\r\nLlI3rJeR9Bem1x9hW/yH+lLxGOxdGmYxvOg=\r\n=o1yl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8c1ec0d8a93ffc351f3c0056a55de57069c588ca","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~deprecate_handle-bpmn-error_route"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-8c1ec0-lb28ttcj_1669727830093_0.4403376352755326","host":"s3://npm-registry-packages"}},"4.2.0-feature-c66278-lb2ctwak":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-c66278-lb2ctwak","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-c66278-lb2ctwak","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dbda43e89608c6b667a1970ef8fd8909b3eaeffe","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-c66278-lb2ctwak.tgz","fileCount":159,"integrity":"sha512-o+N9/kND4/JRl97+saTvZhXyIdr0Zw1bFb3W8rUzEHgtk/lu67+T/sflCr+DGT/UiGBJyKDUou1UGksLnFYGcw==","signatures":[{"sig":"MEQCIGVm6aAxGz1eS7JD+o5ZLv3Nd9E7ynRDa+8lMi0EzFmKAiBhzrLwrjMqW4IV2vEftumSqAPl9K+BO+ICaocywafSoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhiCYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN3g/6Al5ugpP45tHEIgaps6vrz/oSYyLFGKv4yP9aBTRUFXTMzkFw\r\ncoKP6OFzV1t2+9yUQ96zMt/mNtORu1UJDldiD3F8K0pCzGao1pGHqVe/vf0u\r\n4+AHHoQL5blDUaEIBrmwh9/CJVeuaNFov5gODnFFBJH2aKxVaxFE3liTvuJ8\r\niLzgkNil6wqc/i6G4B57Bv1BM2Vfm5PYccw/hOdSOcr2MpdIoff3OfaJvpbN\r\n8zky3FmI5HU6vJYyrtgJFGWScQSIF/bwtpgCcbKHQxsKe/M3SM2VXBJznD3p\r\nYVU3COoC91fzYMpmfVrdjTz7gpSNfamJBU9DCWBDq9zP7m1QByEYq7s84XuG\r\nzYu6hev9OWwcutaGeq5oACgsEssjWSup/oOwQctLsFcNbI/qIgORAsJeGlDS\r\nxoWZjtwVEjacu4iw9K43s6RHEHWvYI87St65G5AULXFq+cYNeNfhjssTg4hX\r\nTtU96IBvMUzyhffEltAvHZgqIjqTU1gjTueMhWlScpUJixDAMcvrFrbkCW+N\r\numV4VPDF5Bwj1Sjh3mdNB0Af4lPSwvGFtenDVzsXzefOmq2TUZPXRn2CxjQK\r\nidOw9UnRxkYC/7cFIzxbVddW0FygOTg/mupzxdz9424dDvV9MSLy6oAvTIgz\r\n50fvsMRwFauQLo1WneR5VCe2jrldVuWGP2I=\r\n=OhlG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c6627813c8dc4bd1d4153043762002de00c0645f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~deprecate_handle-bpmn-error_route"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-c66278-lb2ctwak_1669734552059_0.9369443836901938","host":"s3://npm-registry-packages"}},"4.2.0-feature-d2f588-lb3g5u2l":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-d2f588-lb3g5u2l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-d2f588-lb3g5u2l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"edb8d645f7caf08b5e6ec17e022b8fed2a0d1648","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-d2f588-lb3g5u2l.tgz","fileCount":159,"integrity":"sha512-cBSy37+xA8bxZLCV8Q05h7PNVLoWmsIIl/CvWis8q5xcsuamXC/NINDI9K71o2+jZkcq7l2M9BfdSXfClXFZ1Q==","signatures":[{"sig":"MEYCIQDjrXQ1Bh6cLOx+nFHBia44bmmql7YXR5be7umcIzXOpgIhAM5R5hI6Ane6m7Zc6HaLK1PcMv9BV3PBQB6qn2EA/h2x","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhyKpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpf6g//aT7v+adbYX2TpzUSRlsD1e/wWd7TsQQb5NsFVjXQEkmGoLzX\r\nDbhHXNfsWvHfgiOgqwmC9tE4HYSLLwCys7SShuWJgyLymhEAXnnTqgVMqbBU\r\nOF4RgFRPzupfsPn+yxCtZSbcYA5IZ8Hutz4M2IQc1AUHPu2eGF0QzZaKir3y\r\nQsKOZt3aSnqq4He1NypCxI8pfttXjfFxdTgEl8e/sHJSVtHt1J8pzFhH8zx0\r\nx4zNvnMy7N8b/0WA46hguWDMERbefL5UOiwGwXTBxkj+YzV4KWB6ewGuAY96\r\nMFjjlPNHtqwVO1+m4pdoh09KTJgcpQEIXAovQLPznQ/tMcygI+lmZkGx3w8o\r\nTfDB6pbfDKul56LPWbeEhlEzgUda1WFmrrjrzuNIVvJKbd4Sa5wW/RrLx67E\r\nV56T/ejVfdpZWJlyqI2A7RHxaieMBlczyWWt3OMmcwUhI7kF71DKJad1SMi7\r\nRcBA3QszGFzfR9RYRIvypmuUKn/TBFMkCUg5hRxR/gQxUGDbUjRtV4ZUaSmh\r\nevoT7VjFgRX4S3NrSxLxaIeCjVhN/PakVJBhompn1U+czozj2DFPYyTCsRnf\r\n/VmOveCKNhZtMJS9g7DTthWAXyxW6Zks3XM9PrMlquOOk4YnDh96jeiew7Bw\r\nthi3SZB0CqPek79reSV1WcQ+jmhKGTRIBTo=\r\n=8YZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d2f588279f4c8e31e817df632a893f71dbdb54a7","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~deprecate_handle-bpmn-error_route"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-d2f588-lb3g5u2l_1669800617575_0.7897676267242062","host":"s3://npm-registry-packages"}},"4.2.0-feature-0c34df-lb3jlp33":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-0c34df-lb3jlp33","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-0c34df-lb3jlp33","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7671b5718ed49eed28edf2dd5055b9fb8de5f1e3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-0c34df-lb3jlp33.tgz","fileCount":159,"integrity":"sha512-9xbiZfAaWKq5gIkHjd5XhX5z+6lMjKW7+95QwYCxNgcsdOf3DWXLViENMr3klAH4fz8cS1KztPztamdHR+xwjw==","signatures":[{"sig":"MEUCIQDWCdouvuLLUNtZaW/Xx2sV2qkrHn6IB6XyfKB2BsQwDgIge8g1SBvkzjIWwgP6LANcoHwk5QmFLasVtl0+B3XLICI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhzk/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8OQ/9FJphSzUrE+0blTdAcDA9Sy43V0EeZF4l1zyUfFNx1hgn7DUx\r\nkTqGXoxCb90QwscqZTLa+WlpTSW8PhHoKeMLcSd9aaRN1Fy+iHXtmaoVQjK0\r\ncWp/89sujrgmq9lWOAHDpN4rxVOIGqPNFGUVT0+khPqY73EpLM1q7gRZn5U0\r\n8ORS7spJK24JmUTkr9nvJDXQf4tPCWH4lmtLZ10pe1oQtFA0+aVV9DeFTT76\r\nyrn7X5wBc62KFRfLFgVuvantW3i5D9LUWgay8+MF773OHeGbDos/CqjJz3hD\r\nqpCJeAQabT3Kpxs7dgee369o6PJmw1mJ4K6MMfaF/bz7qd2BvOPA4Qm25I8w\r\nQivxh1zF1AB+uDpEmPGVVpPLy5vbIb037drcUe6kqGxG9F7VwEjkhqeITR6z\r\nK4VsBZVeoHqcK65rO782e4Kj2g5IRRoApepnv+p6Wsgcs708Nqy+zzAKwEd4\r\nTPpXqIuCUOqXdnWvObDCfI9jHCqNBKg9xTOtm3WREx4elYIsO+R5zNnvI6KN\r\ni9iGAOEzdcyW5GicrwenTfY0XQW8tDnmid7pGQ4HS5czxdqRYIRt+M1KLkO8\r\n9uVYEVBaAa9gRBfEteQ/7emA43XYpPgXx0jj3aziz+rcVHi1feNlWW9ojHPS\r\nQc3GjtpMH4VXqfxjFb6JIM7yD4d6old8g5g=\r\n=ZOO1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0c34dfc98c79a3a3a288b301814b2d78f8af2090","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-0c34df-lb3jlp33_1669806399140_0.4023875965854644","host":"s3://npm-registry-packages"}},"4.2.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b01d366aea55700ccf28a03f9406f3a187686c1d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.5.tgz","fileCount":159,"integrity":"sha512-mq6pMisWJZJIF8gkZIsW0k7hjNaV8iMjYkHzzukOaqpSkeuHXI71/NjZ+GV65vK6pVl54bXkh7gg16GRFrHSCw==","signatures":[{"sig":"MEUCIQCLOkeCZHezfBoqnOHYDuYBzp1D9LAWCcUU2UVlX/fZKwIgCAFzgmzfAGxDmB1MhcvP0pszhM6Xt85JtiDQUgZX+z4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhzmnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoy0A/+PvfXZIt4zNdEQkVLVk9G2KrNIMFmC0zhp2UE143xJGqgIRhC\r\nSOY2X/cTEyD4Z/LB+rMoUIOIYwkBiaFcCiNE2NM5vBpazoskmxkqaMjngJ7I\r\nEaezZkoAU8+nYPskZqSenAFobdemmIGhEesFDAaKEg8m1ScIZr96ASRJDIkT\r\nkKO3uLQsmigrYyoER2j3yU5haZXrW0SumLO63CHoBZHhjWC0+8RtDAr6HdLU\r\nz7m3c8QNUjVQ99u058+xUst2oj5ohAC8nfAe5vZWDWOIvJoxUL0bN1aF+ISW\r\nQMQGEM3SB+vpFf+Rh5nUbXXZhzh8C/UPtsVIkSS84fGja0AQXIVNGMMYoh3W\r\nLtDEf40EYSdiyDm1iYcgwqeCi8rL1O92jqigTRyo/JAdeIAy5YyWcu5B0nRM\r\n8kq4TYa4vKoKFRTZer7cR8zpcCvpCta2naM1V5CWtQ4CzHGGNaXFTjMfKrzK\r\nZMqnKsLx8yiQvfSyQwzJ2WOV2mykqd/rkQF79zcOI2aw9SLK/QVRMJV31Est\r\nLOLyRGlly3/8OZOl+Zc1QNVSM6ndwFC0wVPaG8hVunwKW8HaRf5uDMA/OkxH\r\nlR7j0NdriT/5PLdSH0DszSb0YmpfEZFdWwzTVHf1blqIafGkTF36MWrMaEgI\r\nYXbin9pwxGSHjSo3ZPSRLtQLEvRgPbr4E58=\r\n=wG6G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f57e14292d15baa0622cbdc419439316cccf9307","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.5_1669806503564_0.754041030658946","host":"s3://npm-registry-packages"}},"4.2.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"81a02687d0c3a923b0f03401f960b8e2afb2de97","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-beta.2.tgz","fileCount":159,"integrity":"sha512-ZItMy08sZqP6XdVixaTMFSOdf51XJNmtCDB1NGX0kygjGFvMI2i5ETf4ryUSzFqtDz0NiNB9edDSA1yzX72j7Q==","signatures":[{"sig":"MEQCIFUMvl6vh+wgWHbH729E/QQd54HsakBjLdk2fUnA6ZdJAiByxskco3h/dmXfuJmGFJhNjERbTSbOBC0gpP1LBSmEtg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh1UiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCOg/+PQueT4bgN63fW3xiNfavVH963tcDbmzKOnlYV2qs/m75rsdr\r\nirs/zfP0fNMTacVw5PcYuc3URSwVuMg6U3wg0hZDCvcUPIX+JtSieGnbKGRK\r\n4Lyw3m9fqb9q9V6GDqFJoRefi5TlY+UODHUSQCiWYZ2f/RMFQ/Z6Pi8lUeLU\r\ns6ux7u+ZQiqLw8j/u0cQbAXUZSZIb5Fe7AcHKWCfteR/dldBfA3BgR3YZxHc\r\n9QpPUMnFXA5NqA7ym1GbSdAm0gem/yofvFqckqoTIyNl8ERMbMPy3FitoEkA\r\nI9cQ3foQfISTD6jeq09oV7JXhNn9+HathAgWGhQmfVikFZBvJ6I73JLQKRfg\r\nW+VmUjCGbIHepsT/uO6F8TmXNTL0exeRjTOpMJOZEZJxHY50Jef4knd4Q1tf\r\nunGOWBVz5xx1kKjkTEJAJMJ0gpgydVU7MOq3bwgSCVoktTxXYKe3yFLqIc+M\r\nMbwrh64N46XcvO0sTG0A1IIjVMt+K/jwrslz/vdMn4p90Pv0HT15sH0yds4y\r\nsYh+2iVp33Ruh+KYbnRnu/eSNo1RECoWOdAzk5XFFBrk7kYBNGSeTBsR43Qh\r\nVDoukcvrl6hzqLGNAV9UJ1NK2SRDfN/YYhSFNNzcIS5SdR3pA9r7CuElKhB+\r\n/kt+dFizMA7rZuUkxU5ZoaicW0xTu+b2mBI=\r\n=bExH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3341f2191c25a0f259b2db1dddbccacf5e434aaa","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-beta.2_1669813538205_0.20603816625014137","host":"s3://npm-registry-packages"}},"4.2.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"eb7fc7759f1c01daea36168769a4b115210e0c72","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.6.tgz","fileCount":159,"integrity":"sha512-Om7yEYTkAskC380p0Uc0ZxYRjCRhRBjz2QeCOGguQ/B9xrPMS1Qh6nx+Ef22nPWziHfoM9lt67P6++EeEEQUWA==","signatures":[{"sig":"MEUCIH93ss1WXyqVr2fwdFDS2GS5yZ97UdSoAHLm/lVk69cBAiEA8S9JVWO0f7kBnq7TQlnM1/nPRvJimpkrsDEapjgtK0g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh1WAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqryA//XeFSagCOm5kAqqlkjC1LAcak5ZRhlQ9KYfPy2BCTEw+UnxHv\r\nHu5//6PO/63YZeRaamEPyAbnVI5h5g0y1O8iH9ffyv2HD1xqeIqOSk5mXEPd\r\natKGNpCkzZZiSjvJh+Rfwm6nptKYqAZ8gkVP5t1bL2HNmUERMj03fxzNMLMc\r\n8qHvSSe2ZLz11lbtukEDTPUiOOC9Xa9II8xcaNsaHcQojCclug2ZlSpj3yiH\r\nsd71+jJ0xfODSpG1PjFCvZYiRpisDfV4X614kip9nIFGbUAv6AOIt+F7yQmC\r\npJHH6Oj3KoXxkqfoxYsbAc6yk9MFEBmzCwheBtut+ep5Dqcq9OBL4oDNe9Wk\r\ntgL/AIZxmhqiv9t+gzrBQXL6HEM2RCptjArFVoK9YKF3uw3tx4pUO9r/Xk6h\r\n1qb13tFK4EjhKQKjUJjWEutvX/E1HjLFDm/n4ZLtPG2Yzs74D4CalcuSJpfr\r\njG+QvXNZpaHjAX9os1eaDRFFKVdXDF6nRY7viM1JP+UUIxDgvgNNVMfXroZl\r\nP7eE5xEz+8KIlQBybFxRQmruHrjGnT2HaPp2TqC+VjaK2pOc5zJ0joHaLtGU\r\n3ExOKqnIda8opnc8xTdL9W7qCOJ0Yg73p8lFtmLPjEUAoufoj4KzTqhnJWWI\r\nQ4gqIsUo8xnr4Zd1QaFGx5Fd54IDwR+vEAw=\r\n=+79K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"14ff29193385ef5487cc52d234dc159ab7369443","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.6_1669813632331_0.8572797413796978","host":"s3://npm-registry-packages"}},"4.2.0-feature-55d50a-lb4tijdc":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-55d50a-lb4tijdc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-55d50a-lb4tijdc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d6ed47f9c8b7d8608b62948e8a1fb529d95dec77","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-55d50a-lb4tijdc.tgz","fileCount":159,"integrity":"sha512-tFUffn3h+EFDzP92NLAhEO93lADpsTyaaBm88eqbuNkLvmo0pbAZHmU4e2RfXsMgA0b80SA9Cm363oQBLyCd8A==","signatures":[{"sig":"MEUCIQCxrqud2bTsRDHuTCkQ2RC4Mg5Om5SN3jYm6iWdEr3ajgIgHjybDxmtMdBJHmiAXTcy7/rRULrcgfzlY+2RggDOukY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiGZ0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmol8Q/8DxHGwOW6TNocRaozGC/DlP3hD21H2MqY9U9KK+EdGR3hKIuy\r\nZlZhZU0j9pt0hVLPr0Qn08ehL/i6vym5gVcD9TgsdktFoXuskYaPuqZ13BML\r\nPne7LQ9DM6s6NNPgTdn1caBxE0XEyzfRLWsYYCUqUfi3howDP7y5lrZwvXW2\r\nQJAH+Y7buCQ/UmqC3QZS6dXg3y0PLF9ooSAgAnPGSHtR/UIDJOI5CDb1Zdje\r\n2l6BxBu8CnZiSGw70lPhzE63lkHAFRInS7Tnf/c5jD8scOHhVQdv52HcN+cH\r\nttUOEhoaQvmKDL0gc9kKKybGa37OKL4F6MhtUcLcXMYN3gkoNYpLts+wl8Dt\r\nteagCmnSSawHnUb2iWDohlA4iZfauVr8jblXmuer4NhsKhjeT/DjDTfZUQLT\r\nzgbiKzd5W2ShVJH/tOfiE8IVgiUAxdR3ilfcG5APROhr9H/CrXAetM+w3T9s\r\nrEVo+dRRAVAdxD70Gnwie0YTDT8yHE7iFZhlo1M69qtJw0ClCYCYy6jTqBQI\r\nQi0/A3CA8aYXJ3tNj4ySkX2+hkTTpVOXX9NqiMmN02N0N3UC1cqFoNuR7Rbt\r\nX6ch8ccXWZpWhnlrUup5yahEB/DhEsoA4IP9YZhKXc5F3I3GMQ6Xhw78bhhl\r\n8oG1XD6CwzgTDvA9NIPpSpFMs+j5aNvrunM=\r\n=pL4c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"55d50add3b1b998624819568c4e5fdecf4ed782a","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-55d50a-lb4tijdc_1669883507819_0.6504343163578343","host":"s3://npm-registry-packages"}},"4.2.0-feature-78ef98-lb4tngzc":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-78ef98-lb4tngzc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-78ef98-lb4tngzc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8b2b0cdec10d5b63645da6a20f79fc0b14326fe3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-78ef98-lb4tngzc.tgz","fileCount":159,"integrity":"sha512-b5q+n4xA60WgCXFQXr4T5k59u9Q6F0vBXCqMUJM2lI0iY6Ur91ctdK3jiuLlZDlIeE9qTHJ2hiD6wWUHMHjPNg==","signatures":[{"sig":"MEUCICKkNwCqjoB/KXXaKz1afd5z87Z5PMdySZ202UuUltUMAiEAg0nujO3bu1uaNtQBGGsUzLZ1HMbc5hb12XQumJjc1xo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiGdaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1WQ/9HWXN7jkvf8pfL3GN4RC6scFdHYDVl1/rdIjXkxwfYkbQLMir\r\nkwU+sPJhxk4MTdZmonX7BOG2/hp3anvFg1xBf//NbJssVi+eA7IqEIb5aqT+\r\nklKhlO7JlX07uNPyAoZulXv3jJKEvRXMgDf86MqDqbJ/MiKSO1mGwG5K41Qr\r\nluXE94r0PZ3WICPYMwFQ6xcXkKwLZNqhQvhSj+AUubYAH08yuQShz7PqtZY0\r\nd33cnidqlmrCN129Kvvkrm06qg7UWRasYLBLDnWKx8FKJ3gkkH7fVlpN0IIA\r\nPDsDs6zrsJlMSqe7zO+ewUxrUuSMSFKgjTcrTgMJBN4daY/YHIVEMya+zf6L\r\nOjwxGOxo5+cab1f7XDNZCPR15sJoYu6X9SIX9j1wHHFk9lPIiGd0ebC0iwOe\r\njiseoN9EDWHCl1wwznlL1UhwxabjQpmTec8QXsbF/JNKULN1BCUP92njZhGB\r\nQjBnorAFwKDMyOezoZo2AmwI9s9Z7wooLOOxInYFy+G9AYyOumrHetu0K3kh\r\nffBjM9qMBHkse8jOGejavrBgqcQPTvz+CrMWpE5ZuVgh9jhxz8eMC64qgcAm\r\nNKd6qkC5rTM6dIMoas1xw7nfphWOw5/E2Y1/DPEukLVfnQdBG+brhMxjJ5HN\r\nn301J9NCfW+4o1xeVd5tmD8kgcgbg3d1frk=\r\n=wYaW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"78ef98585e400c41b7249a9185794e14812aa74c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-78ef98-lb4tngzc_1669883738261_0.23494634001325054","host":"s3://npm-registry-packages"}},"4.2.0-feature-9ca449-lbb52qba":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-9ca449-lbb52qba","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-9ca449-lbb52qba","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e07aabd6e7b6ebc4cc98eb9c098c137119aa390c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-9ca449-lbb52qba.tgz","fileCount":159,"integrity":"sha512-QZgaCTxN1sTBxv6fIdEJrtOh5lQa66F8exZE071dZgEO6veAVxJIzAD8ZPpsLiA3juSF3W3/trqPHvUM4h6mZw==","signatures":[{"sig":"MEUCIBMfXBV6xdkDQaBdxg52t5+mGZyQJXNoFJUGR+MXmdsXAiEA9N0m6V3kWTjmS1a9i5+EKMXTf4UAsWmuRW/ZAExIduk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":535176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjjt7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEgg/+OJq9xIMG9a+EqB8z3shQIKrVtcjlAbFXH0zHkRw3GrIsq8YV\r\nmcgJWzwpBwRmKNOps/lvk4dgj+NKs8Peo4mUEKEQ8MjP71FnQy0Tq+mVvNRp\r\nzPBAYo1Y8ilqO567TUJVy4SXHo79lw6C4c1LLp9oEBSLpsrGQ3EofYSYOiVP\r\nW1WcZ2EjfstKxMowfSuvof18Ay3wwjdesSIzO94zBBI/wdC8vW5UWKQ7SUZr\r\nxIlW7QqlVNMv/QTfbhF4HrvNctT66W5KiDSGdwK7/C4GI26jRNVH2JUFjcv0\r\nZHzSwGeAFdiD1xZMz5Q2KHfM/Oyq77RXonXaLhT+mrJWYRJrSl2YjQGijZsH\r\nGo8Zfox4ilGYtDICDEXVwVGZX9oYo/jsKkTSoEv+sdMGN+OznZN1ccQ0qm5t\r\nTp56zWTUmR4KBuvQ2P+rVkd2pfR8lKjykacCQZ4ylpfEaG659SuPeME8y8YW\r\nxxANFssGLvVPHlV2NXowH+oEHTslVyp9oNPb2KZhVA51hEpK//RnxgOYwqkF\r\n86kTGqfuu44z7ZIOoyOEV0ydR96a+P4Abbh/5uQ+IxNuTS+OBR8Qrp28jnDZ\r\ncwyyUijlYeus5yRv9Hh+c9JfaOzDUsApPnj0mjw4x8WN6NLMPZq3K7qoSvhM\r\n4qld7tIo11U1U3wbjl57V+pL5XOMG88GEmg=\r\n=kSks\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9ca449a183583cbec897b55dd844c7c38f1c53f7","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-9ca449-lbb52qba_1670265722712_0.8080387521414485","host":"s3://npm-registry-packages"}},"4.2.0-feature-801784-lbb5n3ws":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-801784-lbb5n3ws","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-801784-lbb5n3ws","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3d799b5a3aeff7ade9ffb7bf66e8928baaae4ba3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-801784-lbb5n3ws.tgz","fileCount":159,"integrity":"sha512-KMSwbf2GRPLaPkbELxN11su6hmek5E4glxpnRKJE+Biul4mX47mCR+8UZi/2AjxuKHNXcovqQ5uuh2eOcLBXtw==","signatures":[{"sig":"MEQCIAGwNGzE2NM1XTEGknamKRA9Gn5imbkKIxt4jslGf9FbAiBvCjPtQK8zebC+XbgIs+7Q+JZ+n+WKNrSC42/I98YfIQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":537338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjj82ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0pBAAh+etRrAB+ee/ElnMlgwNPkajyEcYZP5c3/LtDwkouv1wxGwr\r\nkW8bxh+zSyYxMpfinmRUlinL9FgzST2zknBgkbUw+ebTiix/FgFJQSfAuiqD\r\nDw7BWOteRVQKtzK/+zEIsdCs+Gph+c282hJBqSHE6y3xK861w/+iCU7Hymn9\r\nScjsuTXXRuBFme5lWj4ZaLGUv2Qlc0gk6C/3gzl1wN8O+7CetFiRYqCZp7V8\r\nYjDNEGLmOK4dfFcK3qkiKKLLirIf6Ne4LMSt82RCVhv79M9W8+tHbBy3xDDz\r\nmUAy/glL2IE2uTXRrPLGKr98nLD2+wNnu/iPabTQeNTrM9mV6pQ6uB3qrcEe\r\ntbvmG8hi88v6ys3IVXSFtgykwrHheqPXKNjSgvPvP7viDtjP5eCKxXbhqO1X\r\noeLBIx5z4PsPbfdUGTu8adbvQepXCm1mK6m+zxjR01FV0kZjKGGfCIzvEzZP\r\nNILFEj7Wy3g7DYUoO1ahDj/18Ci478z8rShXozOcbuPqPR1mZ/jG6JyrgZj1\r\nXPEU3SpVuhFIb0SK+C0C12eTOjAYppf+daY8XfbC4gBbDGTOTeOh3kzpWko2\r\nWin+pKxNqzWI8fkk4Z1cckpZ2kLhUznQMW0dBAAxgY5GpRzgDf9OWa88Huv9\r\nIVIR9Ieph2rjSeWBSfGg58T4KZrr/j/yUPw=\r\n=Pjl/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"801784675334769008e0555f59d17270c5034062","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-801784-lbb5n3ws_1670266678271_0.30110618260083566","host":"s3://npm-registry-packages"}},"4.2.0-feature-c781c2-lbb7a9h9":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-c781c2-lbb7a9h9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-c781c2-lbb7a9h9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9ac2bb63dc7b22d8636813e04d0d9c1776c93741","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-c781c2-lbb7a9h9.tgz","fileCount":159,"integrity":"sha512-qH9SuiHC+RBRk0Z8ktf7dk8fhwcgli/mHcZQnqVn7S4YX5pqpMr9p1rugSqGUGaSHnuBMvIjc+PbbrZlVpfHKA==","signatures":[{"sig":"MEUCIGbR+LVsnYYlSAB/y8syUwW3ZhGqe5kATnfD89qQdYe+AiEAs+RmQFHt8kUAUnP/c+Hm9IPQaMdC2kzWe5VmzHu/hn0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":537338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjkn5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0qA/+N9/qyVy7wbwxvSGJd4u50VDT5P+lqFbRfVLHP2qUPmcmrxrH\r\nf6J82Hn5EeTCx02c6L1XLrqLR4tT8/9hCVkFLIZIQVJJA0+HMU08hLVzMH0f\r\nxmdLvxJ861sFCupIJ84r1kVvLxrAjQmg3HxiVtMAQWbNLhgKCHoDobtnZM5R\r\nvl5FNNT7yWmou0ti9PYqp3cYBgKqCJFYBNP8VHHEbev4vwIcqC+scuEoSTH5\r\noKTpQTt8P3lBUydNNqb4TtfBBenDQILE4fiTrjUJ41+5S4HDlEfNelxGKoCp\r\nH961nuw+WbHz25/FcqB2cNHVoj1dR7G6M2mLHnaCoS/tLCH277eMdFnpge/f\r\nH4D5bxD5ev7mcLQy8eqqH2sZlKxICeEjkOmyDpx/E8vE4NODv5SMX+t2GBwu\r\nm+z6JMHc4prv9O9LuSYUUUTEr2BSEWdH6M4TGoOg6CYoTb41NTEdZuKj424x\r\n3oJU6T4QA8YzFKOtufQeQP9FwtkeEwcZy6PPCtt+LsewoGVfUBzQ+dFOuURA\r\nsS8tPXY0gVWB/P2jZj8201W55kXc6L7ofGt2HXKbSxs/EvqZWPJExYHPV+Nl\r\npiHZA5/BDkWxw/cn2nVl8YiSG/3McuYDYLAq/PjpfwSlzhH6fEaKWJT8YaUi\r\nTLhxKeEs3l10P8SJE2xcTd1cagmaljCz9Nk=\r\n=O6Gy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c781c2043150fde5a14f17b3123d7ebe099e8a94","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-c781c2-lbb7a9h9_1670269433622_0.8131969047133749","host":"s3://npm-registry-packages"}},"4.2.0-feature-c781c2-lbbz2f48":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-c781c2-lbbz2f48","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-c781c2-lbbz2f48","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7f1d5ba4edb3642c2ad6bdd32d68a684d1d39edc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-c781c2-lbbz2f48.tgz","fileCount":159,"integrity":"sha512-V/BCHXY6+JIgh7yGXg7Cv8uew1ussEeXVSzDFwQwvj70Ox7botAivQwn81op41zBrocuJF4NSlciIohAQxQ+Iw==","signatures":[{"sig":"MEUCIGkzHHVqKonRRKgvid+aWIbu1zZs4gy430+bb9BrHOVsAiEA2bUWwOuxfJZq4I6MZj7tYwrotoFYrP7cNx7xKjekG0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":537338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjwBBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKHQ//RofG1HDplZIeAph001OxOdepsACliD3RJlSvgQ/T4626f9hF\r\nqZWp5fHOEdK5AOrUPham/INk99SD7OCTAXpxviHvZCHrsrrLzKkxUia3qVkZ\r\nwzkhTnq5PPMpEb2WXnRa4j3jWCPhwLRgzKfclsEhI/F7Iu8TA8wLWWpNhFO0\r\nG2lGQfQYYmY9iTV54LX1K0/xAFQ3nZlvbri9NyclQ0qKttsaw3c7xrnPUz3j\r\ngT96z85TWBGhpxPn6dVpOEdFYe24I9Atsh9kmGn+bblnVNSysTzSBk2gA70y\r\nWpo+V96poNunCZv6KgkQuua3qEETE9D5ObkWOjwab07S8KcYzYq2JjLyJK2m\r\nqasu1VtDT2S8jOosUFy8bxhvn70vga2Py1VR9vYSoT4Kx8Ncmd9BoguqyL0Y\r\nBamXA3RsVDcn8ySpk3fPnXY7/vdnXhpW5SCyQRAnVBc3GLjKGbaczgN5EBvJ\r\n4BtNFlxxISNysYDdnR/14AWOrwH9hBZAX79RP2pQ5TjuTIfEZlRyIbO/rRm1\r\nobEK8SvErQxPD2/n7Wkl4fMFDgMHqzxSt9GJXypC9Pjx+EU9Jmldx+49wRMM\r\njOKRZbieNHRIeX3UOHz/fER+1GTOKW6eC+DHq1hYGg8YNG6ibmUkSUDrEVML\r\n+o45ZLSUm1aOrXJGDk0QWwuakISdKw+YeM0=\r\n=tgnK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c781c2043150fde5a14f17b3123d7ebe099e8a94","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-c781c2-lbbz2f48_1670316096921_0.6787888356520606","host":"s3://npm-registry-packages"}},"4.2.0-feature-35e5ae-lbbz3ecx":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-35e5ae-lbbz3ecx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-35e5ae-lbbz3ecx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3228081684848e25109d576e23a3dc6fc574c941","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-35e5ae-lbbz3ecx.tgz","fileCount":159,"integrity":"sha512-lVucwpkRF/al2GkK+wNVrPLpAOP0mYWDd1+mPw6ZN6nlo4kXJ758XbJg+rOnCY1mMmjw5sODveFVzXwbeZldbQ==","signatures":[{"sig":"MEQCIBunND4FVSxGyJazBH2NOla9OVcWrMCtOWfalbgCJhi+AiAqDCV7y20qrD16lvkRHUHCFrhsVMaTd23eVZ8npmClzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":537338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjwBvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpt0hAAlyB82pw/KSI+vqy2RuFARFxgjgdloDDH2LCeo1a7GZZS7tuz\r\ntANo45qoCtY02pjDo+t88tU5nPM2tnuCZjApBX+AY2qdN1lA3zLF4/mLhIpd\r\nMZFegin8wHmWavOgXJe70/2Dd07K/20VM6uFfI4biHFT5Guh6jq3t6vPTs3b\r\n+KmLxzUsNrid+o1TBRf00oYibhscjWq1t1mtt/SYYwg7yxJ+kG2gpbKCJ9bW\r\ncy8RtVVSXlT1pW/WRFhY/ZHBCq0NbaixvbYCo1G4PDRk/gviv/wXj9G+iu+7\r\nkBy6fonRpbgBT6/zkwGf04XXdF1ri9FLh0xSB7686oEutV4DjSj1oWH8pZl2\r\nRlEaTwiD0khw6u0tiYtBYFPcjQNe2lmqB9wf7i3m9JVvy05RiQw7oNPkixPm\r\nLjv9e9WSoXB5UUCUoXV2gmuuLXIkLqqQ+r5jJDqD/3atJF8RrOdpNicRy37e\r\ngaMdM5qYIkfu3zn5Ut7Nn4WsKydp3o55KQyNUZ5f9s9Vhqd3yYDnmyQMeYz4\r\nEp2QwApK5n4o0NDD5CFe/PyHejKq7aSaPhgibM9ZHQ9VZVgTZgG9Vtg5UFEh\r\n2SkVIM1/cynNs/DhQxMZvnFwk5+i9LD/IfGVTFl1SpyW1GXJBZoTRZZpm5LY\r\nShOrJHU+up3IIdES0m7hswX/XIO3Ad9RDyo=\r\n=s6j0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"35e5ae7f400febb94052857f31a883cb1abfa9d0","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_get-all-cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-35e5ae-lbbz3ecx_1670316142726_0.6703750868449299","host":"s3://npm-registry-packages"}},"4.2.0-feature-cc6af2-lbbz7w9d":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-cc6af2-lbbz7w9d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-cc6af2-lbbz7w9d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d661e9464b819aac7e31513eab0b3584cbb14666","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-cc6af2-lbbz7w9d.tgz","fileCount":159,"integrity":"sha512-jkwhGXGKtn3UZCLvfRY4HaUdKCPQM+Lk4snMeLLobHGT70y/HN4hkBZ8nmx6flxNn1g1hmhCTLuwjwuch6S++Q==","signatures":[{"sig":"MEQCIG7nm2KUZMn6DUwiR8AMBPdqY/eVjeJrm3QVst8SdguWAiBafj+jaJ2BAHPaLcljZfUCI0F+QN2jzd1qgeXKNmzcbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":537336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjwFAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjqA/+K6s1A95ZUAMxRnOQT7GIK7mAaZ8qasxZybN/wVIv27VZMcTF\r\nzmuIfwPcWCaWJXlxKhv0vyseNLqQ+EhDGT52U92+JkS8W4iki97ptyU3RSfh\r\n6QI1ocLYV/e02RMtEf/4W+P8zvOmVBKRKasdzn3YQDeyFbz/f/L4GWcJ6fP6\r\noz9H95ApHzTsRjefUtRak/BiJT/ciBwD6NgPR8zxTndWxlmZGYiMJ9ivveok\r\nfSUNSY8X9z6RjSv2fsgx0dz1LPsUe1HaU6S2nQt7yHlYW7m+JGAQsvJHgl+7\r\nNJy3YgUldvV3/NX+A9WQq6AssHIWzAP6yiuiZO/FXUnWhYGGzb4/Ng4hi781\r\nhmbknul6ty+qG42NqGHn3WKfFKj2rI2Zu6uvSMZkKvr2P5D1rkTQ55pOrAaN\r\nqID1oN1BWQQK8dA5aBH0AbcrZb+SyBevxhfAkotcxKibZeQu12GPQCQpcsmE\r\nK9bjkgT1DE21iIqVE9w/+eNq4LXGe/1yP8TtHzdzry01+UQlW7MKlFYMECHi\r\n6C9oBiz0//mWnUgIYHjG7VpsBf5r/nrLt/7R9cO2OouH7XOJasix3QvwTv3d\r\n+ePAFgzE7MoDDAQ0H82KBEt3T1v4YRWa35eLKcF2R2H8r6RKzf+oD+eg5V5N\r\nQ3ZL8n4Jfp6+dm5hefIL+Bd0mg28wiRc0FE=\r\n=4eBC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"cc6af2765771a5f758d9bbb366519e7ed8a85b1b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-cc6af2-lbbz7w9d_1670316352438_0.4199146752712555","host":"s3://npm-registry-packages"}},"4.2.0-feature-d38803-lbgncy7q":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-d38803-lbgncy7q","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-d38803-lbgncy7q","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"db82e3b02c795387944f06f04bf621cd3cc48417","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-d38803-lbgncy7q.tgz","fileCount":159,"integrity":"sha512-CCUCzJI3sUdjrnIUZtcU4wecyZRbuo+GfrH5P4up2se0hLK4FwR4qcf2sz0gknuUFYkggg40fd5DQD9a+9OAYQ==","signatures":[{"sig":"MEUCIQDwvOyffeHITIZlWz6RzLhnXiqaQFJ3lph3nQeVX0MfggIgSujcjrlB7dixVrYUBLzvSXmGsiBB7uPx4tXj7CvRlEc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":537898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk1BtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLow/+N2WgtaET3ArdeEX4mekQh2Ls5cylMthzsAajtz4Gs/rGcUmv\r\nQeP0UK2CEzCcU8K2LZS4EzyfIXQl3xbx9TJJ3GGwzyLTi1QzKfdtEz4l/Qui\r\nmnK8jek4CmClap2pk7nJjJcT19CcnefPKFAN3BUWaL4o3N6HiMUULNdGI9eo\r\nBHxouxrvZ7v3h0s7FIv0dTzYB1VUNRnQSXZhm0Vejk6fsW5QnFu4+2Z2FnHd\r\ngGENdF8dL3f4/NmErFp+ouZEcmtYCIVVnSA1+K61tgNbCXGPWFQ5Bwf1DB8X\r\nAksuVJMBrch5dL8LEeik9j9IBdje096imYZagxlNltLBI0imq0BOitGYoReV\r\njg/kzrlpXH1RXL+ru3zrql8yyHWsI0iUBrqNl0YGdSxKVc5jRCAZ+t/erbtq\r\nHjSUl24Og0NVxaLL6/hIvtyKfjn+LkjHp6mIQ0dZDiiRQX+j4WF3c2BXgTjW\r\nxzOHD6FhnZjZFr+csAykjV+nYlvShQLgBJcsTAvGT9xqseF5StNrccjvS2aZ\r\nyVXgnH62NaJ93Dt2nYalf6zI4jJb8udvYE4rwb+NOcj09/pWAs6ARqgDA5Op\r\nMen1zcVF6ukDoz/Wm05qctczndQX2nu3tRObPrxWWlpNVFGAmqhdaViEK7GP\r\n+InJGUzAQV2RvFgpimMAj6ljuOlqkvhIonM=\r\n=9Y4x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d3880350f6e5c566cb9cf45ed28c0e14df82339c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-d38803-lbgncy7q_1670598764854_0.5045620512137086","host":"s3://npm-registry-packages"}},"4.2.0-feature-da80ad-lbkol67f":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-da80ad-lbkol67f","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-da80ad-lbkol67f","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2ef3058f5091d4bbfa9911603edf1b4d9dbd01e6","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-da80ad-lbkol67f.tgz","fileCount":159,"integrity":"sha512-10b0E+dnWsVPDbkahbX79ZgA6p2zhzvLuKb1KGKGHdU2RaS0zQxlFcDUgN40odnojfuY/wsCi7G++JvNMGQpHQ==","signatures":[{"sig":"MEUCIQD3txbaU1WgR4IIotnzrdwIeBejJ1u32FrhtadBzIfe4AIgIfhzNh747Kd3rOnfXOCmFElOub7sK0dYydKJ1Xvp4Dw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjlwlEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnAxAAj7FgWyhNXbSm4X52ZG6wb9Ohu4WBwK1v6ZVhNMh5WWBOlecM\r\nA9yzrc6tw1sf3pY2+CLYYlulyXZf326QzmftFRquYiDln1TqszJQ/5+xOTZC\r\nrgFZjT2nnijrC1llz71Khly1+Gzo3zEsUuKJh3cYYpvGRXZbnz2OA1SQjMmr\r\ne2LirsnaMXHbnLT52qCQtLqvnpV8M/KL2/Uv29XXACY2/Q0HYfoLY4/WVRrs\r\n/YSzHJ93DohmKnx0Je+h7nULeGmfwo1OuvJ63L/czfxiJK4fmqi7tghvDPhl\r\nFg4gpedSHfKzyn+oBloxeGYWTi+DYH8p4sLwOgkbJr4H+FUTCf/EPmY05sFY\r\nU5ZO+UaIS9ZcFJkKnHvr/qWH1cjunUaXxcPmAoIY2uLI86BX30fcm1HomR1R\r\nlVv9YrnizBs1jnUIOAMv0WrUnVWzspC8HqDWjBYOyGWRIegPN7AWNSi4+Xjv\r\nviaUYmN5VBTo3wc93noYZSVhHYx4IW60yT8of1x39UqrYUitrdJtYqE7N7Ji\r\noIeYFaxwlFZfdXtF65GqNWHpXQSo6xD9V9mh3ShzLCam8dKl+2XEUWGDM/5T\r\nyb8JSkoRSGILKh/pvQUGuuJ1jd79QYfkblnIjBSUnEGyS3rb6Ek9aKc2JAKT\r\nq+RV2yosvCtsX5KazuoMRkAkpYH7aiIwse8=\r\n=N/v2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"da80ad8e11f5fcc9c3e6699c73a981c586f051ad","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-da80ad-lbkol67f_1670842691880_0.44710318565900864","host":"s3://npm-registry-packages"}},"4.2.0-feature-1cdf24-lbm84n3t":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-1cdf24-lbm84n3t","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-1cdf24-lbm84n3t","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74487e7af6c274bcb2bd72bbcd1a305223446212","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-1cdf24-lbm84n3t.tgz","fileCount":159,"integrity":"sha512-AvrXFm9sNGjWAfxK4UK6f1xLEgkH0vnGS7IL33vcGbFhGtE73dVdAmqXW+wU3Kz5jzU2YwfgkxH5TUrO7oEM1g==","signatures":[{"sig":"MEUCIGDCWo65j/r6x+duWy+ptD/jbXuF25FJoRrCwNAu68LUAiEA45eLvA2AeLMZZkCz6OtdTPuqy2+uxTzQVPUgNbsWB9A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmHWrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqclQ/5ATh6srJ2R8vBLwN9yr3UarPX53CY6F+ftkXpLBLPfbSDDHqB\r\n278VV27MblXClv74ByAXFYktVMsK2EXk1eTb8qvDGVXhvqd+w5jjcf4Zwlly\r\neRIOPijA98P4YQm0XdDrX17LMJGpMQZT+aCT7MWlSzlHtUqiszbpPWlKvTgb\r\n+FMn6f8JPfBOs4G/NNW8mXm8aRctAG7K3DVIW+K/2ZQ0GS2DJVyEZYG9NQOs\r\n9F49hIBL9sDEniWHa1Yr8Fx5J0bwrYPiCmHVbT+TniGmZahyFcrtO2ZSSs5z\r\nbJi2IsN+3L54f/dTyPxDARuRvA9S+0tBcv5IxzPedZEjFzhQX+5dwa9c1QJP\r\nNK4KxxnT8NoUkM8WtRyPSKsCHDrSolc54WMq5cTMRvOrBH+ra0LHBrOlpxz2\r\nek5P8pxSorVyQ84qiZH82nyaF+NFGgVcj+JQ5qpw+23CJaU5GIL/+JB0lp6f\r\nWyLsgBNNnevur+Qa+6l+1IvjpoOy2U8yGebZ1dfM4o2/j7Hs8ejPHkwmp7kQ\r\npFX/TvVZLIZQs7qI4mKmw07HM0ycAdW1cx+e++677b3kIi2PpVs6TJHZkjVK\r\nOAONG39OEcNH5gtvcFBsWEuJVoAIw6f+P/LMbc111PrSuZhNJOtckuiY8iDI\r\npMI9muri0G9owRpV0GM89js69/LWsglEFfg=\r\n=dmD5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1cdf245dd2071ba6cfb1799c78a1dbea3900308e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-1cdf24-lbm84n3t_1670935979590_0.14067282060467146","host":"s3://npm-registry-packages"}},"4.2.0-feature-8ac43d-lbng999d":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-8ac43d-lbng999d","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-8ac43d-lbng999d","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e4bddde475adfb12f724f2d90ebcde9b90c0da56","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-8ac43d-lbng999d.tgz","fileCount":159,"integrity":"sha512-GIiXVgnIehjCqsPAhc8O7oWI2N9jlquH1leZ6YuHWK7ZJ7NT/OP9MvnnetMJvDV86ZtPL1PXqEO18k8lPZa8+A==","signatures":[{"sig":"MEUCIQDlEZM6+upyEGsCKclONVyuzYYj+023L/ns8GDSHYmeJQIgbi9z1NOk3Q8NZyHQ1M9wIjjMcX7zH++52CCFXhzaaUs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmZcxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhEA//VWDFNvL47s7cfoaQ6nehPeEJsLpZfoNi0olpfC1YzjmWfcdl\r\nTHhNE7IC0+/AuC6f5tl7QztlbyI8Hx5WwgmcN5IOOe5FfYfCKGGIl6S2DgH+\r\nPWN1IjHnSfhWRv4Ouc3vPTyBLoyeahms+QD/IHFFgx6aIldDNIDpVGzGn4+V\r\nVgWvue6B0v1Ev64HzMQR2S9j0mcKNZV6fsdYEVLe8WeLv8Ox/xtwzsHBCRHm\r\nnW7r0z98PyCb99/V3kl367ohk/+1X/IgvW5xqWU1abe75wK+lbn9T6HX8bFE\r\nx/Yr1pMouTgjLxBPnm+dCP3rjN9giKL5d22vX3CGvcPM7Xk84yI0ywdtO3Vl\r\n8mboBfjXkFNlDgQ/U/a//dCU6gZJh9d7HwUvqJnz7GCBy+/Fj7kVDWZqwbfp\r\nEZr6yAktAeWbPcCzuJezeg6+LM43i3pgaI3TIj6TqYw7ILZpW9+3irfAEuUT\r\nDsSI0L8epqY1KX/6WwYmWMfkvcu0LDEsMAU8Jovjlq4BtlllP7j93zm8XXUv\r\ntV3ECkHewVI0ZpTRcnl4kB5KUWPYc8GXsnmvGjUl1Q8uCGDA9MKLWimkBz9Q\r\nR+OfGDD2tJBvqCQ884+e5CabWEGgbm4EnuGJVEN1/IfsQkjB/ndphS74ptge\r\nuitmyqCTrBR7mLgUdSFelRGGRg5JR4se6KI=\r\n=MV1L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8ac43df3f37864d99551c6fe1275d87c57c1ee15","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-8ac43d-lbng999d_1671010097227_0.0289146283792987","host":"s3://npm-registry-packages"}},"4.2.0-feature-40fdb6-lbngymg0":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-40fdb6-lbngymg0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-40fdb6-lbngymg0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"82a61499ead2fc8e9376a9be14c08bff8a36326a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-40fdb6-lbngymg0.tgz","fileCount":159,"integrity":"sha512-FtsUY4vu5qLyC5Tj2k5boCOicSG6JiQvQXQ317CkYIkS+pg7k2YHHl0i9meix1t2HNGaSQFzbPG+Rn1zQw1k4g==","signatures":[{"sig":"MEUCIDovPPnT2+eH02VbDrqZ6Wte6r9aa2eoiIoIB2rnJWGtAiEA9Y2jXD9DSmwJk1AIIb9QPgy+Rm4E41YNx0x79AEBtAw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmZvQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrM4RAAo7iWxvo+EgVkoNuudC8zOr4wuqq1rY+fHLwk0SJUIXEsv2+0\r\nAVHhOyRQHcbVvHzwU22r9KjtCPAXvqrSNcZrRSHmRyXGxpTrTmFNm9CjdQ9O\r\n1nhyPyi/QlDjN9AApdQBrAfbEnS9cjHNaQbD6Q+lTCrLPUyvjYci7C+Vr9ty\r\nfe5dPfteV12zTs9AtL0oPOEO/JDSIrmgiRpNBg5gLS0TNexeYCu5M3HoWTyN\r\nwLdz2WNUspaJA3ZoEMNWe9Zx0SiykapvsHOX4IqK+mYchazR1ADQXdvAYPfz\r\nvKZMDYo/pIdLxc0EdlrrvLd7IQw2Bp+KgLOWsh6jitGMAtO7rc7uUOb54hOk\r\nVj5QEwCmpA6THmhM+Zgr665EujmqFtQVV411YwT+y4anl4k2QFzv+DRe0Sji\r\njw4N0tTdf/7u3ncoxpZxdtpWwiJHDA1j6ysHXqhWjZEPO1mnrkO//OjeMaHB\r\nL3QvxDz2B/+ovUn+JuJVpuS4ZgbNwM8872vLGucnM59ve95N8HVr//FqSnKH\r\nu/bo32M89EGhD7BFcoD8p1CHqEKet662Jl/AX14qCLhUOcBZel769o7VXVW4\r\n3ykZ3NBaZLhTJ4WiHqJCKgptq0HL1irziG0qp9NI+fdO8fc5bQiFCqEio5Zh\r\ngbJwkM5NaJFwlztx4YbbDe2GVtzIBxC14qI=\r\n=BJau\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"40fdb6087c7368c00573d62afe187e821337313e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-40fdb6-lbngymg0_1671011280765_0.4371033497852652","host":"s3://npm-registry-packages"}},"4.2.0-feature-ed00dd-lbnihoav":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-ed00dd-lbnihoav","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-ed00dd-lbnihoav","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3c30f8b547448bee0a045d11e787816c69f18284","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-ed00dd-lbnihoav.tgz","fileCount":159,"integrity":"sha512-B5Z2MCBoKqTmbb8y8Ve6B9xGdi1p3g0DoiUQzZ8IXNHwAd4YxHTbY3mTs5G8T53H8FqiLZ2r8goF6KHu0D4TCA==","signatures":[{"sig":"MEUCIARq2borEHGFGa+umwKOaL78neNqylbBNDrWfUMBJBHUAiEA4+Cz4C1rQfsph1vNvhjSGBhppgeL9arBuCN1e5apc8E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmaXZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYHhAAinuO0P2qxz1ptV7F0ZVSDrnqKgfGOEvzq67gv5Z99zKgPEws\r\nl/Qf79ft+lgl87ChBhczmuMVFXUBYAkvH4WvOn4wjIHLmSoZ3mo+eBVIGaZk\r\nyfqOvuDJRNpai+xBb1QS8uyVQtFv7VLzi2PaiprWJ7Qnu0RgppyAUwKEOEb0\r\nVOj06sBzkr8L9hbZ8wU5xVE32g1+K39neg2WFdYALZgQXcW6vzQ9cgYnGyxn\r\njBEzs1a8U6JCB1PwgPCjv6S8E1QKi7uAgCmzkw6QhoBXMXtY4/HF9ToRMZov\r\n/xaGWl0NPTLLuKLj6bMFKYFDeotmuzNMiuaYM2x1CYXl4Zi4NjwoPyJHHfdM\r\nklwMGbrcyl0u/F2mveSPV+g7G9UR1mIg6dqxHOA3R5JwdNhdoz/lUdVxuaPg\r\n0nP558hcXfUJ/8ov67a2LmdsnoKsW5PmKOAj43gJSoz/OIM7kuR3C7VuPp2Q\r\njUduJCWFtiYeSrFJ2nLlI+FGkFBkVM8RnmfraR941yuN6lYorJDC/OdAS4SW\r\n9nII2VPEkE37whj9ABu6i3A/r60AthRSGz67QghcEzr81K7h8LhFlzed9lHR\r\n43gyVBBiHgvFJHfXSLhKEfzUmuHT3lgxvCuLO0vS0EiSiWhzMI/e5t63a7FL\r\ny80F7a9fO92vfg6ex/77qhut3Vanc2/IRQ0=\r\n=ZQAh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ed00dd4da18d1895d45ce58d5d2128100d4d13b7","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-ed00dd-lbnihoav_1671013849445_0.21444754243869713","host":"s3://npm-registry-packages"}},"4.2.0-feature-e5cdec-lbnkrlw5":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-e5cdec-lbnkrlw5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-e5cdec-lbnkrlw5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a8f5de1b8d22945ca7049e56b4c175d9d9f05dc9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-e5cdec-lbnkrlw5.tgz","fileCount":159,"integrity":"sha512-AOyfmAdQtnui6WT+XtjQutfYXxH8IrPdx2SIa/BPNWcST27wbExRCVTNp78ly7VORG2A545yQKowYiCE2lXmJg==","signatures":[{"sig":"MEYCIQCEac7AKhsbBTLN18x567MfRQ7Favg+wRQHBpxjHTF+QAIhAOVTi4a2NhZYsKJXI1muw9gxTCW6gHsNAPOHaEmoVAFZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmbTHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6IhAAnNxScdd3xTsyMGBk2cYeFUQjA7DeHyeArARclbEaSER7Fy2y\r\niaXcMDRpc32ggWL2vJoeZ7+si6SC+/Gyh4HbkaSH9vBjMbSNgw7PHbNZ0pos\r\nhln6eDiCL8qXx+w7MSricghaRX+jGUX1v7ISYxmGCeTGC+caZ5amgj5w97qj\r\nG9W9DRSV7vyoRT1zWWsB4nrSNWi6DPSrbIZVk1OURPtQ3e9h0u4ReIj5GA+2\r\nsbntHMpizSi5ef77iiiIe06rPGBMQM3IBqUHjVO4OY5q6/Iuug0Ou/qXK9pY\r\nB0WWml2UbWC+R6a0yBz/dcxGcsHJ/pq2fIdgd/mbkCsp/qmr19oD7S69WZMk\r\ng2n33qFbtn7rm/59NHjcNb7YVMduAXU53OWizjRH/k3kXol3RHdo2l6vSfnP\r\nryjFl7S4dajtFStHTFiGCp3a2ht6OGL8Rzn5BNJ4ZgCreXSoxFsRQemanll4\r\nL9UTKqH8tcL+E5nO/kiUh1ads2+1v+HHZ/5RTvekU3RwR/H23uNQr6q6kGHE\r\nX2H/mcBn8eBstaJ5hKopWL3qpAYt7L0fMi7wWeTc9Wjgq5mVm/1hdd6D2x0X\r\nSE8jW9xj6ZIInXFZEV9E8Q1d/VZUmU17vXCF8foBW+i7hPIAavTBDkSXUQvp\r\nHtv1KGBUnxOKZD2Bvgl0uyeiX8bXXuHf+dA=\r\n=U1Xp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e5cdec72f0d063f00f90b375547b5858f0718374","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-e5cdec-lbnkrlw5_1671017671629_0.2957426888120631","host":"s3://npm-registry-packages"}},"4.2.0-feature-866055-lbnnd0db":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-866055-lbnnd0db","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-866055-lbnnd0db","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"984fee3252e5edb49d096500d75709a85647ba0e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-866055-lbnnd0db.tgz","fileCount":159,"integrity":"sha512-Ez2gAeEFbYbcjknag7D/YLucIIPUwIf0SwmdI2Bs43Fwe+yNBGJeO3zeteiwpDJ1Gko0zeVTa+Vciq/bJABXpA==","signatures":[{"sig":"MEUCIQC2wScBFeFWjYzh9aNZ0mnkxDoW8hqifboBr2sM3n857wIgZ1txy5SJtKAbNZ7oJ24vY1EQWyTSrBHfDUKM6d+tpvw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmcXPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVCQ/7BnQLBxfx5ZiqURcncTQQJEVtnud2fyL/cfTufs8217SoN+Pq\r\n6hWcfP/dpFgg0bpwqoBKaHYyPdHzWkh76yid+sj3U2i537c9NKeXpdpIRX5W\r\n0jG5XARQuvAUBmuFqwUSTIwui3PTP/OpCGpElTM2h52V3ETFHYitDFf07ZS5\r\n4jpqjWN/ZLX35ZN6JPHVwgZuYvFG4egfvEOjNUtvlCdV56YKPq8dkG4Fe9/o\r\nKhfTb0EgqJQ32JB5UzA/vgMS88bJP5ATNOAooCTwd4E0gRs3KBlSN4u01Qqa\r\ngl7OH2UlGIgIv0kA4ZbeMjrLe6TK0rTIM54vE7V8seakK0TMHLQBMGYAdG6i\r\niuFpl7t5xKkucAPZTmMAPDXi5jDk6cKG75NrYGyEKE5ixANhvPXBzpABxgxv\r\nJ6p5CpVTjeisU0k8+6rFSQsrQ5Wxy5nTQgdYwFkVpX19hkV4ChAREea0b4Sy\r\nhew1p9NTCg57BzUVojWY79nZgZafma6Z4WzYppE9ULmzujZOtC5hZwgUuAHl\r\nU8rf9A6vfN5J/gO3xRlOPv0TqFCVSUwSPW7SK/ewHrvRgJyaUdIkGLVKk1J5\r\ncSv2EZtcUd5ahPYmqFLQtt5lTfnrWYeIOuC78lT+PktSRZdHGT1sqw3WX8GF\r\nStnhxC1C1MmPPjWAXkxRZMfo3Ne41qjRUSc=\r\n=mT3J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8660558399665660d5bd1e2f0383d85639b707bb","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-866055-lbnnd0db_1671022030879_0.18700660116846257","host":"s3://npm-registry-packages"}},"4.2.0-feature-73acce-lbnoqb14":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-73acce-lbnoqb14","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-73acce-lbnoqb14","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ac7219c72599cb57a5674f45cad29a029838edf1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-73acce-lbnoqb14.tgz","fileCount":159,"integrity":"sha512-N5q1tNm8pVdIno95kxr68v8EdeFmrb/4lZmovoZAj77/7kOYsz5g4su8ccfnAwGz82ncVYXJYMQxB2YcPdYbJA==","signatures":[{"sig":"MEUCIQDtapZlAp7BGDQzTjb1ONRceHGQ/16TcvFT+TMDSkLbSgIgEC45yeXUKPTBPgzmN7eFpQRTjGcrLB4OZFo0xO0p8OU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmc7JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcmRAAmqoq4+YFr6Eqh9tQjSzLoEo5T265w3bbpB12RekN3/GGBQCU\r\nPf0yQDVB6GsXOACdxCBZyLbHX89q2VUZKidGEuXvwpZMAYrw9gGwiPcZFM7L\r\nQyQ7hLG0k9jzx2/v2ZKrMBoaA4a+JbWuWkkGDxWX8PVfbv11PVLmHqz7kt61\r\n4qK8PzU/8tdG8UnHJk7YlNOQ14KVzwdMCAtv09yQgM4avLb7nqJKD1i6LyBA\r\nHoqbpIJoKURbmaRY6QBuxDYjvql7/tdcNKfKKvhnNZ1pvA1dMIPIdFf6bagJ\r\nkRKrt1sp8INKvKG58vqUDz3PeQxzKGZGUbQEX+kTQrNdycncY2S6L9BQwepZ\r\nDeW8GkU0qtCT/vHxbqgWvp2pL76zVmcjrw9/+qPs10n7XSKgcV0u/99K0Qd0\r\nHKcsKdD6MKPwnF/HNN+wtQljlCxd1mAFPp801APBOvlIng8VLcnduiPzQO9s\r\nhutQYsqiRdkGMbCsKPjs+Oy439WV3KXgd6L62HMi24oD4WQLta7uLT09XVVR\r\nglQNcPA/kVVMn58tZ9p8mn9p69QKvRAohPtxfR7yOBd/P7/5ENBpPak2xlLA\r\n6ZoHECjW5Hp/bFwzRKw5nsLrI4xZ030yTylk6ICkevrCrQJTMkxtG7H2hsnX\r\nF5FjDhYqboJJ31X5jKfhf7YOuWtiUVNQqzY=\r\n=fdaC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"73accee3823689ce95cdd3c0c94fbf0e3172e58e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-73acce-lbnoqb14_1671024329517_0.1351174410370617","host":"s3://npm-registry-packages"}},"4.2.0-feature-43deaf-lbnoqu3l":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-43deaf-lbnoqu3l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-43deaf-lbnoqu3l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"484ac8c92ece4b2b947382a861a33a8894566f79","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-43deaf-lbnoqu3l.tgz","fileCount":159,"integrity":"sha512-wd4x5Nogppvq4gTGf3e5pgu+jq8Vuyyic7a9tHAU/moapl6AfNZkHRDWzlWByvGa6Hc5rIhHgGeaI5DEBpy0eA==","signatures":[{"sig":"MEQCIDE6CmTuyQjqiT52amoRf6lIvCMJdSjZHWCDephPTrHPAiAwxl8XazCR1FfnWdSUV395eLH5WoHk2OET6o51sG2caQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmc7iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+Zg//Vj29WPyyS56ERWGuivyMKzMuxBe6XndjsWGCZXi19rXR6VT3\r\nTKVJuM6Cdgm+Ln8pz5sFovt0QhIkDlEnDJhA9Kce0ZdNZMuEk9iPA5dr7aUj\r\nmz8PcC1b46AEEONp7FlwReeHD8TKP6Lh3+3yPYadEpoPJ+D5WLo5FyPQ3Dfb\r\nr9Pgy1+wJofztdR6U5b88XSOfhKs3TCu9m2ChFwPGoboC7S45J+7MkyhPaU5\r\ndPTrorMUSm8GJUp2DOX5+2Ic64YgtRRtYwyAl+eYFWVHCxIGgQ4shpzu5St5\r\nmSL5KGGG1UkAxMUxx5s4L0JI0S2kN80AoUwE59AwkEdLRp31CLSYd3DCYvjG\r\nhBHjSucGHMQcA/VpqZObgv5eheAy63wmVTFWfGHYj/Ud7IcKwcyTbjYJEmTB\r\nWYivF3c6IjK3bLYTzgN4lcGppB/qZV2Fr7kuO9DxhFouDXjH9QozIbrDlZxE\r\nn2KHllvnWP/zSkiYDNG/vKQFak7kg+1nkJc9P20mQtqmdIiSMgXtG72lzx8m\r\nLrTwW78ymsfeYbbqb2Y6xLG79we/kiuAqhdKGMYa/UetuPepxUAx5I6ovHAe\r\n3kxgUd5GHV1tqhqaepc/ydj+yUvX8Hkm/leg5X03pv3yctUmcPG+GLpGXH2p\r\nQaWaf0FigIqQvjVbMPWbxsPb/qzAxH8zVKU=\r\n=BoM7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"43deaf7894d487c0d68e820d2d5f104b1c9442e2","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-43deaf-lbnoqu3l_1671024354411_0.3016965985433171","host":"s3://npm-registry-packages"}},"4.2.0-feature-a708bd-lbnpojqg":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-a708bd-lbnpojqg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-a708bd-lbnpojqg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"09719942da82b94a4416d7775416efff5a4d4dae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-a708bd-lbnpojqg.tgz","fileCount":159,"integrity":"sha512-kb89y7r/sByghFO6sVF5ZFXaTodiALfT0g1d2Pos80mSVd5I0EiresHD+cdYc2LWpNpfKcOKRD/FBTY09djmUw==","signatures":[{"sig":"MEYCIQDyln4W8703FOiimEKbY9YloqDGR14U1RtirBAzZeaSZwIhAOISn7MWSblstgAXbTV0kDrJJK3euWE+6OzOAF7MyI6W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmdUIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdFA/8D5UVHrbDBhnsgIV1BDaFgDSWdNMxuY+6fPDo+jRFl0iHS6pd\r\nfLlpM1BQcwRRVFkKsCdRwtp0NbO1KbNs7XI6YS5mK0RelzPXFY3WAYTXrFm+\r\n7YS4Nw/xENeOlT+flkupbaJ0bs3Cn2b1nayg3/+FfI+ZphENUnJrI3cq2BKu\r\nPdNMg1lCRObEWDO/2KNWjgjdAew+Px3ecMEJuKlZH7lNjFk4IWAzNAxLzSSZ\r\n8WPEpRC8hzizQHEFk/Igq6Z8vR5fTo+N2pDixZpHOwn9OAIBZazKclIc2RX0\r\nCQTnUZGIxtkJCW7I4eZpHLvXKkzNfGir+5op1htoEQq8l24w9yuThBhGvS9K\r\nvMoQGWYEL47COZP3vOG8uiYifQDxnlGmqUv59G3/yEXfn5QWXPM5IAMvFXKj\r\npT7jrvQ6+LOThbcDqPM5klDzCY5E7jqZxYT0PHMk+t8u8Z2sbyJOn37AG/zG\r\nYV8AvJBfaXzaZdiblhkRvBpcBeQoaQsApQHz/izRdG2d3J9qvCp1EAsxGH16\r\nnlvD5bkXBjZxcmOhKygbxGlCcYyHguusl66jv0AGWfiMFdz3Dj31gXDzjkp+\r\n2rUiEdUAx+1ZWJsPKh3tu3znsVjRIai60jtvs8gLXN5WLFSjwf/b9aFTbpaC\r\npXt/X0RnSQ1jH5nsVtlaQ0NjbkuragXwnuM=\r\n=BzMZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a708bd3693a567b1beb60dd1ba7ca8c324210419","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~add_query_cronjobs"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-a708bd-lbnpojqg_1671025927872_0.5261288224836926","host":"s3://npm-registry-packages"}},"4.2.0-feature-4741ee-lbnux61n":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-feature-4741ee-lbnux61n","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-feature-4741ee-lbnux61n","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a48b50a4d9ba3ea40a5465f7ab3739d5af5241d5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-feature-4741ee-lbnux61n.tgz","fileCount":159,"integrity":"sha512-E4rVIi3i96Gj6lX1/FD6y95a3iszz4br7Spt5qbbszRCxbyfjVE3T+f52zcd/Is0DSao9f7bB6eB/AtdQzuVag==","signatures":[{"sig":"MEUCIFoAyidMMdbOi29IUOzpvpSwac30gQraaSfS9kf1xL6SAiEAyyt4Jv3j9tFgRLBnU8kU8CRWJdXeg07ygju1hIpufYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmfdoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpe8Q//WIv9pWK3owmeBLRemJ5Av95g880DEAiEqoYUR3Oq9++HRbo1\r\nVdCsqoAGgWO1rvOnZwL4xAPE9CBevlJEEIZjHJyaMBo9YJ6w0xJgpacJTaUg\r\nOiqnXp/rRsbEKZm/1N3PzzamEREk37/MlBza9yQL3w8v1YOQHAOiL5UTsa0K\r\nhIlcc+TyCLUN8aajYpprQ5KV3GisxyuRqvwDajMlXbJJu2k2XFP2nDlW6guI\r\nRJ/b7CXlcWZIkdjAcZv7coTL6LgMtOEKBzVgEz7lp94IS+72JCJew7n0zBte\r\nT9RFMIM+WXTdQsfuqxlByZZ3CUVIbddRDDRpXWiyNJ9MpsPrCOSYYB47lXM2\r\nBfWg4y++kEC1ikUE3Zk0Ii0w6U31nFjWrJ1bdLio0hzbZbhltPLcfViXvmIv\r\nq1mq0+Yt5ds6tifndBBPzQUrKqod6Fo4uaNLJxz8HtQz7IaM9hiPRQNAouAH\r\nBNIC+NM5UGs1hYx8qpQvJHdhwGvJb//ro2EAFqSf3b+TbyJovA9q3ppzhyeI\r\nouG/th+YDyiuRBMI3tYgRS/TSKCw4YAQiiir9C/fBHwDy439puprXbyxMzYC\r\nLMzJV70Udf/+n99g09SuinVreroQYtbMLS3uYeiSfK5SShWVjQmYAelH1dAG\r\n/7LIePYhah7uxGNK44IEh8eEp0ghWnhMdZk=\r\n=qCoP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4741ee7b127d55f59fc6446d299eedefc08ae0cb","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-feature-4741ee-lbnux61n_1671034727858_0.823537231368028","host":"s3://npm-registry-packages"}},"4.2.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"da980d84200e07625298443e70b703eecf54423a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.7.tgz","fileCount":159,"integrity":"sha512-+T4xCXq1XCJ8sfme3DxUD1EtFaXGNNeBsxTFp+xwllNsNnAkJwbxIsKlfUkDAz7ifw5hM7vfCfqZhEESDsMmWA==","signatures":[{"sig":"MEUCIHsdofY1DwtTZSM9jUwqIJAwkr4P1sa0Qb7XTnyrLX52AiEA4QkjdLseeV6grrkSgZ0zlczNqi3syTexe4wRj6gKOlY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmfjXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2eQ/7BZaIHH08j0mGoonBV9y6kyBEBOhJyhu2EDQFGDYP9e+5Li7g\r\nvGDEE1IgbQUV+ZY/1HGTQwTKcNk2z3f/pg8sLjmxjgchIOFfw/NCCfpp6yyr\r\nZRMXFUoNXO8HK3BArblBUBejR4K2LcguG07SMVZyF3TgjKDuv+s8CKa8tEp4\r\nC7Sc3/W2Ywq//VWsFXMcQTN3Y5M6ZP7BmKya2LgZTuxEQR3Vsv/+ZkBEZNDB\r\nKZpGXziaSs1BVxR1wPmQrmeMp5qoLwhL7A4vpZX9Y5kA2BmITqGrR/91uYj7\r\n18LiX40CAWd6fJdothgui/gG6yunSRQQGfevot1ulPL4T8XxFI+RUY3CeKs5\r\n0X5fmioMQwoLPgbGuMkJ7QCZSAKDNujEvdxaXanUHuy0WbpGfzlvQLJHm2Ye\r\n9D3+mAXr5PVBjkDkgh9ETTuJasi8OHq3EIJYxrXIj/WrTxWMaoZE3tlOe4o3\r\nfuD4IOkh4nZ3gWN1gBFfRyW19J9cPnd4QiKEVZVnq9DBhTcBS/8QIZ9lgXrC\r\nmFfEyCfdikcv0R8wIoh+ruYeYp54ONa4R6m0Llh8IZiMD1Hj+7nf/cs1+0DT\r\nMYFIujqlvggX56Al+8XBehBD4JE7MbEio4iolzzfBZYQ60i2EgSI19fF6aQf\r\naSrUiycA5jSGoJelDMq/1Gy57l+PMyytbHM=\r\n=QBAj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4d8beb2af93d0c1599cc6c6256ae24d16cd78cf2","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.7_1671035095524_0.9945698500785183","host":"s3://npm-registry-packages"}},"4.2.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"95671fee933980b74fd49b9592810beb6c125e66","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-beta.3.tgz","fileCount":159,"integrity":"sha512-8SmqCKEYNTM5oHzl1b7Eo9wLHD+G8YP9V+42qiYk0ykGtUquBn9j/LERr5wUO5B32WPzSSC4GAeyYHlSbFeGfQ==","signatures":[{"sig":"MEYCIQD35Lpt7xsaM+K5+ntxM/AZhEAD+aVQhEhIvVIxbB/7dwIhANLr6yG7TxjsJ2MaAyxBtm43yQUN2/O9SQAEDHzpZARO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmfl0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmos7A/+OL3dATd1aXcZHnxXuXk4nzQd/NHz5/qu0uF1qRtgRco1zmJk\r\nuNAp3TccGRIdkbEPM5TfMBDXxWz6OY+m0LSY/P6JoqWHh4GmXQot+uq/MQrf\r\n0CLLbuLRyE6QUds1JeqizXT+ugBcbqZ66vkW3ZYjyEJEEZSIJbjEZFOfK8QW\r\nfIccUNgkzQ5QjbMfOz3SLDm22xdvccbAAlx1aAGJdj8GPDtwS3GpzIbMzLAg\r\nhWu2J+ajR+0tPJXun8FJ1sx6ufOaWtdeHBQ/5IACufjPK7UyAZzY/2fyi9iq\r\nhNsmnV0HQhJroljWMFIqiWp5fLqziJ3J5JQowYR9b3ee0SrAan6DSXLX1rCY\r\nCmLkE+sUwUnxzz6tO/LMJytS5YnyYT38gF019yOOT0BGgXF8p5cVrHKFjnqz\r\ngYrJW16s0Zvdih2J20TdcugLpGd3Opmidb+ar8PTnI1rho7y8wF1oKyzJGRW\r\nDGgi+sOhKfGQZTKNV04v/CXmnX8jf2E5yXJYvT3cjwafxs+fFwZzNRq9wBWh\r\npkquowTB5KyxYLjI3EOpt7F1HLveIoXjCXRCzGE6VPqjVfKlnSStNoWmYsSF\r\n8jl3GNXI6RSZGbe4yRFiPEwoMCut5kX8e2CoPq0zK48zhefyMO7kdatUPCVI\r\nOtpsAZn6apuEDd/S35uHJJXOj4bTbBZPRYg=\r\n=efnD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"71f1aafed86d368ac0aeb350a4f11f1909e783e1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-beta.3_1671035252543_0.6881793809880881","host":"s3://npm-registry-packages"}},"4.2.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"76ddf0b151e3dd2172e13b38453ccc9bcccec44e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-beta.4.tgz","fileCount":159,"integrity":"sha512-Wfbvw8vkcmSJL9LP2Jv+8JTNHaZGN00sH9XckVbSher2dtO7v5Xq/oHOqGF+h61UywMdDG+fiT2cB9JkrBs7xw==","signatures":[{"sig":"MEYCIQC8fdZNIyZ57cwi2EvS99+HPaOA2cuX6kyFgqmXxGqBHwIhAN3TRahMe2SKNdS9SRuf3ZDDI1DEzYgvsTFYkltWFoHV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmx4dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpA1xAAkEgaTYMeo0Bu2DGbbzPDG99eloUgW4bjVPNjfBFzeFnzSKKx\r\nmXMmEqVraHWuH8eYZI0VU+/H9x2LMcsU9R+Unyuc1GMOxoo2fTKl9xoYkq5Y\r\n8TEbGomWR1SkZ9WaxB5q3vChaMbleWe3VjxoUDKo4a+S7VnWcGspsgubBv/y\r\nBdX0SNoAvSXoGZSdHBvTGgMFSfTgTutx3jQMXm6da5rQCTwffu0vwTvpy8xD\r\no3pYCSuc3Ey7HZXIj74aZjnyy4Vg/zH/HONJiKo2UTNYVF5C8iv2QY0aKv6o\r\n7+EPzczF0fZVKy1WBhTKut0dC6E1RWmLiYIxpyB5dciqGw7zNrYWwP7rLyqz\r\nAIRz2WhMiw7TOmCGGW8xyIiayzr1rHYtulP4vxodHw8JOXiXzye9+aqscVGp\r\nAL/7KPu93t3aersf+IXHgePWaw7zCY8J9n2SXMmXwVFfHS/rRFXTG6giWr7j\r\nLV0nZLzIg42VPAy7gCjAE19dcEUO0D4C4yXkyAhhbqgTlRGGoPp2XwKE1OWw\r\nBwsNyYBJ/xlruXRaMHN+zBKgJnC1yEeIRpFflg1fVWArIkxi1TNcj/ZjElgr\r\nq51D0VDQL2puglR7CHk9qc6782PVrXXvT2/eaDP/VZ8foaZU3L5B+7NO+gBS\r\nmKjegaZ2KqtITUMfYTbUDwR1cnXEwmVgohE=\r\n=AkTI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"af5e19c31622f35f7f482abf539c2a4dc6823cdf","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-beta.4_1671110173336_0.633861076693617","host":"s3://npm-registry-packages"}},"4.2.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"147c39a5dfaddaae6c71761280b36fab155e5617","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.8.tgz","fileCount":159,"integrity":"sha512-AM086Q9ibHq0XT9F6rdR+HSKlfcVy3/rz4aiYgVFGYkkFsvIUrgs8/eu21/wjjrDnwP3li3QRkgzLRe/rMFhYg==","signatures":[{"sig":"MEUCIFzMBji+FhYQL27UBzmBK32DM/CRNUdvAKWSbRG2D8iQAiEAlu8l89uKUkaOfGsyAFcvx23aD+riU7815uGCJThTGt4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmx6yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVdA/9HmIPFiLxeYWNneL5yWB1s2MrI2STtgiPGhnBnxxR1p0Ok4pP\r\n2CCqAzuPypfejc5xnVXxVA5dW/8jTLYkIykoNY+WQr9S3kGyOS1aDqmxugVU\r\nJqjRrIzYo/InZFihvNAVCpfroY2d3m91T3I3Lqy2LylbAgXBn2ceCyIpQDFy\r\n4kvTznTBEjCTbBXSGGY6wEP5RRUNrdL9DrwxImRbcIdGsj96Hq9RUbE/UQMM\r\nYk3GnvdAjE0hxXsf+OiOwDvfHI9K9H+iAMi++2NxD9m5KskI57m1vzhwRDI5\r\n6RCdBjPG82Wf/uS2lCW7cHIPLIhgxCI7QeiflwfZxi0/AF9SQklX6BleN8Yh\r\niGvCteW3rkcIPvdacSPGmFImacZhQoIe/fgiW55V8MaWynDrKkOu90TROVhW\r\n/FrlEHZIdOGV6b6iJ6al28BN/wVbjUWHMGcjbLdInzgKhB6QfA/K/Cx6CYJ6\r\nHS8bUQOkUtGURrA3X2i5ZcklyH3spVKmvpi686cj5qQsWDUbcBtX1+VVd6JX\r\nilW20oi1pASqwgKVR2SwgYbLiip9YL6biPM2EgwBS8pK45C4NyhayAkvUVlj\r\n4Ii2DXy6xMjjXqPGqmtyLIOJWhdvVzDVl7SKNtNlSEMP5fItykDmnpgWT6VO\r\nvF4TQ2EmKXLBfHA8+TK7Dzz0QQmyQ+nmgl8=\r\n=tX1E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c74d0d9f20c5be9b6923c83514007433f4ad7eca","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.8_1671110322236_0.10356607199319834","host":"s3://npm-registry-packages"}},"4.2.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d6a62dfe44800a3ce704382c2da43c28640f7edf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.9.tgz","fileCount":159,"integrity":"sha512-Dd/hhtZW6SloC5u3LvHVZnFTZA4ULky6sHYXR6Kh80ILMhrBZOqq8BImKCCjBeqAJbcuIYxzT9dud2PG/MWMkA==","signatures":[{"sig":"MEUCIQDhaXFdJA2p6hL0OHGB/dUkFE9k1BfMLx8Hj9twmvEYogIgBTboZuXdZfUuwCd5tBA55ylLvqMUPYtQwNre/WSCFWs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvUX+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdQA//R0wNbtrUHdXbZa4rrRxbyxXVZEBBxa7zQjqmWYb6a8cXzNLc\r\nQ7yI0fYCeo+Mgtx15KKIkWm51MEb7uNgDT6YZbX1uOIBsH+w74+rjSpOYl18\r\nwsj/xyUcIuwNrMB5sePfKSWbP1cRy7nEgcjxzK6a5sm/3jcF7aEKzc4aHvoH\r\nJoppFhCb0JYN2jhHCJF/kGAfK5O+fhc+qkEERp61FaGNCnGPqNaJff67Ljk3\r\nZpQC0hRuEoR47pfeZMaMca9u3pmYy+2l7AaDbB2F6RPrZwpSoUDGPA6+Hv/C\r\nc7IWtGSjOUTM39bavTNWymNQrdqp5t7x5Bv1uVr0JxrPNQNX/FShCTk7elkG\r\nBZhggDDX7IcWTU3J9Lse3EiGoZqFARDs6j9DftI+p8QTe+rJ5u09NfgwTbgA\r\n44g3VTY/5kHV9fYcMrXJ/2COEt9KxU2i+AtNwm1UgxyU2DTcngu7EJaqmmet\r\nuHAIsemneNg5NCdfzQURhQqOZVs9BH8b2mDi/QaD4oe0bMB4fDHxm/5iDkYY\r\nYPoucIWC1Tat0djwoths1C2RoCsuFmGFU44Yll+R1X/SSgAsOUrPhlR3EQL2\r\nUebbxrKe86Njxf+c4vSzWbSVsZnHG9YYctFTuB3zvRaLPPn0t6PrLuKa+7wO\r\ntxyOSJwYQ910WnmTZ+AK1tf+W2VYb75uBVI=\r\n=dP6r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"0003d7aff325e96793733ee4938f2b62e7013ec9","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.9_1673348605791_0.81023079813145","host":"s3://npm-registry-packages"}},"4.2.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-alpha.10","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74e408442ecec4c28b8a215549ed522e9ade6e3e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-alpha.10.tgz","fileCount":159,"integrity":"sha512-wNuuvUPt0Kt7tGFpE8nwHBk5G5yNW5NFJvrvTymH5ztOzrhweAqNM8wWFic64lnG3YMaiU6nTyO9rz12o746ag==","signatures":[{"sig":"MEQCIDlbWV9FPEVSAGfdRKv5wCD+Qk7j2d8CQtMzQL7nSSSZAiBYD4bY2u1QVV/SNRpN6NZpBRzOA4JhT3AbIBoOqEB/Lg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":506481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvUgbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrS4w//T+GEzz0OV4ISYpFr48IB3EJz10l4Tr+efrGCs8X3YzZgHVfx\r\n2+Mjk+HYDW2PZQO8ePidNummPNi851HAvOWTNq91r+8dlZdUL6TuRfAJ22y2\r\nHPNyietyCI/kg9uHBhYboe4hsZ8b2cGJoqMFSe0SvqzEcbws+ZAM9GusBqCs\r\n2flmdmJ9p0fOCLhF6qKW3xK+4qv+Cpe4ECcj1R5JJoEFJuYotDW1r4SBbygb\r\nZ5XKgQ5pfVVGkDB0fbv/a7EkFS+Jcg3smEpTaGIbnobNt8ekd3hiN70pWoV/\r\nWaJhbhpzYsF72I8ZqwmyL4Qj2UQEDkJq7BHWZdWs+Bw58ftxc9sgNfkJanRU\r\nj0/vRpOV7oM+6oKg7Pb2xrt72DqzToWBsghRnJ/sudhICCbYptfeI1g/bvOB\r\nv4NUTF0BcM1vbBqMLygonoTSAGjhaI5eFQwqIcDzMaJffTGHvB5yOjTpTbRS\r\nX2W6VDUrCyh/lsaNZXTKTTVCy27JlL6yiwklIEDp87PxwVCaKb6YKlrQbksD\r\nNzGSBBjLwlBOZrlfAsiwUaxGj8OklTGhjaXfKjX06DqUs4HUgNLHNmh+OxAb\r\nEmrlsKb4APOTUyNj7h4DubOIgDRStZ3+RvREyKnJTwO4r0Kkd6XBcRqra+1c\r\nrN/HKdHNiLW5GBeZMy1+qmgNtq4DbQeo7mE=\r\n=BPKJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8456d3e65a013a21db03a5416a90b3b14b0f4481","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-alpha.10_1673349147320_0.40995288019150933","host":"s3://npm-registry-packages"}},"4.2.0-beta.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0-beta.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0-beta.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d3164c7baaa38ccadbdad7130c7ad6a3059e5d2a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0-beta.5.tgz","fileCount":159,"integrity":"sha512-aNxb/SQUO7qhKKK82Eio5c15GbXxj9EQ+kGA9dLMsRlGVlta0844XTq2h3t992pnFI6OUMy4E5s4fWBzatqWoQ==","signatures":[{"sig":"MEUCIQDt8aLN/YIEZ9ncPWxv0XAlpPWctyzsziVMPyNsc5lbVAIgCPsNQXqOYr5RWIzc+v3+7bxVDwn3Fen7JbePtBlEx5E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":506479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvWi3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjGRAAgFBk/WjxibNwbtYiCQZj4KG96cdaUauhPzGMjx3l4Bp/+Ce0\r\nwh3U5+fxDX2S0RymfmrxqRrew4GSpo4SQYAIworovmq69qB+45BVA/MxmxMz\r\nQ9qsDGzorx+HBxiDco/pz+CLN7bjW3LeQS+0kOBRDVzaJ8uE4CEHPVBU1LOr\r\nh6NhILKYPGBpadTqYloTtdtaQI8wCiV3v+fy34Wfw87/tk5QUa10BWmqLXGy\r\ns2HyK0mE4YWOHAkZmyfUyrEUYy8CBnuqUEe1BdG6muRYqsJro+mqHv38x2Cy\r\neRi+AGpfI0MiK+mMW+9M+xREzwrsId2zMdGlcHJJLCsFwgACbMUSuqgzF++e\r\n6TBNwqqv7rmUM4JkWOe0qaYwPh1ACNYX6MWENR04I486ATiAOJklKp12BqmK\r\no/jX1o42Fui3zAu+m0q/kRpG5IQvbqgowOdRs4Sf0E6+EIp/jm/skwLK5M4G\r\n8JcvvWCOjt/VqZTClbt4d+Jc5HIXmho+8+qlSGMRVGa37zJhZb5SpByeeC7G\r\n3ZcRX8+2lMZotYLRMQGbqOTcRhyMTgm7tqQyX3052sEJknO+J6kxOml5KiZx\r\n1bB3JSI8ZuR2fJLzM84iu+m7ognhHudoGb+0KRC3STgAE7cULdTkby/WpdB7\r\n4sMc0hd3J0BoioL+zLreZ5qR3D+38NnZ1OY=\r\n=VYti\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"9a33f0ac31ad7924f6544c5551794ccb47be26de","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0-beta.5_1673357494920_0.8323532936471294","host":"s3://npm-registry-packages"}},"4.2.0":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4a71bfd3909120895c367c7c4287cbaa142c213a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.0.tgz","fileCount":159,"integrity":"sha512-+lMo6/CchwGOVwgBAZNZjoV0V98faWdm3DaYFty/lkYddXFDdtE1gtHsupnaK8BwM0UI27puKi6vttVbhldk2Q==","signatures":[{"sig":"MEQCIGSfYpQnt4dDNzScNXoGHJZx894BkW3a+kPjVr/fPC0ZAiBT3MKMLY5KbUauljFRy6WfTKoxxaYvnYp6cc7H16yTeA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":506465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvWtYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkiQ//b9YpQjjfx8avo/OEuAVcSNIK11eAelzDBBMY92feGl40vkCd\r\n+6lEUzTW8yZ0JNCCaWxJmPI1udXsLHCiYLDsO8T6/YVh4VQ6MMUMsRqU7vY4\r\nBc1QPa9B2Hfu76ZwsFfPwiLJ6NcgC47A8MIDm7AFJQ/ae2ldI6s65ZaTtEMA\r\nvvSD5XqwPFP/fi0dp5lhTbOtOZN8M1GZ3lpNtCcvGVPb38+0IOA/Kqa5Vfnk\r\na21gMn98tH5wGTK2kGdHm9kfzAPt22vQ2MnnDZl5pDnJAmEK7hWhliVT102T\r\nv57162uNTYsjgvEj633mJzttxaKUu7Y9dAEw9dDHX7ZEKAtucdKU94OAgmBB\r\ndPiE9iAxYPNg5d7FKkRrt6NocUiaxEKd5Xnjb3pMw0aZb+vJggV29RkzEQUK\r\nNoZXAnIWQ2kFRRHKY7fetCysFN2ACvkOvmGIb4T9zMkny9noOtI4tLWp2klc\r\n+YSJ3fM2zanEdZqChVKD1PAssBsveVawogON5PaLC/EMkV03rrG0ohTbPQcJ\r\nz3a9INNss5S8BHE4TzsF4pjwGoddhOhgVfzIjwegHsLm8Sa8HUNN0ioGXwRe\r\nrvThuwh2Z4I9XYWLnt/+cQ0yIJLWEZPCMfjoB185dPPfvHLk/UOKm3ZbYdj0\r\ntkLQToaXWUi0KafVsUOYqc2KB9hX/h1dkVs=\r\n=yJbp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"9710eb17f1aa01db0bb869d6c9f7dc5e526a6ab8","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.0_1673358168492_0.2099766137162764","host":"s3://npm-registry-packages"}},"4.3.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"bd76abadc7ebe4be0b5391b3e9c54aaa330c447c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.1.tgz","fileCount":159,"integrity":"sha512-WTiLcg515rsFc6fWPNHAW32XyfAhPjVpX+RH/F796Bm1BsppUWnMMh8B1MInQWU/IqzJq6fctCK5NXJDJBlcTA==","signatures":[{"sig":"MEQCIBX3I/ZXz6Dsd0oJe6WPCkFHcsmJmhHzsIGOCLPyR+W3AiA3clJsee1YgS41qw+kvmR3nIXrxlk8bVzwNPqitGlAoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":506473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvWvSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhRhAAgudDH6XW48DOAvbFoR29aLV4CyXJ9g4Z+/UUEE6vhteEa8e8\r\n3ItC7rV4eXDJowmaJ7YD7Q7UVvE8AQ5MfEAnF9ZXAZO8IU+GjYtg+F/b+7Vl\r\nsTJd47TktoE2/W7YS+h7Z3JbW82nwVigkSSP6KzSwFqYfrf7jM9woscJMMpC\r\n1mjgmRRexVVnYkk4xO0r//y6gqSHJw836M2kqGq4gtq9kKay0vLkG2fGej+h\r\n6FYX7Ih4alUnWLcaGBNnxf9vjJID85Kd8dg68QgDOVnO4GN3roCqNfVFCqau\r\nAdrDfvlRsxv1ipXeS4sz97q3gvxxg+LRoqIogPeAPby3lvZ1SpwNFGC1byTL\r\nEx/6VSxE11oyAzPS+hu+YfaPSojyWKvIa6yAlBh4B1/G2O33x2J7I2G0G9ha\r\nAo+DU8rK5bwYdhLphy6rT2eveB9NWOSlVlKZEiU/QTDvl5AaLG0ZOLtd3L1N\r\nuOGIfhfrheLVIeYXmHC/0/nLkakSRorHbR0Q8lkL9UhhZTPL0XvhHSDRZsUd\r\nzwwtzdWjNe5mxaVK5nV8HtZGEwqI+a5xt3Y5HSULR4EW+SA0awmES/J/wFzg\r\nswnFrPDDf0gIUlHZqg6T79C+pOfmtS9Nzuy4uXH8xjMoD+9o9mnSmVE6D3B2\r\n455qn+dSjrKyZY1T2YEHgYrj41OUPW+Nrp8=\r\n=LiGs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4ce3864fac3ba59b8801653ddd173067c31ac76f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.1_1673358290629_0.41859569139850716","host":"s3://npm-registry-packages"}},"4.2.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"edcf98ddc93286a9028387c66ea3fde3bc532e47","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.1.tgz","fileCount":159,"integrity":"sha512-HIlPR+rFk2lbIMnKKukerkD279pQb+hgXG+bGOi9AVGlv5OxTyeoZdKy1sr2ppQNpjy4VVqz/3kvgFtyxaONdQ==","signatures":[{"sig":"MEUCIDOsRZ9KjKPIhBs7WFoEgs+jULuh2HSv2DZLGzgfiF+TAiEA0XpHGDfAbhnEiQH0oJeiO2P+QKx0fLhPqZp2yK+2huo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":506465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvXV2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPCBAAoIJW2gXzT5tONAR1JFiEWGiaVbDW87g6qZtAMwApraBlYIbI\r\nsSNmZWFl2gGw8auoHyS31mgRb68N44hi1h+itMRzLUED/80reJXJ1Q8JpLI5\r\nHXoQ2sEPMiT+oI5kt6ReoQYmuzTiYQt5Dh5rUrKbAueJXXrv5y5njrrEsw6u\r\n4tK76caAPpzPpD6V+QvQTERcGpSgz03BdNBpxNM8Bxo7/7aKSyN/6Hy2oME/\r\nWDfrvJXHVOtLxnCv/iawdAJHtyOf3lkZj9HyPqfiio8LOpE7AIVojzGMdBJ+\r\n2DM/S2TfFDo0OJzHvAkwak2xmUssXvyzsejE+/c7t9OQnlJukfE3dEW4vh4R\r\nALUM5K74NW5LoJhlYZAL2n5q5UEOleCb7T7aMri6fOTAP+2HaNukGjbJ7PYB\r\nDwfYv/L6Uj9aya00dIfPOgAotLucMvh0swn23Gk4NZ6DIYxSlYX4CV84e0b4\r\nfcpKfX+OM4c9ZreMa0fFmeX8sKY5hjN3Bo7Itx40ZWCp4GjCsEpXOFvMuoBc\r\nPWT8/2n+YQC80cVEPXxx33/niFev7MYgNZXGaTiMxs0npi5Kt6qB4zXIw75I\r\nd/0mOyL8Kww4woarLKbATWe4FAaBAl76xv5EMQfjfCgEgjlaf+akAyexzPeg\r\nK652MTR/erZIkobstfRWAZslDBn4Rb4IcSo=\r\n=1Y2J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"7379393b7457e2e252836f21e6bc79cfed010507","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.1_1673360758502_0.6587661356218524","host":"s3://npm-registry-packages"}},"4.3.0-alpha.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a75346cf9fad02e16836a441e67651dd427e9783","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.2.tgz","fileCount":159,"integrity":"sha512-PXOFi+f1LO1vJikVH0ON5UfBbbTKdSPJ96M6NoGcUN065xHFGqgjyiv0fFLjLFy8R+xMcIyPOZ8IawBcsnBEAA==","signatures":[{"sig":"MEUCIDbH4+fSVaXx6rleG8YotRKH3SOhdC6RsfpLn0HLOP00AiEA0og/R4BIW6LtvJY237a+gqvcVByMsRyzlTdTj0k5JJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":506473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvXZIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopkhAAjw4mB5AcbMbB9UxM59fWf7/tiaeVk8Jivww4cifAszNi8lxj\r\nm/vWM+7faDJ/DNrtolkGLFTBJHWTIXRXD6kHRRz0fKRcwMiFYoZL/uT8DipK\r\nz2+5P+F6NJOL3Ym80LRW2Iczh8TzUVXXKPJ+4+n123XHulhvhZIxUUMifLaF\r\nn52bOwFQKfHfendObwgY0FceNId+fVkED90qkinMjVRmnydMk0L9tvXYZgJW\r\n7+LmCcBQkINu1ya3VAg+rk6V5fO5dxpzt568sad7I3gFBiJNSdwjN8dZeud5\r\n4abjE3I4+vHKeEQ0r07UndTwDUrj6RHtqJyAl+/3G8j6pkzhzdAN1Sy12VUA\r\nhLGAbnBPve8ivMSe86cWSKdiFbs03hoB2ETstysBfGbgCizXiTY5Rqa/1gIF\r\n4bhTnK/mnELEw76ejcQe6V+rsnPnzotLcZODl1QXHrMnx3keMCMMGoU/gAE6\r\nR/Z4WK5P3M3VBdUtmfDC5cdy23yY4T4aD6GP5eTXPAVtY3+rTU3EFWuTJxkK\r\npEdgl617K7LGNfYwDXge34oSMXebAlAqZKRAGaeQMALDsjq8BP7v6W6p0655\r\nGl5Ctsl+TxQuT12GOiwTRMD794EGqb1sVZI3Hio3dwy/Rc2hgJ2uMOtvM/la\r\n3JJvvifBVUjcrh9N4cPcdjhbmcOuOcQsLv0=\r\n=xThp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e23d2b6757c86c661554ca0fbb2367d33b740f31","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.2_1673360968516_0.20433757343007586","host":"s3://npm-registry-packages"}},"4.2.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"526984d0384b1fd3951a2c431857c464035bd83f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.2.tgz","fileCount":159,"integrity":"sha512-JrnbdWsePY4A55GM6BBZblFE8r/CzKnR14PSS/QRzcPC8mTgQxDeCrhA0MEULCsElgWP5YxPPe9EmfdRGMUxcA==","signatures":[{"sig":"MEQCICqUZc/PFDBBoC56ILy9WgzCxCq8ZWWFq+8GB2NM3Io6AiA2SJAJn4+9hL/NVyMUGQt038qtpn5d9RvPL3VywXJZdw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvY1yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/Ag/9HexYR3zMYLG0AQZAd3vz08lm++yL8Al+4m//kT2ct51Z4J08\r\nNwCxgdqE2c6BYUj6lNG6REP1UvJy6ClkXZ3lEvoelRm8nYpUNDHiq6pQnUUy\r\nJwV37NkDYhbZil0DKWiuCUlskMLB75+1JKoaBwi+53qmzUKm79deOtpKghv1\r\nBAH4T1xlvaI3f0SU3vHHCt1astyf/AZQRvWACiRQlUKTo23iMio0YLvO9mFx\r\n6aAhYAfDkw1A+U3MKDLMSpriMwNV7FiUdke/5kkPWqL0rbz9aFX3OH0tEoPE\r\n7LbraKLFyr0rtKbz8WklLCI8aYs2OM/zNz1xlbTtNsa9+KpxWy7g/FS/OHUx\r\ndsqBIsG6+s+gxDW6odg+m+JNMENecsURrJfg3JOucfgz6HKKEFuwkYGV2Ygf\r\nvAoqI+xDTaOl6hOCHSfeHURhfm807q1UdQxVuPw5s7B63/PkvPVp+ioDs72n\r\nTugw2hEhTOpa+r38y8eGEAXIzw4BNmL+UUyqH3DgCqoQsIxZtzb9oZ73ijSu\r\nCmpG+ijTYULUfzRr7Xhg5Se/+zCBsEqUesUp6VEmdXgK0PmhNRxxI/5TkoMk\r\nT1UNEsBKSFrTOTb9K2Q0Wu1Yndkj7LJHg7TCgXb3adYHUyswNNtnGI08uP3E\r\nGiLbcuL5cbOTCfiJsdFk5RvqeOKOleUW99g=\r\n=f7sT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"56794b68465fd829b37264c482393cde07a6afe0","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.2_1673366898504_0.7786701023437848","host":"s3://npm-registry-packages"}},"4.3.0-alpha.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"97d08ba2880d2d99d37efe574690e7f926c650d7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.3.tgz","fileCount":159,"integrity":"sha512-2Za40yFkkXzTwRGX66Oe6kzDNsJolEi+PoxmCCvHJs0F8YMQ8H9IKLWZ6UNHi18cNWxELdvrHvzWJjzJYIt8zQ==","signatures":[{"sig":"MEUCIQD+ODofbzdmtDeMwkj8+cEEDxFzPmT5qZaFdQqGvh1u6gIgbB3ywvg2ryPAK0gURnwy5izHq9SEQ+4qI3IoOjkzhfw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvY3VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzPg/7BqMsBzt7fosIE6/ssvt7Ma21JUkIW07P5vsthCvweNaKN/eK\r\n9u3kFr2pSa8BT4noWG4/IyoqroiLzEuKxjcM2hcNhHP5IUS8g5os7eBsoQxV\r\nPFhp5nRdn6JrrssRMoes5NX7utG5BQSH+WKKURXYhkmpmbCoYh7aDVw/aKSn\r\nYaUINsPk2opNaxPouftaZabXW7PbArnka+E1CKnCdei1pXPL1pqQO38T9tAH\r\nxRShpt73/wQhNHxInE6sNuejOyN4EvzAe5TEP7sLLRlvDqcxsF2lj3rXKLJt\r\nW5ow5rmQqjtYyoR+yyoZepmPfoEJPYXH96xiNce4bhmXH1Ct2xq5NsIN5zAa\r\nv5DrF2rdbH6e716VKMvfiPsWT4nJHR4Vj1ddXuDyJC99fip+y19+ksj/vHko\r\nza9zJqTGnCpndjlQnShj/kRMIbgXewxYmXvwys/gRf2lQhWhVz1vtvhtMjrj\r\nBB6r63PWRNOPYuIcvbQaioqpUjXLes8KkuJPiyVSaBzNahmYvsDfcAL+WK+f\r\nlMvXh+xtqP0gOOUoDZeKyjAtB9iG6LRRCq0LT9G5q7ZQVrsSif5kDcP8SjTM\r\nlc+dOcDHZ+yHORs28xz5FY8TwJDXi2OHVf2Qm5KNa0wKVMvR05v1vRQg4BuF\r\nYumc209bdLyhrfTijKDufJQYuAllpddCotA=\r\n=aYQG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8a695f7cfce23d557484b8e0513964e97a6ec440","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.3_1673366996850_0.5983324820713913","host":"s3://npm-registry-packages"}},"4.3.0-feature-971706-lcrmdsad":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-971706-lcrmdsad","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-971706-lcrmdsad","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"09ec12c69bd36cd391d7d1fcc11761351ed901dc","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-971706-lcrmdsad.tgz","fileCount":159,"integrity":"sha512-eeaD1ZFmivab5Ck4hvxqAIrJoxOXqIbZ+Slc3cMf2KRDVrfF3z7jZ5RBlO2REK8YCUECAFRoX/kFIBy4VqM4Eg==","signatures":[{"sig":"MEQCICI7t62RaD/HtZ2zu/q4pQZ6L6+4iPsy91Om+tEFqtWAAiBubQQi9QX+avf4Wj4EbjF4ucx1nY+AijzgkkLD5hJYDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvqc6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+HBAApBGvi3E8N1NhcDeXZwVI9CVcbQcjjBauV0xZNnxfxjWBkcq+\r\nlov3xFd4DBkc5eVn4kReRq3nSi9Tso5kNhIjlY3RfWprVTZtGblvfVDkj3ig\r\n3K5RBN8Mf+S032Ye6pd+qO4h+jMAJzfEg2Fa+FxMYmSK4nZaXv4+9fMYMhvD\r\nbFEU2BMjKsUyG7Xeh6Ng6LtKaK36bjrxyFnQKDoT8fCcAHgSqg0O1p+nnYnJ\r\nTfwl+8wv86MAG55gew/bP4G3+OH7aHI8cSXmjzjRjT5o+O5ZcMzMNPdX9gPk\r\nG4WYEKQjwK9W35ie1cujBfme82D43DAOUAxF2o+6Iejvv2s70i/IXL6BiarW\r\n1k7m7UPfJ4xvdMOKX227+wZy/tXOO0MYJDqJLvXNgv7KaJlV6dRysI/0KoBw\r\nkXZr/tAwe7xF0je+uPfS3mu2uZcRitaznAbKhf70hnf1Il4CG3bKHV8Tzzqj\r\nrCvdfJ3azJ18NVBVxuMJU8D1Ps75AAkLKodIs1d6w+pe/EZpBO35r7GRpdDC\r\nGoyfVEAWz/fYSEvx046gHNsuVl435UtYobPS29FJ/x1XJbwCuSMDxEzgAV0E\r\nmNmlPBGEf2qX0h3rQYULD0vAj7cdwKVR6iMIP9xKlVMiCO0rQFoAu9ZS8f3o\r\ndN2rGXGAwhjjoeyIJSK+ikG/87jdRXhpcKE=\r\n=+/eU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"97170631b16b8fa33825188807ebb8a8a7592487","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-971706-lcrmdsad_1673439034278_0.5640113833976304","host":"s3://npm-registry-packages"}},"4.3.0-develop-786537-lct30sgu":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-786537-lct30sgu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-786537-lct30sgu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e314cfb4d8f424e06b693b192a618724c2639ad8","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-786537-lct30sgu.tgz","fileCount":159,"integrity":"sha512-sUDDDlQwmqGXtgZLvkVbiVEoYXBrRhPBdI3DjZo4bGpGeZrU4qVCf6czfNTpX/n7xeAtS6+/BD1WwhaFEHXTag==","signatures":[{"sig":"MEQCIGOx/2+UCw87dckAFG9z3I4UBrBMSpTvRY11/r4tMHo2AiAGgPsjelnaJrHFPEAnZjXQCCmdmNurQUVptixg6lh6iA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwACXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpnow/9FNOx0Q7EBpE+5u47bmjyfNm3eEfVsrz52U1Yh36x5HU+K2lM\r\nldvlN7vSI8ryhmws4EnwzHr6Nr1XOMqy2lusSNkegMOTs37JCI77dPtKMjA8\r\n6MQU6EXhxWOCVZSNztpw8LDPX3BQbCsAUCHljmuJvDbwuBH/NbUoparMuSiP\r\np8bQGxLVeuKgr9kqm4VY+wOFYXpu7jBbwHGbQx1GzzeDbG1XKDBN7xX3tfPO\r\nqTwNQTy+G4eipGrpJ9PskHGrpy85iS77CEZF2go+1IydWOy/rIqJPTKvPGDZ\r\nhiSgA2aW+O1YknYHutC+UdluWLgOAA382eQrOvYOwsOy3Nuo2SYyuE+T5EAV\r\nh+0yHXPqR68KvGSBhlxwAn1wTiooA1uML/l0lD1xrFqv8ZGq8LxeXEUhHuB4\r\nOTrAYSZ3Q7mDRXab6m1oahKwMITehPPMtlU6YYVMXLxJfxzNPlh0oORM4Zj+\r\nkNpk6FgEPhJPOMoe3dBWchlCAUKwB1bIlAQm7301vWHJkgfQOINktVKC03H3\r\nnE+QwAJtC5CfuCJ00S0Jg8j86GhORcuahi+glIKN0iuKEVoc9oiEKKAudcJR\r\nCx8hVR6y256fZyjLgwR5lVrTXk6JecmZ/DEMixCDktp1FOzDdR4idTACfgqI\r\nfPwqDaaX91Gf8y7fgG71FWcWJ/wC6i5+EJ8=\r\n=/MGM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"78653782ffa1f6053c2f18f6a35b2de86df2098f","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.18.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-786537-lct30sgu_1673527447531_0.031884005554955186","host":"s3://npm-registry-packages"}},"4.3.0-alpha.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f5926683d8539c8d1851aa92a339fd3aaf70dce4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.4.tgz","fileCount":159,"integrity":"sha512-Cneoqsjo8jNdV29soCMejh22b27o5eDHGsTzX5YHN22OAF23w6T0WuTV44JYW4NTyl7wmkIAvg+htM2tW8glZA==","signatures":[{"sig":"MEUCIQCAMCKiST2U4oi0dLe6SbN/id+2iE56CyhQeLX29pabDgIgXv+DIUCk3OfCmu+a+j20Jldgp2DJyyeDQCNM5ni+cIs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwAE4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxLBAAiJHY5JzhKzKR1BTqBp8n5IDRCEguDjVZ9XVn85yOp2XMwpO4\r\nR+tGCiE1FDOXDbrF5i8wKvNpuQSOtIbvomRgzE8PletAAI9fvA1ySn7zddSK\r\nHS5hXHqG1zSIX9OOSw4V7O0cYlaMwCpMx39IRO/Ie5+cCuJyPFha6VModESE\r\nxRqNqzUz2nn9pfvQtW43gq8CO1ik0vrAE+SbJmvHOzXT3UfT9rl12ZdvHQEG\r\nWxLaaPCNrFid37XAOni2yZTQpQYVSVloLsgsleFlHXhUsoarhWjBecAsdTK8\r\naB99PA3lhQpLsBrJy8/7ZfXd8OGudLUd+UaNlHuV60e1oq8d0yyJxOJAavLu\r\neiLEQprHEYhPR/HK03Jzp9ZYy4Tkt96RQgsOJeP8Y8+ILj3wVUxo6wt0rVfs\r\nVK9OAwqkuZiw7VsxMJ9Q/5r6WKeaUttqI5s2Y1LUV7+WBn0uRkFMSq35MCB6\r\nnWIkS62M7HWH+xTPCrY2iaJoQ8DeUg1RsLODzHGRWtkf9wBePuLbveNANLRJ\r\nHEmjpSMP5Yo2KyjgF5wDmDOMdILgje2Cy5IRBfdPi9zTF89rePziDfXaqJCi\r\n21ykCqQktIZvVAgKBYlZpVZgcp/Lei1XkuaGjmym4UATFhSZAfJyNBSJJEtT\r\nDOEWe5UgGTLy2hUU84Vu79RkaI4NffrJxbA=\r\n=Tm0E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"df7549bf39cc9710349bfceca91fcc6091353e8a","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.4_1673527608335_0.04267782256666974","host":"s3://npm-registry-packages"}},"4.2.3-hotfix-7b6689-ld4kyfs8":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.3-hotfix-7b6689-ld4kyfs8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.3-hotfix-7b6689-ld4kyfs8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fcd376f6e459eb3ad8ed6710e5f900520d8febb1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.3-hotfix-7b6689-ld4kyfs8.tgz","fileCount":159,"integrity":"sha512-/sCBF/R57wRyJtK+7bh3rWfNQlpcUYSIroTXGUUoaJz6WUPgInDf8i+H3t70U7OfVujgiYgHiBF2X5NnqCtW7Q==","signatures":[{"sig":"MEYCIQDO+8BcIaDUW2of54FSwQlaZe7yfO9U8Vl+lT/cYvw/9QIhAINN2RPg3Z+IKL1nPVNaxgFikieaipVwojDE7sG//XLc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjypxqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNwxAAkAF/KqXCYGtvBkm1jTh7wh9l1zKwhjgWHkf0E42ik93t8qbE\r\nJBWoeFQPv8sVSxPrpqUrLh6X33O6efn201h+bxCaZIsIBFDk7uZZvsWUcGc4\r\niI7Oq4x5f6v59uzmTsI/b4veinSAS9mGoVKddIk6vPD33L4cAh2MW4Axq0im\r\noE3omyaGncqNhZ6xlS8PzH4unP/6XTqEXBscbKk8o6yZs6dFMif5bDfQzZhY\r\nxm1xZp+jcgLjU8O2HX9VOPEe0dUw+w/J8j+CI4eMgZv0NUTH+AGJ1I6Y6stD\r\nGk/xMrYdMVXbtV5mmwuAiQxk84zwFMQ78Un+v0WADuV3g8dG6DJft0Q6nH+X\r\nPbDn6HMhGhjxzBJvRh95EO3EWs60IfgURfI0K6jYKhhM2xp9gaUESFOoELse\r\nRNlPfRpJXIJMPP1rH2LUNNWBb0qrvli/p3okjhCifHAFrhQcuznqt17qdkaK\r\nvAriLsuFxxe2gG8mpBbNTxIip/N+WZrukNxzJ+xWxGYaUYbKkWKzzJ5hJB8l\r\n5RzPpyM5BHcvM4F2Tkf88wWKa2Y6ah1qZcM9/m+4TPN2Oo18uxvVCyytVg72\r\nNBsvmqXtAA54SzG0OW4CMhYDcJ6KSoliJ0FyjFIBqhMJntEQBvNHsGj3rrdj\r\nk86TZUMheBL0mW5uPKOjlsI97IssqFrPHrA=\r\n=j+y2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"7b6689e9a902cbdeee5ffa5f7b3a38905f44d2d4","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.2-hotfix-d96213-ld4kpxt8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.3-hotfix-7b6689-ld4kyfs8_1674222698086_0.423200947877427","host":"s3://npm-registry-packages"}},"4.2.3-hotfix-b92f33-ld4lkojq":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.3-hotfix-b92f33-ld4lkojq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.3-hotfix-b92f33-ld4lkojq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2646a8b3d419aca6efdc3469d007d81fa0451c98","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.3-hotfix-b92f33-ld4lkojq.tgz","fileCount":159,"integrity":"sha512-FG+4/bx7HugsAmSBaxrgoJsdgNy24Fla2XHhOIdCrqX2muN5ZlVsPafd3GyFbBiCiwt1vcPYCC9kGWPEVp9nZw==","signatures":[{"sig":"MEUCID6k/LD8mZm/lw642dix44lD4WNKrSsXnmQjG7oSUYP4AiEA4/u3jJyAjZaDx7H1jzwQQlul2nCFlSevfM4Ku1Qruag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyqB+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpAhg//fMPI4qnYDDI5q3X/KJubetTkMz9rL4VYE7NB9geiH3xKTglR\r\nBaxHECgoGeqNLAiVwyfk75Erv80NextPN5lCT9ouTec5BM43Vs7PxoExtxEW\r\nqwI56qzMG4YTifg+8sxVg39+/cKLed2bd07Ml/mt1j6+tLIoL1oodcA2y3hd\r\nEYDISHt89yeDLnoySSLqdApkL8M1X1ch6uo38A/cDI514CB5IibOBe3Be4KK\r\noa3nlc4M2Hy8DM29126DIH8rHwIX2LjGlGy5EIz09/hrsas3GNVyC267txOE\r\nWsoul7Hs0CENiMKRrp0B3uqG5e5pnTfto+BbY7lTfqoU6ydfYifDbN8MQyGb\r\nONclLCtxtHUmdsNkGMzxiMI7Y2s/hBB9Jh/zCBBJPRnqpktPqB8APymkqBip\r\nJ4bTkV2CFPjbvE1S10zsL+4Emn8etklAe9rep5lWHfA2kEHwCjRMCvhmfz+1\r\nu1q8046s/nvJCNnF78tfT6UCpmKqiiI0YlDHPD2XD2vgO7xI79XxvLbnS+IW\r\nyN/Gd9dgZH7wXkJqY0fRcPzWBEbbdQzo19JONYa+1htnftU8XvBiIwNsf2HV\r\nObtsvTW20bg85p5bS8AbcCS/G9umaW4cY7qUD25FpslWa0fTzM/YFb02s4FD\r\ndRl5iur7/F/h2mTrchPg4HeB+xKFMRuQxpI=\r\n=VAnj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b92f33568d718a4128f292b9883e2372ef899574","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.3-hotfix-b92f33-ld4lkojq_1674223742540_0.9122203785137903","host":"s3://npm-registry-packages"}},"4.2.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b3f79b40def265a726738716f2f05947c0d28346","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.3.tgz","fileCount":159,"integrity":"sha512-FyTCTcvnH6O38fZ2xfsZA9K/ViQh+6HOxKqEqPx7/62yab4jcHahSAtlcMR/iNE9oL6p0BLH0TnasDo/zvwDVw==","signatures":[{"sig":"MEUCIQCGlFFMCprZ8i9+JceR+sy40Qiduc0UC/y5uGn4uTtjjQIgHPh/7VLc6NCa5B2efQIpMaH9rYWcdfwFJeKZoE04U44=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyqEsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHvxAAo2wAC0+HHpFPrK83srfSm1LH4WKJsTznChp1BAzuPuYuzQ9E\r\nMeWIcyyoSDsXEPriSs+0ccbDmPjhMN2LwmQ8fLAMJPNWdQkegLnG76yGuur7\r\nqoEeNbcuwYhkMB6LXxgkx31VPbrzdb70Jru8UXT0G4zDKDv0pEQbeu9tA6v0\r\nYac26BHtwiqpSDz+kHZgVVI0haw8bM/WybLheVdxBiPu/OsR5xEWxHaGrucE\r\n/TkBBTADxZr4KUYw2TMMn5cZV300H4MvrerMejAbGmEO+GN1M4/LORInTKfg\r\n7seZdMk8NgBe4C96u4DRmMeO7emPhAbZF5Y2RpqMsTj56ujvTXBvnbmkBCo6\r\nfsWgM6mpD6Ba+ZxMZ+XPG/Mlw/uSOrYMErSM6wU2DzKu9HG6sLnqnxyJGNFq\r\nkAcEoHHDrZkMvfYXpbAV2X1v0a00HKGf29DWjJYlgSxUg+iREPdblsH8arp8\r\ndgKL3ZTG+LYtX/FJZdXcZ1j3LbtZ7+TNqvXHC5bcV2IlEeMILCKVj4odkzQ1\r\nnCh4UMrVbk7ZxXLK9rQE9Rnd3y63JTnvCEQ96X659vC8J5ySz5n6grxWoRyi\r\nGjT28kCJFlOSlcHnYwNNmR6VOkFA4cCLFXMwe22KTinFihpQfy3Z3Yt1Uftu\r\nbj9ql1kR9drKwKFeMG13+1f4SgFZ2PelGk0=\r\n=qXfP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"53fcc530b4b9fc73226e9653f01714fbb878cba8","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.3_1674223916130_0.8701844327973132","host":"s3://npm-registry-packages"}},"4.3.0-develop-5dc4ba-ld4p62zw":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-5dc4ba-ld4p62zw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-5dc4ba-ld4p62zw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d6b3790474be937ae0b13a24d7f61d37ed7c89d3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-5dc4ba-ld4p62zw.tgz","fileCount":159,"integrity":"sha512-RPLXyMrAmXbnv1Qbg8jZjNP6kny6ts1xoNyMKcQlFFQc+2ewVzIghkh1DwuDenGyhSfDV9KJg3Q89W0yZaZniQ==","signatures":[{"sig":"MEQCIBcnuqXl20PeBIuZVBH7oJHdezhKSwJv5Be/kgNrpzxxAiBEge2gZUYVaK9cWGEoFsqun8xn2BQfOdt5tS3gkQ3vvg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyrgNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhSQ//ZoNVVQ1hZ6NApFb5RTFqgzecZVC/4TN3DMQCg1Zn63a1dQoQ\r\nmsZ5qVQeRiccbGuGe84ZvEfL5G/wJGkncHHQPEuukG7SFGJJlU1l/SAwgMM5\r\npuIsuFLOhRMvJ3NTZfsAmLUwjdjqXqbsFVEElJoU0A7/Mj/LNIqOhRZo3h+1\r\ndYZbP/vDGtmjNWKr4b7yoXzWNEEzmW59k/7ND35wpWXcgF8w6zaMBplO4ibG\r\npRpYkeBnKUjmpcG9RLsh0If89TLtq6nDnfXaAlMYAlEckBd4buTcYT0m19QU\r\njMr2poq35Yvj6UFYb4bj9SuDmT2UD9sTnwgDAsZzJf3e4P2kIKbf5pTfIDx7\r\nrJrR/YCT3W36uz5D2fSE+7rq2IZRBtczvqcjFCXSRXwbrGCYGUenWY7G9/wd\r\nXDlX2aKlFbrhPhyoCracMVJr9TkwLoKZ9cQE6RQsHJvrJu4DXApfuMuSMHfw\r\nNVZ6jdrWYCikk/7+zxBlShWhopXLIeB0+gRi5f/+PQB88Wb2rutfHB/B1CY8\r\nGqB03esla6gR/YR7/kG2ZkooaapmLnnwQ5CBztXIOpohid/NwF8M5kfHG8qS\r\nbN6lG1OCKTdyTZ8F/Og2d+1X6gFot0q53B/Y4r3s+8UutbKii9z8j/kGC7GN\r\nnVOI5aeLMnkwIcV65IZQo3G5bMj2dlwLNAY=\r\n=e4o9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5dc4bafe16b5f08da9505addcdeabf743e920009","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-5dc4ba-ld4p62zw_1674229772921_0.6819681900988692","host":"s3://npm-registry-packages"}},"4.3.0-alpha.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c73446963f20e4f0bb33d7281e9afbd3feb4cf39","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.5.tgz","fileCount":159,"integrity":"sha512-wmceF9MelqlHjTzr8KjPIg6WBSNn0JzKonaDcWTfRcdjsvTQT3zhee4gQ8aWdXycRqw0X25Xg7q8RhqThMv1mA==","signatures":[{"sig":"MEUCIHBMMXjeyt7VmD2rzk4E4NWJ3GGcMqXcGybnK5xUkPMSAiEAkRIJAfvfAtZNnTq4NEmdiUWdtahkb0RB2dNjDDOXlWA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyrjJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGFQ//W3H0dOy1+Nlsg3K9gKXOzr7JrIJPa4YMT0tm4QTynEfydd5s\r\nBYOdKgezougqWTkQdy5raHxzrcYdUmOiyOC4p5js5FHZgf9CxqsXwDVrffBH\r\nvTKaN2Fp0ySSGoOqacEfVwIrt9Sh582qUf7PapG41Aqjqh3HUDAx06Nc0myO\r\nYOoHwuTCTjew+oocyE47FQT2afNF1ZP0RYBGfR7hpgsfNqB17vXvzfkk24+P\r\ncdV/oyFY3LK4h/uLxYG2EiEmIvkPlyqDC6fdbOJ+H/SEgakElmy+iwNL1Nxn\r\npSgl29xjHDNqmZU5tTwYhlY7YPM5VfPD3xc5LhUTzMmv2FcO8W8jshvUzF0k\r\nneZkjDy2BlVyq8I2NTAYSXrEgrN8rLZEA3g7PhAPvz+g8/NDFPxFcGOmR6Al\r\nV3ParmN/OOLkGKOrqxK4q5b5sSNkcW3U0XzXKgJ8usal/BHUWK3thTTHmMf9\r\n0ZSwfkAcHg+etKVsIpkZ4I7iTvnp8JE1Aq20v4asCIg43XK/5Np1gUUhw4yb\r\nd8F7cb9BxpzjrODCaIcpoNJJsz0aWm06mZP5evndR94VAQaX56Bwxxzz8fee\r\nRZrZJlUtLC5Y6WcA/0mbtcpygiBsPQSc6UcysdffqGyN89Yiir+nHvxoB1P6\r\n2CZKfEaLj/Bgv/QfnsnlpuAUzXL96HsVqEA=\r\n=zduS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a5e7b4a12cae0ed2868b407f8fead91fff38b760","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.5_1674229961052_0.29870807897912743","host":"s3://npm-registry-packages"}},"4.2.4-hotfix-5f539d-ldbk9xtz":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.4-hotfix-5f539d-ldbk9xtz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.4-hotfix-5f539d-ldbk9xtz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"86eca9d9aee000acddc9a004aa9c0e43d44db174","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.4-hotfix-5f539d-ldbk9xtz.tgz","fileCount":159,"integrity":"sha512-nE47SnCbHjJWMgYk3X39xxrzUMlxDd4RlGhFOdLtdoakcTOdBgI6Nol0Kpl17iPJgwielTac/2jQ3FjSgiHCHg==","signatures":[{"sig":"MEYCIQDVZO+TiQKbzwX1I1WNEthc89HdyDWx39933U4W1QcX/QIhAIHKSjF6mlYoIG29hoOmFNI1f2cR8ZTaXa/oSNf5bNRq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0Q1XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorWg//cCijuMQT9LqF3QbsWNdihDUjrD8UCQvG5obS9gxhL9FbDt9i\r\nPIQUgjLOxpBazx5R9UTwz0Kik75FOZY9iOjFQvCIdEYsERNAHwRKwX8z8UY3\r\nro7qScn3AxLRDaPtX3KR6dncNnfbI6xK4RnUoVGCHTbZ1KCvWwR6USmQRQ9B\r\nmgG6dXDnLkOsyn4hPrzst16g9iTm7UEX0whWI/vrbEpV/DBDlEQS5DlQOwEh\r\na0jqT17H/FpiYiIyseiAKhOsPxPhKHtf4qhBeeGtZK5WRi6fcwcS8IS0QmfV\r\nuLy1yHRBeGroiJ3tTnlgUiSB2bDUE7FPZ02RoSI+TKidIDQBoKNO33IfkfEM\r\naXEzRxICl5GgS7OZsRsgTBHBKEftxjQkynL2ZDlLd8Of9b3Q0DYm1Dz0tskQ\r\nacLuh/oEadPtV+zhxtkvKB99sNAP7QNCZvyCvT020EXAJLcRYA56TwGHwgTP\r\nZTW0ORSVQrZHJtnaq/xVpGUwb55T/DdA0Sd800GwbtI2dBEaffIKoBHtd7J+\r\nnvFhPT/r+Dq1rxa1LtknN8Uxko/L4z0/NlckvE1bO/qdigh1QEfUGVkycws2\r\nWDYqJnpC92ZtNFReZDvvJsZAefzZZuMqY7Pi4FQ1xS0m9iZ93Z8yCYQzTTtL\r\nTqRQ/H+i/qyifDTnCwCrx8u1R2Ijc8yxCOY=\r\n=HjVI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"5f539d0226c664942b9834ddb3b7cedcaaca929b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~mark_removeSubscription_as_sync"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.4-hotfix-5f539d-ldbk9xtz_1674644823078_0.5793203718849713","host":"s3://npm-registry-packages"}},"4.2.4-hotfix-1c167e-ldbr3t07":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.4-hotfix-1c167e-ldbr3t07","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.4-hotfix-1c167e-ldbr3t07","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64e8dd834af26904177fa7a3044d815673c4102d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.4-hotfix-1c167e-ldbr3t07.tgz","fileCount":159,"integrity":"sha512-UcxlBgFraCYZzUOWehkg1VM1YvyS+dTVMSg4jjmjbkjRBDwEeq6ko3SY0lINL0go7MGbr1Wb5UVhL6FICyZ/nw==","signatures":[{"sig":"MEUCIGz4IlRLOhLQxJfDYsLxOkg2eQXBJMJpa0SDwc5C5ZWvAiEAqPNREIOdLyHxyXqSfE47u8GnDQiRDBMa3LN1Nxa9e4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0TohACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8sQ/+KkgDjECC+9oaen6PtEvg3W9vqIO2KZtlEU5R1fTUbPom5bn7\r\np2FcUgkiW53SQrgJflIWmQS1VD1QNwSDb0dvJzrwkPODDgT/yIs6RE4wkVb/\r\n0gTXGqlZplRhP9svHgYcm3Vwh502fAkLUb6cz5kVWNjX4g4ruNzKdreUQim7\r\nPlcdA8N7/7rw/3R5F1FNLI+jUN/0umQEpGHhnxUez7G08HkTQYW2YUIvdMXn\r\ngGSNqsjNTvwjT+pAhfC5+jmDm8Ctgdo0a81EYl/pAIxvcjBTXO2hTP27R3ea\r\nnecLgSYLpLDvcc3cKtJdRhcnxKqfBc+EfW506wJ1lZKzir9EHg7mLcasvQIn\r\nU06GptxHwRzh8OdQBciuJShRMy8gh7DVzy7zu+V8GbF1vCKTzGkteTTGTTSU\r\nNj9J9ByVIk77ArVQb5n0q7ZLmrh5CBa3ZNT5WKJ2vEh52DB6xRxJWz1ihcCe\r\ntp2+3K4nE1Gz8vuSHy/Q9V56qF303FjVsBjqJUQ+Z4xNaEHSi8dndaRq8jI5\r\nRiVMVURdVFJZ0cvtC9sP3Dx5XTGWeJRPCy8WR5AhkWv7fqaBotd4OVL9qxZW\r\nygWpn51LknIo9I6btmx1rafrV/EPsJObZ6lAJcFQhXb4hJBJr2jkR+t06tSv\r\nRF0e8UKH4o95gVb7SS5n4r/MaWnntVgRL+k=\r\n=YzIp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1c167e759ee9791a02370480c3cfd7df4f7f6c5a","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.4-hotfix-1c167e-ldbr3t07_1674656289238_0.14765677833678814","host":"s3://npm-registry-packages"}},"4.2.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"530e355b1e9b139199ec63395d28af079862935c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.4.tgz","fileCount":159,"integrity":"sha512-3DRWC4MMxZlAhgfHB7z0OZuAW7Dp25hdilwqPbYzuUlCpI1gWFeib+Gc0UjDjZ4zLbsytu0xgBGJ+J5bf5ouUA==","signatures":[{"sig":"MEYCIQCX4jFo/jMs4JlZoUrx52jW/NCkbo7iYhBbih5tMF1XiwIhAPh1HdaFd3fNqp5fhRtdxbQ2/1Uk74+ECRc0t9wiE+CV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538560,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0TpwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKEA//W3PVMecfAY15gfXJ/SU3yWar2FA3/gbWsX0vrz5oXMexo6yE\r\nwxqojClIf9Doyx4mKtVEzE835A/JVZd4eg9fudLkxfHOi3K0MSS2SXdhbIA6\r\nkuMPV6gXGaUJ3HTyhU22/d0qwbbxCUH8rQ256KF1KEX5AIJsvy6HJ7MdFFmh\r\n4f9m6L/GS/v5A9SfXCdJ6PxZw3Td6Bai5gGzfOVwxhjYiR6m77BL1ar+yaPz\r\ns9/R2qQwvK929iAaaCxiGk+4+qOVJzAnCzMib/v1uH6V+1iAjRg+iPTpe4D9\r\neM58W5Ppb2i7BGy9b5FmnFtTqveoQmE3NBYDzEtCSoDjPdaRnf5ww/DK2BiX\r\nrftNoTGAynxeWlzArr0K2T0bclKSD0QzzGXSyrmH2uqyQ8bR90Cs0tGgvpym\r\nGNF/qjVMtrJ/1pFOYcQEEv2ypITyYaFKDRYSKIOcA0822gY8HZrwgw4q6mKh\r\nl6e9GfFCdBCwqHxVVI3u0Fdbkf8TA2xx0AZvijSUX9ck/F0GXez017DdTboj\r\niglmNUIT6Xp6X6vgNm7ByDtKA0peso9tKQFYh+hfsaqQNBcfHyq4UinEaWAA\r\nfTQP2WzyWF0OUrJpP6Vj4Rfgfa9XAGNdrO82n5/zJocbv3Yf8ZZoWkB3BRFJ\r\nQvM2xALZCshmewPff94Yqt0atK0iaZYLvWQ=\r\n=WnCS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"16b2f37e0bea5240e579e968e1e73c5a0f8f32c9","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.3"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.4_1674656368573_0.9347658680070419","host":"s3://npm-registry-packages"}},"4.3.0-develop-168112-ldbr7v4l":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-168112-ldbr7v4l","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-168112-ldbr7v4l","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a530d8420fbaf503cdd7c5a5114a171ba523816c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-168112-ldbr7v4l.tgz","fileCount":159,"integrity":"sha512-l/MJ55p80T16LvEZ4R/mFN7mtKYeLvh9p9GjX7GZOyfvkCfnZjCInU/KVVr6O9xYYKroDhOMLNkNsqUge0jldw==","signatures":[{"sig":"MEYCIQD/Es9/snipIjnK9enWcoKkwZKJqS6hG6L8fkq7cUTL4wIhAP7hmW0aP2OnKrlT1dCvkFvcOPBWs7bA7bKqeScLU3eq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0TreACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreRBAAjtMR191Mcc9S0TOHdlmZxHJnpalbjtn8yUL9y94ucEaPn/Bu\r\nM9JHVgoUK6efSBbl8jdsh+0gEynA4YAWPTjleXgbBGhRV/+aQi3W9/nqMzdE\r\nHCf2hMjCpgrN7ItEEJy1vXHHp1e3BqACClQbnQCBzxk6bnaI605gnBLV3XxD\r\ngNCE64IBCWkuVmT4dIytKJuz+UWynR0NowyHDv0H1djLLzIo38W8RjMXbyTh\r\npn0XQJ7VARPdlR9OX0p3HH08qpiPj4u+gRHANehBWPDO1OyhtLvCMc70Ye1T\r\nzEEgOkjdGfjhKi9nvoXFUf0YAE6mxlXnrp+0vmxLypUudVJovw/B1OuIbJz7\r\nqjbrkamMpuLDjfSUFdxpj24QFmt4gAJVXWPfFOK09QoxpRR1G7Q12tdx6vy8\r\nNqhf5dCxGJxuS1c28OvNqxu6ZkAQCaKFOfiBj3lJuTBH85ZJMN+NZYh7utH6\r\n/gXPCdQwsbYqToTNJl7OjcomTLkliglxMSJMCxqhyBAeWKRkvr1W0Jvdt+OK\r\nxR2P8ifTOpnS8btkg4bDI7jaUzsos04R3FSR0I5X0hrU+A9pWjZ5GblqitxF\r\nNdqm8TUwy+oYKXVdEKune5UvVUI6NEEYhGl+/le6wltXwMEEr6sdfbnjb5g5\r\naadYFHYlS2zTn+FK8X92VeF2p0dxhafLJLQ=\r\n=r1XE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"168112c12db304040fac0b6b65f6627fb67e34d2","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-168112-ldbr7v4l_1674656478686_0.8478335474764926","host":"s3://npm-registry-packages"}},"4.3.0-alpha.6":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"561229bdbf2ff23a5dfb3fcaa84f25fd211a2b76","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.6.tgz","fileCount":159,"integrity":"sha512-j0ick2VTPieW3V+FBK2U0roCR3vijTg7lSPxFch+Q+J1GZl5l62Lf1OPuosHA77eKpC+EeXZuBEVZHWsjxa8RA==","signatures":[{"sig":"MEYCIQCAU1fn8CSd7Ii73NGZyWPj2C7RDewoFs01WRI/rR1IrQIhAJicU3x3hfBNY0DtYVvaW5PDq70f2ZySONJiMSkw3RmK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj04XkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqcvg//ZtF0puh9A0AlvvLjmoVA7R85ghIvXXSZdYoHZlVimHtlgxbS\r\no0V9XY8XB4F1JVoncrxKnY2lRWaq+So+IIQBzQIZX85fPmpnJXlqZ9JmZLYK\r\nv1OrjisXK3N5cqQS5RH+Anz0qFzt3eSdrtcGvzvpvg97IMguMA4jlxBrPxew\r\nrWYgs2I588HdMgcdCUwubXNyAfO8PfsqTWWYJsSlyhJOjhaDUk0D1eF+2uS1\r\njL0RAsy3vRVkowbjbSu+IUaZZ6B432tJvr3ohWjoA6ic7UsIGVcjgc4eHiMJ\r\n2pmOAMg8L8wXhOOZCSwFhwLoTHrHidBOvCjqLRQq6J8aFpEEulql5K6Wqy1d\r\nkE2kWFejJgX0qpn5Z55YA38dmj3LgsH2AtIlegAfd58AZDYG402hUp37ZLsm\r\nAh/fZcqaRqyw+LVuNpZ6gBJTON09z0bG3lBKRZ1hl3d0XOnRwdjAcnxAUNwF\r\nIt3i80v5SjGc35FsMyfSIeninlD0alWjh6J2wlrO1um2S7gCiwf4+YKd7Zud\r\nK7oFg3euvcvgSN6U63+xNa1RTy1hXvbAZKHrhu8DKYb+NkSRp+RnW4NYUre4\r\nVOOUs6kX1ttsAaYuuoCIGv2R2RH5nvz+o9cCR48dZsFSsbRHazlZNDCpndxa\r\n2TQe5DCSwQeQcyxAaSox66+cZY7goB4wt6U=\r\n=vZEB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ec0b88457163f8d061f0f6c7f8903e6a6a8d1407","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.6_1674806755700_0.9719260300285413","host":"s3://npm-registry-packages"}},"4.3.0-develop-e25a54-ldithlak":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-e25a54-ldithlak","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-e25a54-ldithlak","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c71abb3adbbf015b155299d33029bb14e4e0668d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-e25a54-ldithlak.tgz","fileCount":159,"integrity":"sha512-r1nyTzL6EeGXlllTSRkm3AVjd4eaJge8zeL0NuLSUQj2L9yOXY2RVyiBki3WPRvZ76sV55kfuZVMNzi+r1KQRQ==","signatures":[{"sig":"MEQCIAzAEyEwNduSVyJNP7gyMDvB4DbJlz1bPiUWmbHao0EwAiBFbJEHEvosNx3RTJJI/AnZzTJJlDybh1d2+6k9GWDbUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj178jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoX+Q/+MJhYBH8V4r2PuQ9OxzTYYtjzwFWKLeYW0YTwp34Rg3TDIvDM\r\ndQFPMCW5+Ub3C4uNZhuOs9r7Y3SG72umrkLfQYoXb+21T3O9i99rfG9lZAuW\r\nViu3GMh6H9YgeQH5UbHL/b+xq2PjPfL1ppVUyG/uJ6v8UNweVQw0TXlGI72t\r\ngLau/iQVvKR+MS6zGDeTa7+yGq84sYGaKd/6JD6/xiw7QdBu5totZWsjvBnI\r\nqycMdxNOUCDLedC+68LdvhTPtgJZGfeFWMMTjAAqNOVQwpMSL72+DJJ/1u2G\r\n6Snn4lnCER+ZnNgI1WhYmR2CN3++yKZ/IpyF08WdIBDiA1klQ2mbGhGZCvQK\r\n+QgD3usSU/jsEXyB53P1KX70kLH1Q0xYOKjp/uZ2Ge/YXKRwXYzZlqZdDiRj\r\nBmpmP8XhCNeU8LZHkgalutb7rAmD9xzk9cy6uG60AZ5aJBia/tw3oHHIE/O7\r\nxF6fd2UhQT3xu5pZuMX7tfX+HDKo1Bius2brzVMK+JoUxH8HTHYHmjFGoJeg\r\neDvUM1sVFYBKPVsYvWZTlq8FPSazWluoNiOl8bY2M3tbB6eqEP7xys+y0tIr\r\n5po+/fFXSd61nzrD4AwPi7sSzZbjsNWSjaxmybWx0now+OiEhWw2eX1SY8Pw\r\nZjj2WUr3rwkdQ6ujrSVVj5pErBgmXzqk7ck=\r\n=Vvk4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e25a5494ecb3788bc1d172e45511c10466224b63","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-e25a54-ldithlak_1675083555114_0.2522020698899321","host":"s3://npm-registry-packages"}},"4.3.0-develop-39d67b-ldiup347":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-39d67b-ldiup347","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-39d67b-ldiup347","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"911fb52a30710f2f1b91a67ad2feb8fcac23de0a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-39d67b-ldiup347.tgz","fileCount":159,"integrity":"sha512-ZuyHfOMx3II4CGCxLJK/o4/UPa09kn9AA89KrsXvboH4UNpd3EL43OLPDJvQWU9Mbe7aCdSLGaBf/Qmvd4a2+g==","signatures":[{"sig":"MEQCIHm4IQe+uJ7ibKQgALCYMgrf2Roa5A1QO437RHLu1mYiAiAE6vZ7OdHXtBPzTuoSD61BDoxRwxiuyYDSiwzzCFbMig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj18cQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9Bw/+Mi5KZPE41iCB/yQqAxR283uLscYoe5c98ffvsDFknBU1MIAX\r\nr/ks6AxHSJrLSkTxcM8Wlty6r5wQWZv8WXf2dR66Y76f5BUQ+S2FpNnP1Gi/\r\nBwjw83kFFIBbpquedvuFYgKNfyG3nqTiCCGhHrwIE3n+ShVc6tro3XQ8rCu0\r\nEo+rqUq7sZ9IcznoidfsbiO0C7dM7fJYAKn4HZevCk8V196gTQCO9RQeKnB1\r\nyJQv6nEwfs4As/io7JvGxyTY37SQZ5g1YvP+U7O9PYCSMbt/H5Y2TS+/XVMp\r\np5qlI74UMGGdBPetXUnOKXrnAzbZWuclGeKaN8w4HVZu1hY5XbJ27VpSAg2A\r\nYBTQQfy5WM0bX8CoovMZY+oFfLG83OF6icliqIgGulC8LK0wGD2tp1FIpGT9\r\nDkZD0bEQtQRL1ifKIeUVH6/K1fLFWfSSQFbH2gVn6SulRA7d/Rkb2c2/ehcu\r\nnA7dfLHBsG4p8VP8COYFxtUQiWGwyCkVZwlPJM2yxy/Di8fSPNkn+O5hdTj9\r\ngumCx6gCqQnWCWFYH7/WH7k9w6T/wp1ZTzb3Sa/vNNkCeU/jr5xIp3JIieBN\r\n9qHRAv8AyoDIXEDAbPO+c6kHBHzfXJmEJKZ9eFD3+J/Hqaw0JaAyXrfS50Uw\r\nkfh7qGChVxbVLJM3TddTDisD2Hzz3ZFdc/w=\r\n=OPCv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"39d67b59a53404c06e1f1261fcabc6b5271c3fec","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-39d67b-ldiup347_1675085583957_0.8911021300794351","host":"s3://npm-registry-packages"}},"4.2.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"04970475f1bb1d2d76dbee47bbbf12bbd03b9be5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.5.tgz","fileCount":159,"integrity":"sha512-L6GHVbzuAh3uXzufavjuTpGSUuQ871mfFJsjfTujIn2e+LerJWyl13QgiSwazOh+SjMcRy8eQ/klpkn9zYJT8A==","signatures":[{"sig":"MEUCIQDoZOjSY7Br9Y38Evg+UDC3yxFUn1eacYeHKSPc3uzacQIgR/BuvCMgzixVRd9ua/UkyX0vDb6sGCATA6RSbUXjCQA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538560,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5K3zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolpQ/+KPq9bCgCW09AmCTXSCLKB/x82SErxdwdrETjToIj29vhITpC\r\n8qmzmpvyGE8hF/6SkvGSHn4yZ4hsiocGDl7iWbP5DErPX+Y00e5YC1UD+mvT\r\nlNlv5qHb1pbWjaTdAuz73ZMOw3mOgz1wjActMjo2YUauyHwMhFikFtPifaLH\r\nUCaI0GvqQcCpFHLjjzv8PgPAcNNoBHJyDryE9MobWCgeVHbLg1HS9S91CYpc\r\n+mCr9bGqt9wB4lN5aSifL5NBPJmQCrxMl7QT61ZisGYctmXYwkPhmKUpMcuH\r\nl+iL5d41bneb0sZhCPmW4HLVwi2f+feKw6/enigXLw8kpM0PpgVtMf/2m2Id\r\npKdK9CcmGGyBrtUR4zkz0fyJ+gEhniDUxYiGRxMzxpi4MVd6Gx+cy0KiYFE3\r\nK3/2tf/DVmrvF9kb2hlcIqXlGTCIrWKjE3yqMiIsLvWf3zjdsUECp6sF+pCd\r\nXeIgqJdaIu7dTnzL7KXrzVnW8UBYzG4ZM7g/JycqqMipIs1Y2clhT3d3SQZj\r\n4rRq5Fa9e217e3lmhozyILKMmqhLtn7l1clOSIc7EqAZEdr5ZuYDLZ3SDeAq\r\nmx+Kd6+cOX2YrH3v7VFwBLN8bTASteKQj+WDl89T+9o9fIhZzTazCV4VpYYV\r\nMQ//IU5s9eAYCIDZSc3LGIxpydFtrxGAHzg=\r\n=NoTf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"918156ec5be681dd0b2931522cefacca3479a653","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.5_1675931123442_0.5871394018809399","host":"s3://npm-registry-packages"}},"4.3.0-develop-991a5a-ldwuames":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-991a5a-ldwuames","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-991a5a-ldwuames","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6040e7607b75124f4aca7c316a122e15fdc7095c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-991a5a-ldwuames.tgz","fileCount":159,"integrity":"sha512-/tz7kaALz19lgCd0GJC/rAwLhqi6RZoGgIduNU+Nqe5gP1PGji/leHOQfe/emgHXkIAHDW55qN8nUrVrSGwjvA==","signatures":[{"sig":"MEYCIQDiJF9Wx4+5wxH1Ei6f+ssjy+7U1LZa9TFZ5S9aZtGuVAIhAMyF37alvJewcee2tuyLXx8So1P+PTUFTM6I4s4YIau0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5K8tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMvhAAiH5/+5bIZbC7iyLAilLLMHz53XiaqrdjdoA+IQMD3JqKeg08\r\n3d1D07lTCxDrIzHvy1J1CXhtfNjcYHCITNTl/pnawO6l2JCzKQsHs6/vAUH5\r\n6HiBU2ECsQ6KRopjHztBQSoHJR5u35u+EeSRB49UaGrg1rybArBYtjZ6UeP5\r\ndEaANRtKvk0D4eYe9g7qF3vC4oz7qCLj+jDxVV4hlVvLo2RrqihA4GU3QJj0\r\n9QWId5AZ33w0kyI2LqQOme58+hbQtVsjb7koiBfcyehqAbZER5Ed4UAnHKDm\r\n3scXvHJqHPkZABTF5izU7yexJZqK2aPEuXovBHyyzPUnVcJAbbwkIn6ePazh\r\nWbL0vGsg3q+EfSjS/qW78Z/pTLhV5X5i1Ch9FakFMwP60hyJc8zJ2Lxje64M\r\nnwNaRiCuAgieLLBDjoaBFjyjurmnEtIABcGTfQ2BnUB0oWStEf88IJ8gE2Mf\r\nN62bF5nf9mOhomaPpDeXEBGzaEO+agU1cCW54m9aogpS0k1kDq6U/ZfPHpR/\r\nAal7KL1mIBkxEx6GL2FhNhEwgQwPLzv3HMMNw8HrG+2zHV7oLGgVSszjXFtr\r\niQsowJpgsUzmqZ+YSRp40/BKLZnr+0/fHNmF2LswKuzMYwnxT65gtXpd2rg1\r\nKbt2phzA1cHsACwB2/fr9J4XNgG++UVSQm0=\r\n=9dGZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"991a5ab3597c88e995b7325fd4a244838661680d","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-991a5a-ldwuames_1675931437627_0.25062142710342594","host":"s3://npm-registry-packages"}},"4.3.0-alpha.7":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fad4fc3c3797899fb8bdd5d7f851fdd72d5bff6f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.7.tgz","fileCount":159,"integrity":"sha512-xqkVxszSx+MSgIUH9im9ebAsnZh7gRhbkhAKN0zOWr9x6NB/ty8TQWpKpgNeoIBMSLR7+ePzfcfu9sPiQ71nbw==","signatures":[{"sig":"MEUCIQDdZoq94V1gjXmCFwRVT6BSX0ntxO3uhlPwcgMLmq1awQIgAgzvwE5SBr01PuKuluUuSUmtTuZk+gVjprWuLbFstz4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5K+LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5WQ/+JSwaUTmMLeK04uj7YnlZ6UhmLXyOb3GhHaUd5ug637LABxSK\r\nvpXt/RbJGGZzRu2vC9B3XrjtXjSOLsYSEGYFJMvT19STCJsQcMQAgo34A/jJ\r\njCzygcIAGazbTG+IcStkGHpcaciaEjKS52cmFohyZ0hOeLF2bR1D+SjUN4jn\r\nxj8+63UGmr/iC7Jo+b8Hw8YGAm+7dcEtXtN6G+s5LF5KgZNFIpsiZEJXpFB1\r\ncoRCp37plf5BMGYGWYSUR3nMjGaSA8VexQDKsIf/JMxDYp/yR/AMp76nduQs\r\nE3HdeKdeX/cKaFb1ybbgt0WnBzwVyE9zcJ/12uz1WCZp9zyt91GYTfzL9qK0\r\nrCB9wZxZyKEtvB39Qg7gFSexPkkWXC8KISdBsLAiSnGCrGu3b+zp3g+LfTlx\r\nsqwDxzbfrBp4Aol91zv2GwfQqGvRakPz15TadzAPXe9G6rb7QIPZUidm08oX\r\nMhOVhxqTnAGeqbdexFJpPY8aLH9skfUOYulSK1jEEhOShoB5OQBkCvtg5oCX\r\nN3sTQ9AMwcevQ0rn3trzzEBHW1iU8T5zDL5gdHYkRyzGYpBbXJzrW9/etADq\r\nwE7ONT/f/wIyHtm06j2FhH4v5umn6k9sr808pZ7W3BioZw+2uX6XOu86DvNI\r\nAfqE0HqR07z7cqPiKAyJ5Uce0lWUpkHe7rQ=\r\n=3Lp4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e2c218ba27bebb1019c31982964a4145dad90d37","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.7_1675931531024_0.1955103570661163","host":"s3://npm-registry-packages"}},"4.2.6-release-410c76-lemo6mls":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.6-release-410c76-lemo6mls","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.6-release-410c76-lemo6mls","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3e1ed3f14713e52856f886bb7f7eab1142ab9f01","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.6-release-410c76-lemo6mls.tgz","fileCount":159,"integrity":"sha512-bpRoKxZvsFyPwD+F25jUcp52Hy7pjRHJWBIAi2iPSS9zxIfb3VTcQxWYgqLz1NLLxpVQjl6IgAeuuGs3HJasxg==","signatures":[{"sig":"MEUCIQCFLjZBJsNikmZXAsM1Nz+Tl/uCd8BrQaPesDJWhrpNbAIgD5LkqSIUXQ8eFqq1+vJbSpW+SIYFychm/yIHbCgqcMo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/IQsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoLw/+PeHBLzK2vEGb92Oqk+viabrdGRlfGszyOQT8tr5JjGQEKy8N\r\nuLGPJB1u1rGVizvbZ2z2Iqm2yl2RF2wl805yYf0ZnEAQ5U7GAhAfMiL/suMk\r\n5XI69ZM+4fVmqDMy1EBmaxkG2Bn0o9yhZVkscqa1osAuTikknsM39sZ+G/nY\r\n1DgvTj8ToSkzsALEXZmS6wWt0+U+CteHZdpI1VegJj9+i9uVlnydyLxvM9n7\r\nTjSop6/GrJICG57K1k5aoaiidZQcPnWYHyd4TrTDY/toHuTjDYFqkfoGHxCQ\r\n3+LaDClk/8GStgqPYOM1abU15qp61r7mJ80dNKHhkvJ1bKHnx9dbDXawqPTI\r\n6uMQphQo1upIhFvWgHD3ueUVYwFnwufoJYgDsAZoaLl0SUmA0cspfSWyLc0i\r\n25dgMAJe704WaBM3grt+9AnJzXSSXBs3Ct5UR0i+g3vhyMiMbAOdvF28S18C\r\naY3j8C/qlp9DxPHLbT0wqwakwMTCRYOBmkA70PCajfithTBz/fI2o5qACsg5\r\nb2iGzIiVdenNH4Hiezo/rdzBTz1c5koU3AdfpUi39xPrAn/42rr/Ynjj0Qmk\r\n/CVs8UMH19iUNL1l2UX/zAS3nPIg2EYrzNWbhj4FVYCAbGMal8oZzUqRCRl7\r\nvm9j9SY80QLZWrID03cVoBQJnNx3gqK4YYo=\r\n=hqSY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"410c76b7377e18d2b02f7763a5ea12067643ff69","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.6-release-410c76-lemo6mls_1677493292159_0.6848751263725561","host":"s3://npm-registry-packages"}},"4.2.6-feature-f38f9c-lemocqt5":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.6-feature-f38f9c-lemocqt5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.6-feature-f38f9c-lemocqt5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f0c8a21dfd54bb5affed557ca18ec0a2bd1dd229","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.6-feature-f38f9c-lemocqt5.tgz","fileCount":159,"integrity":"sha512-UV0/EnHKMGzF31vQE7UjHiP3lXysshAwvLvl3Xt+qmmng1BZVwm3V/0UMMyDyRcfLc/AGgJ2u1Q7lgV1jIRPLA==","signatures":[{"sig":"MEQCIFOAy5iuKi+WXS84BdmBZfubWFw9PBjNclq8+xBscrvRAiBupaJ4jDikWH6ZLFOEYsSHUZ8iZSDChb2s8m3efCqOPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/IVLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAzg/+IG0qR3EWe0auOF3CI8MbNixMn9ZrDX9yi3+0o90mJq28FK8e\r\nB9fMGA8aFXy6AW5ewt43PSuRe06G3wcMzARNtSQk+fMFB8mQHGU85dVQXRqh\r\n6aBH/ogJqQ9ZdtjAyapCbkpk4xGce/QDxfD+ceZPapis7Pc4hJWYsBgBb/jm\r\nE72Wt+CJKhqi1HFflhLOjc8UOybUh1HVEEZVArQgzQN82pbXcTfqm36R/XoL\r\nCfZcPyNuSzc4vw3RO485mLBRoxwKv5+l54db0iTyPEkobLUd8Gwk0aygqGOP\r\nN9rZPKiomkZqv1t0G9vIFoD+z5z5plEcmHNFXNNJuyyfrSyPfvfIyErbqL+b\r\nwKKZ8AtRCGwZpIb3MEwlKumse9S4OFhmv4aKIj2KzvaFMpWDZP90pc+tlY2/\r\nJ+HiLWT2c0MFi/+iSnABLH1zpxLUWd0jH4IJXNMI73sHhADZlZa12fXoiKGQ\r\nnNfoFy6d8+4W7C1ffagsSL8TArfChb78RIAxs+MIz2k4Qs2LlEY1Ce6qSOcB\r\nwEaws7sDZCKXqHShG+GpMKf3y+Y0WALRdelv9zRt5lRbo6fKaWY5iBqU3ebj\r\neieG1bn7olUiiftHoAs6Qmzmq4R2+j3VLBUwL5A4p0bNe7y8bMGfosDizzCR\r\nX8WZIa8M/R/67l0AcpOGCQtibm7NCrFFBQU=\r\n=/BHS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f38f9c1fa4c9806b78eadf985486c72fbf71c149","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~include_custom_properties_with_process_view_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.6-feature-f38f9c-lemocqt5_1677493579637_0.24751458898277723","host":"s3://npm-registry-packages"}},"4.2.6-feature-893e7d-lemqgudw":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.6-feature-893e7d-lemqgudw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.6-feature-893e7d-lemqgudw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"6f7f615440c4d4c1b6d81dce05375d9d28a5e07c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.6-feature-893e7d-lemqgudw.tgz","fileCount":159,"integrity":"sha512-azCFM71EdcZAKbrSUt7CvgSbIZazvTjlxLxLbh1IAmurXAvOK8z1l0vqNSRwSne9iI8UQkOjGk0BbKPQ51uI9A==","signatures":[{"sig":"MEYCIQCrmbogXlviSt1/PWIv1urXwELFDmpekfaZksF+J8imXQIhAIWMArPMzdlYf9QbEHyN4/abHnV+ybgPFBS4ASui1ToO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/JMqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTtA//SpAmvNrkIwoXIidC9tD9BIDqlF5oo1nvsPjzHA8HrkFHTVhI\r\nXRPKSmYpUYISmUdPEOj1xmL5kZSs/hlR945+gEowG/xSpx8aW2vc6wwZkrLE\r\nDDS+1OLPmRUYNJZ4nzdC/91Bul28n5fSrky+LKgT0aWxXJi1i6C7CzVBsUHB\r\n8GRdC47vo0nPrmXgnarshvz3iVsTx8sdM+nkMzUR0uhq7O1ZyKXssK6GYEGw\r\ng5ephzAqqstPAAPSiHL92gtmq5AKv/EL58slRy/kOJuqWkOYwJ41f4pIdwLK\r\nwJe4Qb4V2PKErHyNdVhdkDTLGEOV89isPzsb2Y3w8LtLAp+syiH4Mk5FT+pY\r\nTRnX8BMbEGuqUpxY7X46dpPY8daUhMcGvFz/qLy9mrQyzGHvLeFZtLXpZoI0\r\nxee49TJTY610kC0d/K0thuWo9NArrNysoBoy+d9QQXK4Uxnse3OnSuz3x0al\r\n6jMO3laEAhNyH9WOXJ5yFmDiNTOPG9YaMgSuac8l/IQJWIlxpENdX2KEQbL4\r\nM3Axx/3CCM2F8zGTOUULw6rJxy6AYXeUfnfNFJ8RNr+UqnQyN2t9Nf7ZCOuJ\r\n8YZggA/+MA5Ap0OVHa6mP9Y1bnaY1j4nVR1rMrFkLeYZtNDlbCrXln52/ngN\r\nex4oto0I09QROp9sDt0WaRC2vLdLWtTos18=\r\n=C1lE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"893e7d130b381243a1b280ff5127a47f426086aa","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~include_custom_properties_with_process_view_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.6-feature-893e7d-lemqgudw_1677497130155_0.6852685653396686","host":"s3://npm-registry-packages"}},"4.2.6-feature-bdac69-lemr92b5":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.6-feature-bdac69-lemr92b5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.6-feature-bdac69-lemr92b5","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b171c89ccd064286ff5c9973b17bfc3e54326a19","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.6-feature-bdac69-lemr92b5.tgz","fileCount":159,"integrity":"sha512-JjfWCIyqxvltoAzD6KbrpvEraAhkKFCBwakLZjnJMgilR94UX3IkUatleVyei+6MVi0Mss8Q9jflBqUQbq0qLQ==","signatures":[{"sig":"MEQCICLWWPIQS5qNl4Yeg/nBXclJdG9kiYYGAaM1/Ct/CDhVAiASIE5PBGLZLm7bLhkQF7SR3wLj2C0b3Ov3a5mwXqESLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/JhRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg0xAAnV3EvhWqf1yBS1XkwjpMqMDHOLV65Zl3PHGrza7PmNz51QkM\r\nnROSmL6/Rq3GfOJoc6RbnEjTqqicW+t9CGrkedwhrYC0IdQr8z1ClK5wWQQU\r\nWnIxYIhxmLnCu/+fbUprKzMoVvf0yAykMpPvnpBMPiaoNZjm8x+Ae/0jyp2+\r\njL8gBagXDKrlnXBHjo+6SyAmTR5UDypm9A+qMJtsOmqICPvxmmRP0xYjbkjn\r\nLZ1juLUTpNwimaimxY9RvpcIPG7CKNS+qfg31C5FAG3qLHDa6w3KznYzRUq0\r\nv88+/kZXQygIho4/yeDjmqtYfF13gf1/RxWE+gMwCzmREltMa2UxlD1l3HhB\r\nsc9PyUEgkVESJaZyoiTGJ45/T930vV9eZ7bLKGbJ+KiOceRG745Bt7FAwYzP\r\nqmBXycN0tDfyFMiML0nWPfUn83WrdetxhDetYD+BiWnpwWCOVEuF4zxMig82\r\nn6QcQMYgyhUnex22rrmv22H+DpSDkeSBCR4Ae4mHo2Oa/5E5K4zWwSFHhSn/\r\nDgQAmrsMx0gXW2sF8B8ZfmN1095MJoOySqtp3yVE2CWjJkIGmf3ZxxS8bo7q\r\nKnh29a2Nyk+Rb7E5EqzkEe3KAxhinl34CiYVnLQ4o0pZGagXU7vUFhqAB1tV\r\nOjNmHrdtdeq17rgBQpPpSd35Q5h/fle2N8E=\r\n=4n+a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"bdac69d05030b734b1e00595321f02d83ef8943e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~include_custom_properties_with_process_view_model"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.6-feature-bdac69-lemr92b5_1677498449125_0.11309392060201606","host":"s3://npm-registry-packages"}},"4.2.6-feature-40396a-lephgdtt":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.6-feature-40396a-lephgdtt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.6-feature-40396a-lephgdtt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"855db0c60f7780642cd59cc4460f66cb4a3dc626","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.6-feature-40396a-lephgdtt.tgz","fileCount":159,"integrity":"sha512-89epfI+Hnuhtn/8O0/jejl9vhN8l8gMG6RVPO3agLbAOw2SBtji09e/AdxcNsPZ3a0zViTsfxiDS21ilRgILbw==","signatures":[{"sig":"MEUCIQCNlqsxTySwmu0I3v3JePMeS5+9trruwGbVfBAPDV6mkwIgKEJU4AD/6o4R84W0U7JGWljJvrVxcHTqlrQ2cR8smjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/xydACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoS7g/9Eulacw8/J2GSZXzIQDXQH3E663kFw8qenWsc7crzckf0mBjf\r\nt2tjJCSEP4KDyJXyJQGn1xG4569Dh1cYJhmfgJF19o7/Y4Ou7kUKfBrrrOhV\r\ntiIWsQr/PMX98xgS+bKSjzEU4hQauzPK7rMC7WlVjBw7LKLYZuZMoqosKSdt\r\nvhrI7MfBJV4GSD5V+8St9XEy+rVSxoHMXjj8UJo0Pb9aA/6sihGpSO0OeyOi\r\nQglcpdklFiwPbl9kY0No/nH9+DAeMFOfGWznkJTECSOmtrm7wNmOB0JHZtLK\r\nS8rAxTOdRtkyUeWUs9rDYUxk0e4HdBD9BgTo8/soqSQfhy5U3XsaZAuwLSBz\r\nZOCXchl9tRi/+O8+ULqOQPx92GaZjamUePu/VBgCx3E2k126a4ud+7vjI02J\r\noyEdXSoYoC45UUTNLBpmblg4+YzQrBgJtSLHcbL19cgGRiKyJDUT63/hnbO8\r\n6VxBVH0LtZYkNmqrGpLnxJdoOv/V8FR+KBjiwgBHtiWXUJFFZhlAW/kfTMz1\r\ne675GbVgjE5zFkeMHTnbCYOrOFsHaMkoqqF0Fb9MQ7YxUVXIik6TZ2PpYS5I\r\n6lxYiTST00+VMk16swqMMzIcbfIIpVwcdNMGD22UgWGmgUsdFX9OeR0X5S6M\r\nxKTJt00ZvoCKuLnzqDLrO714BK7XG3jv9+k=\r\n=b8TA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"40396a0db33ff852b163b336eb817a9cbb7697ee","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.6-feature-40396a-lephgdtt_1677663389323_0.1859540632194583","host":"s3://npm-registry-packages"}},"4.2.6":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"abd550dc8addcff942db19267dfdda96eb1f4c82","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.6.tgz","fileCount":159,"integrity":"sha512-2Uiu7MNyWMbaMn1fLJRkpvBv5kysuaZOpT1lN0MgQcYqzDhlfB72vwB0QCya97/4RyEflQef5z5SHjY0gA7n5Q==","signatures":[{"sig":"MEUCIEWacvSnFKGVTwfPRORHSy70WXG/nKQnl8qKa5TYZhkkAiEAqwp93q14wQ4P87buBPiVBjD9+Z6p0wm2x4U5DkkwX1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/xzOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpS8Q//ZmJsrGCmjq0+8/t4863d9vWT5PqAGMQrQykuD0O56cDn73Tk\r\nUFpmtE1MS2zlQIQApXo5uBtbI0Z2mUrYN1PVccL2Og8IDrpkcBg5L6m7ivCb\r\npzR72RaKGEUwzVkuV7aeOKJeULXV7wQCytwPcPcxm+cnUWVaZFy4+YfTYWnv\r\nF4aP6Kwmz9RuFQ/kC9h8BbbDql76K2p/nuqf8VRkly86X2cmQ09GlmtCvp01\r\nrwy59xOHG/VHULqQjYl27rx8gBdUK5Q9/3AkC/TDiOIlSUO4JfHihPYp+O44\r\nvcklgRruEP7Mb0JNKFmGWYXAfzVRtGv5SGK2XYuaLWs7LiDCL3RiYwnQE5bj\r\n4sn80vuKr8K9X05yXgezmtr98AnUMlvMNEjTsr2rJbhoBt2LJ3JaAnAm2hHl\r\ncqiVVKK4N8wFvFZwFonwhmVusSXZiZ8NjfCgsVmv8S3efWJE/JOm/TUL1a2a\r\nI/iVFI4ta4xj2MoPD3He6aQCCeZmfef+vZCrZ3ZZ8PWOdZ8VAbtLL7HdF6R9\r\nr3aegelfJep2dm7WIkMCdP6IyS4X+WecICk++xpngExwT9L8qMd8HTHv6VU0\r\nNZrdohZAkFEYIEbWcWnsd29U3n7MLnMFzsceXnyBqPattR0eKxFziGmWMT6U\r\nol8hSLsotnQ9C+DtIk7Q4nogTNW/Db6iZ0E=\r\n=Qgll\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"a9017c0562d442b31b388a5602e237b7810b6fbb","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.5"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.6_1677663438083_0.9163518286313328","host":"s3://npm-registry-packages"}},"4.3.0-alpha.8":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5cff0a9743a56c1a684e3b7c5a7ea30e069af3ae","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.8.tgz","fileCount":159,"integrity":"sha512-dR+s1wThOFZNpFHKZp+RAzPLG+bfBY200Bj12Dtncn3KZl6QqRfsFphT9o2GOENp5SSEP7OTqMAWW2YO+cilBQ==","signatures":[{"sig":"MEUCIQDa9fwDBbo65VtiUQ2F0OMQiX61jlMKglin0sRo3sHMSQIgKSQWYICHo+WYVgsGQLaWg8EIqn9T29J4uJV3fEEftwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/x61ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqaDw/8CMdx9HVdv85NY4CFsl6wpbkGykRsmbzfx44iL90m2g1MnYAk\r\np0BPn4dDJoI6y/nbzCxKtUpUQ72UdUwtA/IQIKyYNywlQFasf3rqreWCtcg7\r\n30qWDBHODWfwEqNVDdkUFH46P7lNANNcvhO6OWxaAqHan4UWKcmSj6dzl5I8\r\n3IYXmECaR+9108DbMpp4LFS4m/LsgJvTPkuvo5jdPu/zKAoONYK59uwiGwYb\r\nDMgejhOiOykiUFJvirqctspN0dEu+wPALEaTfW9wt97hq5FICObF4ey801xG\r\nOScqujv+RBFO8Isa09SDOP2WqY0H9dyA7u/p002VUA7dupn/SB0HNnLypYh5\r\nWDY2sPBTUVHUiN49JxCqvOwWzdu8PZ9Ge46l8ld9BFfpKwtjyx0m+dhoSOxZ\r\n9hfZ6zuu/Nwqv/R2k1WTlxXveHrsVQ6fDjNs5EIF4jebnpzmjJqpALGL7YCE\r\nFhA4vRYeQshPEHGpoyA2w6jGpAEvhP93i4LECbQa/Wp5J2UpI2G2tEL0C6BJ\r\n/b7bcTuFETk9wvvkiCxK5HO0hDAYq+wCcgoB4/cEZbrqKE9C3yktAYSBYqje\r\nbR9+9wQRAwUkGi02050rzPH0lLCf+KpADRN7HrBAWEoBAapmNzzWuy4SqwcT\r\nFLrnGHXyS2xJMR/SgXfRvVxS/Bl4dNNJqqU=\r\n=+UzU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d987c811d07004f7983166b092159ef1beba9b6a","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.8_1677663925364_0.5964218853819325","host":"s3://npm-registry-packages"}},"4.3.0-develop-3229d8-lephu9y9":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-3229d8-lephu9y9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-3229d8-lephu9y9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8c6c58419ac3ccf8bcd97c032bf5370fcb365fab","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-3229d8-lephu9y9.tgz","fileCount":159,"integrity":"sha512-tkULxkbS+8PPR5IfuZxQAc1aaJtYWrcxRyuk4o4mYUlbTtA/nf4QmVfFXbbstdc02+dAQULt5Ir2GxihUtGRzA==","signatures":[{"sig":"MEUCIEXWuaz0ak+pJiHJsQUZExB3gaysuN0TNEUQmHWH0CGyAiEA11BEL50zzFGsKkquW3O0LUMGA4+/lnIDF6a0niX6JGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/x8zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuMRAAgmdjBX6R+Ay863ZgfWkBMjGM6y5qpN3p7Z7ZESl0UpuPZdtW\r\nljPz90YWajBI0LGmH/SUKEkRdCVd5jU6HkaHwZUwHaiB/nTTkUohShf0+nQ3\r\nNJ6G8gDzG6+ZJFXFSh1yeFYFSlN5d1OolyvDAmWHWG9vVFYb4LL/nZdO2T/m\r\n/DxcYGGz65E7VNm1u2ClN/tIUvE4sR3dH9r3DR3mFwLFWfOA92STfYattegX\r\nrmSuZR71oqAbJkO6mfRLTalkdMWX3jTrfImOwsCRzksGRD87HelIreTHE540\r\nLhDO61fgTIUi5F5m1jrZPw6v2ASmLmmbU/m97k3DspGJvzDBmUfVVWcbK7T6\r\ngOShxCS2osQFVzGXoyAuhAqfb1vXPpFtO0BQSilhmwxsp9UQrDYQHQUuD9Bf\r\n01oWtMSPDXhTlrYMetbJZzjGFpyI6hE/NXLRkSj/1ZjJ2idG/WdlyBIY604k\r\ndeMA8Q4AYgNHOb01BhC+Wq3YWRro/1nN3n5gj3GkavrUmfrDUn6cRVwqo9U6\r\nNVJHbMLMyul4zP5RRxu3chwQhxQ2YNXAn1OrSNKDzeTN8B3f2OxjDCYB5893\r\nVXQoewZWzp8y11/Og82zjGz0yYa2OBSfBpcGjvp+HIUwZiYgn6RUqag8hdB4\r\nvF76f7ZcC/ExMBKmnThQ1b+6yBKbl2qfuE4=\r\n=jxRB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3229d801e05b4b11257b46a456c9227263786fbf","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-3229d8-lephu9y9_1677664051479_0.22959950440631505","host":"s3://npm-registry-packages"}},"4.3.0-feature-8b1d1b-lezqknzx":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-8b1d1b-lezqknzx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-8b1d1b-lezqknzx","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"19dfc439f381e4edfef457691bcb6f28755ec1a2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-8b1d1b-lezqknzx.tgz","fileCount":159,"integrity":"sha512-B5eoSwJT4B2V/zn8BmE5HX8eNiMkpY62aBt54yZ0l/X0TjWuH60pQf6tbcTTeHXRJ3V3MCxD55njPYbTXqN5ZQ==","signatures":[{"sig":"MEUCIA8/fDYQmUEm5z3EXluQ2TYDaBUtKdRRqmgUCB3LhkTtAiEAxJjikE9I8AwUvZ02tE0R3OqcqAr1m/+OFOjLVt5+qpY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCJJnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJaBAAj5uIGYni6SKXWgYY8CCodEh/xjo3bCYXjX+7IEt0oAsOyjyi\r\nZR76l6gC16XxWxOSl6fTCAB3EWptVJhbvB0au7x2xJbxJCldPHrLwAFF4kWQ\r\nnLitFc0GlsjbqW489ZMC+MvyZLnejoitNVF2QFu61WdmhPKNsswrUC2S227H\r\n9M8SR47dm/Xhe4uqqF8Ndrfzg4whfmwf0KUCwg5Ckxtnr5YewWXJB1XmASP/\r\nUNZHRsqnnYNPazWlAIubAad5KYGrzhl1zFP0JcT4ZRkAJeRXqNby+bg4k4kY\r\ngl2z9VHaZK6GUTWusoWYvgNXoBlMlTUMMaB57HsZEB2Hs4wIm9kuQ+PHw5cc\r\nfLKN1veSd1fRL6HEXY2WMi4ixvGPPAysW4Rr5ict4+VD5bxT3kHOlE5yw6Lo\r\nmS8aLz/92+jE2qZOwY46e9sHMrFWXmqtrXYQ/c/ZX/VuXMw3S/A42PVAsS8B\r\nSGjoA1S3vTzDLfoKkhm0k3+2F1/D2X6zkuHUaPAqv9zLn/j6aSzN2hJBLKQV\r\nUV6xgpTymSkQVoDaNL81mMNOZrLTztHDEKHiX8vqfeeATJs1+6FUnbrl+9aT\r\nUYIE/5u23J6sbm4Mg5GMr7Pg95pXaD4ZbMBL2PdIYRZpfp32zaX9hAdlDYM1\r\n+3gug3of9Nd5PY2X2UEFa0OGfBR3RFlwAZw=\r\n=eXhw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b1d1b6c614818cac77bce6c45dc91e2699dcea9","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-8b1d1b-lezqknzx_1678283367402_0.5437619747949123","host":"s3://npm-registry-packages"}},"4.3.0-feature-8b1d1b-lezqm09n":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-8b1d1b-lezqm09n","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-8b1d1b-lezqm09n","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"919fbc288c171ed80f2b0dbba1d7493942947399","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-8b1d1b-lezqm09n.tgz","fileCount":159,"integrity":"sha512-1+C41g7o1Ah6mCg+hVo4zXY0Zf+5AXXuXxmecn9YYzIKaFSKoGHVdNhzwez9eaqkfJOuHKLFqSrOXRY2PTuQMQ==","signatures":[{"sig":"MEUCIQDXEmaQ6dzuhctOipvzq2K57Vrlt5+0/Xmk0ZQLEwVf3wIgI3trUDKH0bQSSHESHM4diRPclLy7STmvHkIUYrPuLUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCJKmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpp7g//TAe6XvHgv2qjH5YId3m+BwPu74+qGF1pXPp7n1pCNbHoadkj\r\nm+K209A0CUxPR+9BeC+ZYp+CzRoMIQ/NDzvcLhqLcXNuvtDkYWbdRpjpIUOn\r\nVhhCzuiHTEBGOsa+L+aDq8ex9iHYD1K/WotCnOdyl79G2CMaEi4/2k80kjDn\r\nEZEAg24LNRrTD8WTsEQfrjQLIhLKgOxaJ14KeteTJCF3lwTsKRviYI0drxIx\r\njQG3LU3KJwMSUO37GjkPd45cnJaUI1M47zOcKzS7ALBXCgdnH/znuo8V3bRN\r\nOarAHRCCtIv/zXfD5+YBy4JcOTbPWtfdrHtXOupdtHlf+aOQuiOYP2E5NJaP\r\ngsIzEAp9+nPfLAODsvTOmmKc/UFHv+5Ypy7DDSlZ5Qk8bezY7LRtIxDLCekq\r\nNHBR3+gjFNP9qiWA29LOwGkJAIPe3VKDBz/raI91vKO9raibDLBKmUAv00oZ\r\nlX5WlweGOhg+iBqbb4yo2M/bSWcfrF+Z2HOcztTsCNUbIHGb1fK8L1+QDnwr\r\nk4EYnAgKJ7Xh07/hyRWe96X72ROUi14QLbuzfzis3g4TcKFUlvcYSXRM3lT6\r\nVwsAc6q2LMxBZtWY+VGpV+n4FEfNfSN4hIb0HCSJBGOQbyCwX+9J5QYDKuH+\r\nEYbZrsP5TQUxgRH2QI76hNYPIeB1CIccdNo=\r\n=6JKr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8b1d1b6c614818cac77bce6c45dc91e2699dcea9","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-8b1d1b-lezqm09n_1678283429812_0.2112274380269723","host":"s3://npm-registry-packages"}},"4.3.0-feature-612cb7-lezrq4kw":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-612cb7-lezrq4kw","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-612cb7-lezrq4kw","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7b251b5e911d047ff5388e22ac7736836c2f62a5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-612cb7-lezrq4kw.tgz","fileCount":164,"integrity":"sha512-e7V3oBqkg5mVoOvGYFY6zaN5YmDnWVbEVYUQuyOuVVw4hWy1j4LYFjpAEOduvBVpsbJ35SZHDMIOLxuJFYlDOQ==","signatures":[{"sig":"MEUCID2JUyqAF+1IGTP2na8DWrSRBTiSEWRQXrl161j4zjWMAiEAhIEr52xhpitgtbH5DzsZ43Dbdd6+cKuVtgJpHdJKmJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":573023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCJn7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCtw/8D5rs8qoNlL0i7thVQUwffO1n8/1ZUgVAfk7kACEvgdvekI7o\r\nfqAYI2vtu4QE+s2rI2IoJ+W00vTiuAft65bUGS6HMrk4zcC15hOHGqS40gsj\r\nwz7RL3hwj6x+kPFAHZYEuRkr2DxTuFL/X0w7QhpnFLGZg7+1p36GyVVFZImu\r\ne1QqToaoW1GoERtEeZLl9Bjvs1/n78Kh5G3PyYWVAUqN0ygpxarr7cpuWqX4\r\neoAtdsSJEgp4XmJmWwnF6glFQXaKbwMn7nvEWwBMg4kstxYxwUXBuVcHWglT\r\naJeD24myR769Y5+t9LT2K63lCBwoKFBExDPPqXtTn5ZBEmvjN/z7FHEG71HK\r\nLP+P8d5f+zu26byffj3a8Vf2ry906VfxpMFbgFqjVT+EfOULwvhup4FVyhxR\r\nD/Am3Gn7gJc4h/ZzeuWyvB+xtwwjA1h73ksrfwBi/EfR9RAs4XtqqkbQBuN8\r\n1XXqVM5k5c9s2Hppe2ZmMjXtQ9kWXogd2owhonfshLJJfRpuYe9GeULqfmcu\r\nSS9FLIyz89RtugupK/naQ2lDq8OIsW6ZRiFJZ2xmPwzkH01SNfUEVTWvNkLz\r\n9OidWUEyrNT5qIjGf6KbQexMFo7B/fGvY0xD+3gTBGnl6YBzIIUKrGtoqquM\r\n7clIoDiJ4rM6CYO08SX0yMXlg7guMAlQuMQ=\r\n=8IgK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"612cb782012deb12f5598879212b99187e740d6c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-feature-695a0c-lezq00gf"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-612cb7-lezrq4kw_1678285307556_0.9497042672663634","host":"s3://npm-registry-packages"}},"4.3.0-feature-d97b7e-lf0u69cu":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-d97b7e-lf0u69cu","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-d97b7e-lf0u69cu","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dc789642a3ee7e2fa1d405ef6424ba540c54b35a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-d97b7e-lf0u69cu.tgz","fileCount":164,"integrity":"sha512-9DBoO2VmCXD5pbcUOg18+YL7QozzwTJN6Wu1x0+tbbCYMZONP7OADa/FYwcUb7JBe9igdOiuG5KBFSYz3EG+yA==","signatures":[{"sig":"MEUCIAkhyoCzW/F7T/ZJecBXpiOg+MrdFZktJdogJUR+wwi5AiEAwrXUr/DXAKYyKdhl+97opO7hNBj2orBTs6pXaBK1f+4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":573245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCZY4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2oA//Rjhmma10I0iF0twnJp8A5ZkDAR+zQv83YhwtK2+VmHXcgXhD\r\nIJQchX12iGwfZ7KGL/e8R46X9nKY7Fc08Ucl2yET/bQbUgTC8EYneMClpmOK\r\n7wtkQwvlJwHtMtIJEToGr3rscjI/FRp3Q22rSeyVyet0N1EgX2L/rBlj3DcW\r\n0SplAbohCb+0MxN734962oSWbn3UmE9jlpp9w28QHgnXVLURPT4KLzpgiALs\r\nYrtCXM/jzEGSssHhk5Q1owIwkH/vd/euC42a5KRggSTYLu8ITpU51+GLSd9H\r\nbw+1yAxcbA40CM3qHjW/vFIeNMl0AlI2tatpchJyXy9elANYpmNzphmI+P5D\r\nFlRx6c1MI09ZdexNrJs4r0GySJ8CgYh3ZbmbLNIauM0X7E4uF0XOWwqnIF93\r\n4IQgpQe/U5hECiRtdg0E5qJcG30vgoyYCjbZ93KcZT+oNhQ9RxQtSWOM1zTo\r\nkdXfKkX2ZtY7pcwjza2k6rUxgMl2MlZsjDYyAuj56EZKls5oJR//yt1XMfHq\r\nwVoAaUcApKEYdY1REwtToTNohgW/0UVjoaEOspIN4Vs+Fwkw4gduDKh1+B4T\r\npYdXkzjCwByYMfyWJc/2s1ErgiK5dsNupdz1kxHlMejGdET3svoRj6rnH2yA\r\n9JgYmj9KR6C5bETTyPR1+pMYX5KMEqOAdng=\r\n=E7GY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"d97b7e28e6b1352cfd954ab05b16d68dc7cfd6ad","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-feature-695a0c-lezq00gf"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-d97b7e-lf0u69cu_1678349880628_0.4101334978708777","host":"s3://npm-registry-packages"}},"4.3.0-develop-418ccc-lf0vrc7a":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-418ccc-lf0vrc7a","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-418ccc-lf0vrc7a","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"64d601e47fd7df0f26835385147502af2cd1fd1c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-418ccc-lf0vrc7a.tgz","fileCount":159,"integrity":"sha512-IvVajb24VBAACZBi8hsovqNMq56NwzFhopVflLJcVT3M4Kb387QfK8pEgFA1QkB+VcsIndl+lAOfXHs+MNtbNQ==","signatures":[{"sig":"MEUCICXMM2hM5TImMKiiycUPMvJPttB9GIsaf6dUAD2RWEcCAiEA5Iycskh0PtrinugivyX3E9lpH9gYYQOJe6FhjVI6pLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCaCfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp04BAAoT3x8gPU5mcC1oB1XLf2pPCPmhsiz6FWA5o3kUkbznxdLNfZ\r\nPrnhgEjRbUS+OrujCXdNk/SA5au5dIyQiH84DHfYWZ9KHMChiaL2Ymx21VKv\r\nZ6L7YxB1++ZbOWpWT3IDjbb4nsZUhPWYATYuIqFFJqRfQRLdeiX7IKvC3fDG\r\nRl/slg/lVC9s85Wi+3PVuMHpp/XDZe+Rk+LmXukhy7Xa4DF8VTFiO40maJiJ\r\n6eANVx1q3CSx0SWycKz+GzzQAxDinH5i6WBRI61YcTuL8dv1OvAw1nkcwqsS\r\nrG/uMlja5zcWiFvM6T1EwDv2a/yOcpK+wZp3Kb71De+c3PpG9Vcy+rIp4a9t\r\nKcumKMLsurO6f22BUVLrxuloxQPAb7TYFHygMBWS1ez9wusUNY3HNhiuA3lY\r\n2Ce0bEHDlIa0hK2rvp9u+6Q3k2E+dzrGjHeedFj1ZTV3F0rHAQZaQ3+GBQdP\r\n7VJwsHB87+epno0lhfdfHu0WXRwPUu9JiLWMWBryECPbO3OG2G+gjn9K0XiA\r\nmeuSyREhtW4tgW0jrXmJ5nuGZgM9sM7mopq/WJK1hdT93RXT96Cy4GSFCTGr\r\nB0GM7kDv6UXqmjskbFh9VltC4Gst+bvwwI711kKaxtc2oy1ecOCem29k31vQ\r\nF1R2h4vCKeXCtczDjTDIfi/GN9MjrjNdmFk=\r\n=EUe/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"418ccc249a81f5d7e8fb65444a113908d4c9e714","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-418ccc-lf0vrc7a_1678352542959_0.7030001992925632","host":"s3://npm-registry-packages"}},"4.3.0-feature-aea29a-lf0y8stv":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-aea29a-lf0y8stv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-aea29a-lf0y8stv","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f66ccbb29a60ef1fd8a9b679d5325796febb883f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-aea29a-lf0y8stv.tgz","fileCount":164,"integrity":"sha512-6LsWdjI6fJ7L6eVKc0RKkPYUr+DNZJ0SkWX0Dmtdz1LNM/BKGfztmTaNPHCWd3PmX/kmHckyRj4b8H0CqixLEg==","signatures":[{"sig":"MEYCIQC2wLERsMFlgUDplbUeuXiE+XbGpNBVnWysJ45+rL9cYgIhANq9wOskTv5wfFe0egupbBR6OP2g3c43+yXjmFmsPTYD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":573577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCbDxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMqQ/9HbhdbD9XQ9qFS7dj2uyGo4CSTiGC8uREa17amRuwiXH148Qt\r\nGdbLP7XBsbp+IN2z7+P/Mff/aH+eTyQXa7ralpoAUSvXbIKuYqXrmFnrkNfx\r\n3v0l85oOiB8YygyzMdI6XxSr958AUi89bWSJ6PqaBsgH4V5Hi9TgfYE3I83H\r\njx0KtYHtglPJ8DRMuXEc9lnsRjCIJ0Dv+w7oNVnr3b+/JMEduzT/LvxGLU56\r\neaHEgrjNU0zFLZ9S91FTBeK3SUc2RYBBVmakZyxOn+qB5r6k87+yqOj5b9Jm\r\nKU2Tw04pT0C5pmwWQYi190hIANcsFiFI5JzCH9f5xCEdL3LxOqeNi4OksW+M\r\nAnHV5flIJzoZdaPD/9nErDxIK4w0NiIf/0jbdZi3ckEX6PdN3ZiFFTm8gXc9\r\nnjRqY5jhhnw6p+QJ1vHEHWzv2fS+LqQcTuYGY5wu/VIp4UbDxBKnGTeKWI7I\r\ni5aEIHD2q3kqPET+UBHrthsJMbXe1nVwWQ/SaKvmx8qOcq9ujchLwGRBelUm\r\nweUccHNetyyYARQaXku+9i9Dc/L/Iskqrc0KqWGAI4Cbv9qQ2QJ5fPeE2qF8\r\nrpik8Adczk3cm/uEBlRRaXYDIDEtjADJqkIwxlv0MURZC018G1hgd+400HhQ\r\nokmy9mkGxGRAt40t95O6rhJmhSGGI6ZTVBc=\r\n=I78/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"aea29ae7bc8befbd175dd2c2a0eb24757a2236a1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-feature-695a0c-lezq00gf"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-aea29a-lf0y8stv_1678356721352_0.4049966923863375","host":"s3://npm-registry-packages"}},"4.3.0-alpha.9":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.9","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1f0855db97238db7b36f0ec2437fb9db8a9dd723","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.9.tgz","fileCount":159,"integrity":"sha512-BRc193F3dTtaKo/QTRtWoIOET001lyAXsSYz70SJQNmVoIj6/jXrHA3Yhv+eNFIjlrT8P0wRM4p6/ya3okpIsw==","signatures":[{"sig":"MEUCIQCn6MijLIs9yn90fqaIBMbboNL+cG22lOqa2ItW7W0KaQIgbVmgIvqk6Yaj8LSLR6yQ2z72fDCkrOnDZtMskeihcPE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCb3cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPnA//VrhjJu6qoYR5/ZKPxZXj38vPVN4cq1lqTMy67Kwo18OP14/l\r\nk7qXB7cDCLy6JL8zVU6Xw1XepqXRGyWkjJouxJB8dOKM+5ZzxIIYAYSrDAih\r\nMjaQd6ufXPAwOLDivdKjIuZoxmMD015Y5nCb7iiYGPXKqQDaeIxmGArIstUN\r\nE4aKhHEgxJd2c/4za6qF8tHRi/+SPz1T6vyg6b3GeeT6d0KzYeMZPgOeVYS4\r\nN1FtzQQbMdXIoGPPGqFgpN7Yr3Xm9Fpw5gvWft9N1DzcmDO65IR1Anp/Vm6v\r\nh9L11IvgK7QUD7dfudIflpJbsMb1VXGxSQuvZAk+RiKOQysYzXP38juEI00H\r\nI1xTKV8Y96drDRAPhJtDwJnDKXQ1ISh6JmMYO3oxjmNkpDDSvYelHs3tZFwS\r\nm96SzmpUA/XIWbmjGvcdbXxM8nFHwn++vIHf7KXWsSyVrGmLhNLFORRAOsAH\r\nnL9EEXZOayrBf/uhXGbUNMbkWH/LHTkgYxKYkHhrhDoG5gWxpR43RdStZd/N\r\ndGXbxG3zR8K/zvYm9El2ffZW8rxHhcFv7B23ib5ZGg6Fa3AM5KAoGO47TEgN\r\nC5z4XDTpjxudznwM+NxzFkl3gO8gpiYvFALYHXJ3r+jgbTN4bapG/4tIbBBQ\r\nApKgTLch2N4A05HhxgWGnGZ14imleb8yD78=\r\n=UbpL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"10e8546ef947e1755c938d6c3b64da14b24a6e25","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.9_1678360028035_0.17824473077963532","host":"s3://npm-registry-packages"}},"4.3.0-develop-c5da88-lf10lsb2":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-c5da88-lf10lsb2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-c5da88-lf10lsb2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"075d4f8f534df0e1674d9e9088a2d810801b5acd","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-c5da88-lf10lsb2.tgz","fileCount":159,"integrity":"sha512-LIybwMx+Hjtd1YhzQHT2t4iPfubZXFkDbYpob4/l8lhMihxarPTYXRptZSpx2sX5xWoktVjjD0nWNlt8QZLwWQ==","signatures":[{"sig":"MEUCIGYqMrlvFxoxkqCtiUwH99i+FH7UwXnoz5hy8tlx7Ty2AiEAx+EXjPRJ+j+pGIxFqzuqFz9Vs5RZiPdGpFH7iFa10CM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":538772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCcBvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCNxAAmTQdWhmH4psOrpd77aRepD2vGYZCNAu0wNS3EJGD3tp8gPbw\r\n1fyDIhiLbm7+ziBweTqeWd+xD19LyYx1AlUzdlm2rl4/eWfzH/MDh28Ih+9b\r\nSiI7Y+KdGX5acJDOFrt5yXALxLbv/SW14Q1tLcoxF+0rWTbK92biggn/qyAu\r\nf/a5UUmlJ8fGGU925YeP3pg8IDU2/hc8i8FFBNoGH1cNoC8y9MYAzSK0K/zw\r\nPfXcPf0Y0i5GJ3VRL0ZsyMFivy85pZhc3nxWsUAZFyi8N8uRfyUlfDen2/t1\r\nLD5FZXPfU8MjjFEQl8LCGPqkynIM2L5jpzIA9yb22Jzz9e6YtJV7Cuy/UT0Y\r\nOT4P2dYyD1tpLXtRNRjHjbbU+ob4e+GLudHpXywHxnzoEKfd2HHDwKVLUvZP\r\ng3iPHVtVVpqfaKc+YPE51PUTkDHpfyahD8QEnRQ87l+JuPbTrfwIjEx9qvS8\r\nluqifQ4yKHQ7dhMmow7efFuyuQs2C1KXaB5jl9tjMpUgE/nQvEsSiUCxs9pM\r\nC5fg3K4PgiJ/pIjOzXRksyTUMfGiUCBOk4AbUZWqOKSU+Ox4jr18dW4xs0et\r\nGyGa9C4VsTZRG621gZUO8Y3lGxJQrPoyKW/sZqZ5zU5AzbBBcj4FDLPcUO8q\r\nJqnTlzUVF0zsk3xCBq2FYPdOIU6jsb6oysw=\r\n=kClR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"c5da8847389e4d301a07bfb9794522fc7aabdf07","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-c5da88-lf10lsb2_1678360686896_0.0021223329675150726","host":"s3://npm-registry-packages"}},"4.3.0-feature-ff2066-lf6xpfmp":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-ff2066-lf6xpfmp","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-ff2066-lf6xpfmp","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"83f106c844526e847b1776bb0d55962d44d9eb04","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-ff2066-lf6xpfmp.tgz","fileCount":164,"integrity":"sha512-fRp6TDnwUDKXXyXa6U+qcK4gS95FXE553NAftyChzQxwpEHrykvaAUx702OdL9AX0y1wl0ukJ3NByxzYi9cgtQ==","signatures":[{"sig":"MEUCIExIgSbi+1IgNLDkKRkmuW+jn1vY8Qtvx7BMI3DW4Z1KAiEAj6tH0519q62mGsu7zUpBWVokA8Cg2hwV47OC8tgfFo0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":577230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDzaTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYVg/+NsQBaf28DyohxVAm5iell4jREDWIJKBmSPhTPJF5cE+hiOnO\r\nZ7Ev+UFYHJkahxRU0aBiw3lvn3W0SMWodQ1aClMhY3xkqQvVQnTWqZChxfOB\r\n/aHUFPo2FaYx7f5NDXuGL6M5OZk6VRYO4tczc//S4XPKi8HVW0IL+ZIFVHKD\r\n/OUvvkBB95kjsPl6abDAP/nvlAwyvMYG23Q/HjBGJR2srhDXUwmcQ5rMiZo+\r\neAhUNp/qLPzmNGTkNZzd/9Oe4R8Dhdtt26jE2TUAJ0u6XFlwG/yqltnfcaIB\r\nAbALS9vJEMIBvCaTu2TsXebkCBsm+e0JjkN8D/BEyt9c/KdFMwitsG8LVWo0\r\nP2FUP0FWVwYV2j8yAoDR29DyAi+gzvZrF7oK1zTp3pp7oc97GTyTAXlW9HDh\r\nZJ6oIdBYJv/SY8SYh91cnYmbNgt2jKNWLw7ko4woKVM2mnXP/AbuU/3esmYi\r\n/jOS+XhZ+gwkYG9TBhhhRSNgbljDjWqKaRLBJ4sGQYMmMPmWVu4Y1U3v2bgf\r\nnrOaw+zkhRdbbL8+LKp9mzdFXfWoEO/U32w6ONNjPrWc/M/fAq6f0SI/bYKE\r\nS4FIC4WinOVZ9D8znuYQ0phCIVBDECWIOeeVZLLaS3uXnD4bPn/LMMbcdAEN\r\nymkemDOGCA0JPqLeipGEMwDqcWEr3PbRaps=\r\n=aD+E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ff2066296b1b559d75089958caf5a6cf46c7e39e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-feature-96a39a-lf6lp1mo"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-ff2066-lf6xpfmp_1678718611382_0.10326788168162881","host":"s3://npm-registry-packages"}},"4.2.7-hotfix-292cd6-lf8ij74h":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.7-hotfix-292cd6-lf8ij74h","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.7-hotfix-292cd6-lf8ij74h","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"27282ee198f417dc17fa2f6ef28139eee2e85da4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.7-hotfix-292cd6-lf8ij74h.tgz","fileCount":159,"integrity":"sha512-ZTrW9KLt0D43sCLWp4hcJuG/nCG3ApRyCMdWnImvFeQAuGPdj2lF1HQ8HeE4lD2h8dfta3hJZ88Mvxh5j4Bzug==","signatures":[{"sig":"MEYCIQDsncqHbVxE3DZd21z8g63ZeCsaNPcnP1a8gfZ0BkZLjwIhAIZLfFxpSk0t8bIDoiXqPfNHqBY8d8f28ffKTFi4cRtq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEKtvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKrg/+O0wNb9lRMrAihK63CcOOJpLAoI2/TjmQzKJzkNY1+Vc7SPKc\r\nyZ81+CNDMWCKh/+WJsZhGBVn+eRwlxoVGtWiyPS+c3VYWNsOUDd7eMKGbYEb\r\niSZAzp5bwzVVmIvoG/YxanpQUHUkc3O6oPXn1jvHZD/ewcJSFSDeiLywZ6Ip\r\nMCOTgrzYeB+4G97/teJv9G5f4QAIfoisXJUpSYdLr7NgCi9yVVJmayKZcNVs\r\nhAd4RMalJXzqP+6YCjCzdAckAHP903LfkBoeruu4F2X02PSdWmu4YpNHk/xd\r\nN85GHURhplFaSJ5JikmckMxF5GU9wnPmwtWuFYWMZ7LOIfRFxEdBLIHJaB5N\r\nB/UVyDFfGEx1KctN+rHJMsXNehYk6nSgh/g52gKVXPeGvr20x4u7E/5FhxzG\r\nBVqGNhUoZaaXzER1/lGvSfr+CPzSKjfYPKtJIWb6pDFV6av7mken+KO+mgxu\r\n/aLJV0k3SucVmRoGl/XXHwJns37P/hxdxl1dp1WXX2A63CSDQE8x1F09yzml\r\nUh1pNc/qr0MTtBIM7D97PCkLSoU00BOqgQ8paBdQ7kuG8uM6Ay0T2Na6FowO\r\nKVoAgGZC6qoCypw1Rf5a6kXCMLnWAJ1mGrmLH8EDRZrwWLlG1XsGxmqoi1Cl\r\nEAMygZzhq8GpnzDdSt04v/g5VSXarOjMrn0=\r\n=XGND\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"292cd645fb03e45cb47b33beb2673a972c2e0dfc","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~refactor_subprocess_persistence"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.7-hotfix-292cd6-lf8ij74h_1678814063793_0.9923000599971266","host":"s3://npm-registry-packages"}},"4.2.7-hotfix-e13805-lf9fits0":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.7-hotfix-e13805-lf9fits0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.7-hotfix-e13805-lf9fits0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a2438d18db816044d42ce9983af3662573846da1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.7-hotfix-e13805-lf9fits0.tgz","fileCount":159,"integrity":"sha512-6TrfW9+kUEviJss4nPTu/MDBPguduAPA6ZwpdFfoVKujT+tLX5qpF9QSggYvFJhN7dK0tONgZwwVW8rsbqKFrw==","signatures":[{"sig":"MEUCIGaTJWptkY01Nzuku+Uy//7x2VY+igIyF8oyoSebfSfCAiEAttcHZP5nWV1u07Wv7drueay3bnr176vPZwCq7WZ1bm8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEYPbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoG+RAAgWfi7gFYUhRTQEL3QTnfghQtaqrq8/HuBkjkhtNo1XvjqxI1\r\nLYKYgxYnvosAqGOtkyR3DeHlqbyJTr5tBYb41yziPoLBDuJA0Xib/5K/4ni2\r\n4ge79j89rbnK9gNPpSaRBCTceEi1glbPYRZRCvDGD3F6WUK0d9wgL+TanrqS\r\nsp8DWu363ZXr8aOCp4z6pWrUyFx+EOxfOMsmL8gkXjK+sEmTwz6IhIQr1BFq\r\nqLg+WQzsmTFZ5EON6/D2IqJE3FfzJM4AjRf5ol6cxmBQDpxgjnSN5t3mDMpn\r\n5nROTdo80REpe9VZumqbEM62D61z6u79Se5tzZ3gtyRR5edK/tZJaGncYj8N\r\nt4TjI+LfbUwjevwZg1gHpPtSz/ZQPdR1QEctxFyyy2ucE1DvAq8GMI5pc+pB\r\nwKPPHKUL/nZcE83QWDSwiE2Qqvn9iDKQoFGx9VswKCQ2uSqum6CPKoToYni7\r\ntcgyX/imJ9iY4lyJnh855U9V1R0AfYQdXHnH3MZlaZAjY/M2c7GNn85im2df\r\nDZ+xWQjvYOBv3gxR++VOLZ0fH/uWOh50eMpsgxRAbT5hVrg8G+2DqIa1hMbY\r\n1T0kyBcwsR+DVFRvbl1bMYQIPXJBePLrngoH5559oGw+S+MEwouLsjA/i8UA\r\nzLir/2edgpqEPRmVJJm7a2Jpy3d/92e+9kk=\r\n=LuPJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e1380561721aea382266982bdc8ff04bb05691e0","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"hotfix~refactor_subprocess_persistence"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.7-hotfix-e13805-lf9fits0_1678869467100_0.24894309345987242","host":"s3://npm-registry-packages"}},"4.2.7-hotfix-b6c504-lfaxdg5z":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.7-hotfix-b6c504-lfaxdg5z","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.7-hotfix-b6c504-lfaxdg5z","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"35a04673ce1dc0622a5bd2f1634b1f1b8685596f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.7-hotfix-b6c504-lfaxdg5z.tgz","fileCount":159,"integrity":"sha512-4BYxoQJvTjm6WVTZyBCjKTQzh6I5QSMzUobOsoEd0pyNPyfPCP7xlKjbdneHkRbSvyGDt1S9Kw+6B1VeUmR3Hg==","signatures":[{"sig":"MEUCIFnzaM2sFDOfreA7wBvV6BVA3tKSm9sDBLrwtrw7htkKAiEA5pkSkjEcUCUzC9Y+pSCu5YJgv5dq+h+L9/ah5iwCnqo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEuUvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCxw//axSqX/Ao0AYG9XYhA8eIs8tMSewds++JOEwsqcE6/4BAP+vQ\r\nnfCHK1nvvcC1431/kaJa+TxK4bCwbfh46mX6zdxzDLSaTX7V5QsVb0IXE7a1\r\n/ypKaLHFyUPL3O3ST3zWSeavrHOSM/OSNLiybP3v9CiWDBPEDW84PFFw21HN\r\nbJx738GflaSKQyuvbzxUTwRoeB74itWM5hh3aXNgGSeALkTm9sklDpNisZVe\r\nKRireswHzPZW7Zk5n15BrlK7hGFgRzpbwklJ6DSaQ8plggNbKUtpDkLrR5U7\r\nehy1ZDd8pXuD4Jm1UHnUssVe8BBJokPcCpLEN1wLCTL6NPNSn8/ul1hxnBeU\r\n04kAehT881NUtuzcl2pR3ftJcwsBvAAhWt5mGRNk6Y7yGE5oDHdQCiFChoqv\r\n66ZeZrWCJokEB1BOwut38TsKMtj0suCOuCrhA2tvYGPAuALjiUqrmO8ApLdd\r\n+mJ1AhIYLILc/STK+9FeESYIfNUfT3IiErWNrlXYy7LVwepuGAVGqR1jeOZe\r\nDnYBhafKREYeqYdXGw3R5fjQO6TTzZxq4nn2aukSP8aZrEGsjjC24JU9G+BO\r\neb29Ij4TWv2BsDdb3+8kCCl7ru6dEruCUbduK80/WAnqDQdJFhk0Yo+lkZHy\r\nwCroThQ2Fr4N1Ebpuh3E24SOZcgG8Y8+or8=\r\n=TRQE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"b6c5043207def3b001e6fa9b408495498ef20121","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.7-hotfix-b6c504-lfaxdg5z_1678959919060_0.7856812212864603","host":"s3://npm-registry-packages"}},"4.2.7":{"name":"@atlas-engine/atlas_engine_client","version":"4.2.7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.2.7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"24abc4d6993b96bdbe733ee58525d6d0ec5e57ef","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.2.7.tgz","fileCount":159,"integrity":"sha512-uc8s522bvuIKfginN4eu7NPC9U/Y4GTNcxws37SWgsC28l9tV0NaQB7Bg7fcN+CCu+mCBaiF2ldwkJHJgCNg3g==","signatures":[{"sig":"MEUCIQCkxUTFWNrrwFv6mYdz58hUb4PZ4OojPkukb0is/10CBQIgCZ6vqqFareO11ejdRTWuv4f7xxHcuvf7/rqmbXcUgGQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEuVsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxxQ//ZE5DuOr+wQLTT/Zo3kbVu7ebSf+uPCrZX/o75TPJTPd/T3De\r\nWrKMEDkgZiOiuK335q+UQp3M3uiW/TJ9F4Y8zGwgY7tUKxwQ49qCMGb3bTdQ\r\n/WIutCEKi/rsO0mFJB26nfgaBG1jyTC6IFQsQq7rLOnF8SEmU7ThpFwfdGjI\r\n14l4t594WJAxNDj2cmo7oHuEdytMCJs/lQwkPutjZIYvPFvgDPQhFH1zjN99\r\n9mK7xpPRWR/Bl+Dcuy+JuiI0b8EpHMQ3vOi/rAJjU3TFx2NFloSB+gCZEMYG\r\ntZP0RiCeDBMwHKuLLeFBdGP8wnllM5Zc+jeNoCv8qkOGR61mHk2Y35QjaKMy\r\n0/GVAYaOz2eoe7USa/uNZ7304ldLMgGvZpPCKmz6gOP4o6JYiGu3qPFFo29p\r\nbM+e4RDIyZO+uD7+XcFMGAgm0SlMJpUaQ08T6+HiKXjsfK2rKfUX8IDWSFDq\r\nuLPg204SHmRUr2nQ+v3NuonwlcLsxJW2QFx1tV7yDqqN/tGIPQ/Z8mH+2x9s\r\nEYlWuwjmhFSJAZ45FlDozyI83YTPrAcl9dz+n/QhSLHnz+gHwvPK7PGjKVFr\r\nXjM7UAJvOMiz3GJP3P7Fwyg6bCTgV24Zuf98h/MstF/z6WlLtpT2Yce9Zc//\r\n0MJPAN6N73tNDW27s/WKS75abXkdiWoBmoI=\r\n=idMV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","gitHead":"246f0e451b9ef7ec1196f849dac6e88fd7b15ddb","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.2.6"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.2.7_1678959980089_0.4724398080938008","host":"s3://npm-registry-packages"}},"4.3.0-develop-ef8745-lfaxiai6":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-ef8745-lfaxiai6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-ef8745-lfaxiai6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f900f2f237db1eda81e7fe0177f61cdc57420810","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-ef8745-lfaxiai6.tgz","fileCount":159,"integrity":"sha512-QY56BOU0dGXcVb4LwJ4OANzl1ewCF+5La6kWw78NfliIuXXn1iLYOLBGTs/BQmIG25vm+mp/VdAuC3mVOytjVQ==","signatures":[{"sig":"MEYCIQCy9TWhJ3a7TutOz3jrExzmpSc5MM9mWyCSygXNbtpJCQIhAN0khBje4/tcIvLt+T2jUqvXRQncNxEgjaiHtcz9Ymg4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEuYQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojVA//c7+maMj5zrQBi0LCrLbHWBHyddeQX879PJ0nXhScMXEMSF2V\r\nVQLvkW4GT1KuX0GYQq2T/oJDxFqfrgjQCUayKnEoHLGGPZisMjvOMIZAS6nH\r\n2AYQH9lG1JCywDfwhnQ/QqiXLEqHparcP5WNjS353r4CnYGQHXUfpT4B9r4V\r\ndulApdftE0osxg0FTiMmQcdw6G2fR0BMuJ9aejkh0xlbZFVSVQz1tuqJSrJi\r\nT0D4Ds2pPhuQ8ts9ahjYCWw5oUGCraKm2fP4TxA0kMmTZCuxJoOdNGjTFv+3\r\nGqVaR0XY7lCrFdduU4dC+0f0pjWk1vuz22klgL2FalGo087VmBsUs2P+I4VU\r\nRP7BoUp5Beoe6ouNlNiiQhLWXieMGTR1j5WpzUcvWqEzfq1RsgoLB3TxN/0F\r\nY8LmkYpZD4pW78MPbkf/Mp5FZXAfRiLhZ6wHfTCvjvnMiRTcsgJ+dTErJSV2\r\nMHnZ5EK3gFkXLLZ2PZ0xgOQjjWiXgW4F0nJRoj3afAnTJnXVWb9Ia3kgSOxT\r\n17sjhdIQiDQ/r7VCL2XpBOxsjeIjFYBZBy2s8AvCrUhx2R1ocg5q5Ph36qL4\r\n6JdqExdV5NahvGBSNuM3UoZ5HHPK2te4ClEUxaYKmoRZ61N34q8On09nGph6\r\nv5DM4tX4W7Dd3Cym5MzQsIjgq+hn36yoRoU=\r\n=V+6t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ef87456ee20da728ecd5046239e6ebac5162b6cc","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-ef8745-lfaxiai6_1678960144166_0.4925491941768927","host":"s3://npm-registry-packages"}},"4.3.0-alpha.10":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.10","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.10","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"d2d663327b8c006106689e7f528be1750bc557d3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.10.tgz","fileCount":159,"integrity":"sha512-HTS2vpK3iyDOYSgRPxpoJpH4IlyAfjCYi9aKwA6AhvPU4A68GXV2+H6oHDWmir7A6LgAlfyfBywtG+Xzt0EnyQ==","signatures":[{"sig":"MEQCIEoBy42g2yQ5wk3cJObbKwkm6N7CEbGy3Adi2N4k6bc9AiB3dDDnM/GHcN0OQFWMjGzSkEE5zmdh8/FN0PfYsi6RHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEuYjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0fA/+KhDeKONjdtSyxM2cKtyq5xxl+HGt+NXa0qBlNLeDE4FQqrdL\r\nIQ9+6Ih+XdYzZGRwEplmcp1sfyU3s4R7TjJNMqEB1U4fu/CNCrWvQyOwGmPa\r\n8tiMUQ0RsyAbKrwWa2n72FygXo/n+ef/2A0Ond9pyr6/CZha5MPlN0fIwZF6\r\nfMJehARCX8QL1CjpbV98+1HMmCrwHu5G8CzVMDHWGloNxic3cAtWBTVd336F\r\nsNgN5xAmZnrBFrgR4La7a5AN0Kuv6z0PXoy87yRCropxeGIUQueoWrY62Lne\r\nVnOGtNVS8UaC66BLdRsEPJfdaArUGCXkf7w9cpFHh964uf7T/BsxD4HvnVLN\r\nekQN5oB4RuucxkKAhOyYJkiJ9HNb9ocqtpn9yM3gYMQ1M35crmBW81UhNVUl\r\na7nNIrNgbJoq+JmU3pDUa53VfzTaLKNtzicZfb1L2yNVZU8PEZTdeJHrtZ86\r\n36aeY5qGl1RJyulLPnLVMHVpy6TUfQsgu3gIAifPR+GCZXQx/ICmcezNSJ7j\r\n6hrj9SuyASuE9tIbb3dPNSlyzyQ+f2uBR10oNlweYpZVfdK7nCpMhQLb+n1+\r\nBzJQunkAs9HG/0UZO6PTm62lLNijl6PomIGvTYFy3gXJTcJZlWiRq/AHvrx+\r\nuRc2bhUbN7RJgQkwWzqSCWUm83PkHu5s1t0=\r\n=P1G2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f338d36b9b9cc55a1ae00cde730eb7d072d67899","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.10_1678960163368_0.49575002592506956","host":"s3://npm-registry-packages"}},"4.3.0-feature-3aa9d1-lfcku1x4":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-3aa9d1-lfcku1x4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-3aa9d1-lfcku1x4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"048feb1cebbc6c140bdce3d6e0a3ec9380ec0e8f","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-3aa9d1-lfcku1x4.tgz","fileCount":159,"integrity":"sha512-V0Um8xie0hZ8yse+WZ3tfvH2WiIf5vBVu/Cy9ik34x1LKllHK22e9RxM3YQiwsFdwdvs4qV00GAC5DXctfr6oA==","signatures":[{"sig":"MEQCIDpZ35aU7JvJLWcF98VtThdJn8iQkE+3K+pn75X4irq2AiAWT/ftyVkksQzLmnw8vP230OddGs5/x6ZxF/LrYYZugw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFGtQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxAg/+JnARhDZ9DmGYLoKbtAXVFxScqILXRLmtZDGD3Nr4jueR1BM6\r\nA9rqsPdAJInYDz2/UBhQxU2cTqMdlNhaYJje36daECERr+ofkir+tlI8O1ol\r\nns5asxIkzfELR7ri6cTVhbbw9wseVtfsZ8vmC9F1i8Rh/m6ph2xia6PdXmNk\r\nKrRLCf9WlUsyzkKOaxBQ6AaJLIHn4LV6m5lsMG3aOoLmjtiQkqIJjCyh2J8s\r\nfeFe2IxUdQwy5UDbIVRdP1XJjzLZe6SkHqHcjRwgt70o6YFu3j1Sv3Bc1e+7\r\n5DgjkwbgOQSUGCXwXRskg8+RWX+yCDQgoSqzxUFbuVEapJYROx0x5j0acEU6\r\n2MVi/mCxpSAwbjskfDsJmAcCLcQ+I1Q4i/VdByuKxPUp3YsBy7lXucB8R1Ok\r\nPMx4gSjkk8lTOnxahWIxVeyGre9fwE+H/Z08m68mu3M9/Piupt3kV6QNUYak\r\ndpjYrYIOVNOQDbE4FkaeTSat4NUoyAQaHsy6oVk5j3zUfBP9Nk5aXXdCRjv8\r\nmMt+AHC6iL/eZ80an6b5H/OHu580t93HRtVMraQkTJEKbiq/JovbHqJdBqOn\r\nKNM2/Uw8ZhDzsmCndhA5QFn8T1poDQKLyUISdKhxFKaPP6rDEONR98nSVNdl\r\nq8G65hcPwJqZFQEo+lX82LBtEa6HyRwjDkQ=\r\n=DncT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3aa9d19c50f408e4a28b292b8dd977b134ba0378","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expose_process_tokens_directly"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-3aa9d1-lfcku1x4_1679059792206_0.38502688026388476","host":"s3://npm-registry-packages"}},"4.3.0-feature-24fa48-lfgplxbr":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-24fa48-lfgplxbr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-24fa48-lfgplxbr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3586d1607af9889890d84c9b2cb4181d43a9d74d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-24fa48-lfgplxbr.tgz","fileCount":159,"integrity":"sha512-BIMX6P32o23CHaMJb4by1d4g88xoql70pRJZ3G18fjeV1klBptcy84Vh+4+0fqOpEF/Qmkg8ZTvZwDnQRSs2ng==","signatures":[{"sig":"MEYCIQCxAJaKVTJ5JyYP8ZguP2k49PdOFz16jpZPuEdzYXIVLgIhAM+GO8ChyYnK6st4vsvZrVpEBVWIPOFusrmaZ7JgWDf6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGDtnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqqhAAj8tGRAXYg2bMfDQfZkdmcj1SdCK4xEplMqvznu+S4+EyRNte\r\n61g0mTMNJjWUHxi7y89XZGienDrzlF4QXv0r7TiwzQAxaNDIfxgbVubazIUK\r\ndhJeHFtq8aJez8n1ab6myHqI1wrEneDwZekYKcHKaXeJuxFcQdZAs1KiAI8a\r\n/B0jLuJTM0I2S6iXnAHvQ4m2p3q6SH6vjkRfILCDr/GN6Cxh16YNb+jUJurV\r\nF76uWKZwiNDp4O5BxKsEnQ5WTvtjNNMwSW4QG4WjYhNv55r+GD8RzW6JE5G1\r\nq9VHIbmY7e8CtX0LEddTptJpySpSoLz39JSQu0IBBMy+npdNkaqvU3pci1NE\r\n8EFLxflHf57p/BkDFAkyPuXf37/DGHdI3Fs8qa+Yvpy9EUN+pHs4kYrhT/Fn\r\nc7uSFoBuk6rgYqIzMSHCeBI+klEt0dzhuKK7vJp+Dh6lcKV6bmfcagGgiUXj\r\n2QhqBR2VhXQUp0UtvgNU+1H949xUkTzVfaNOqjXc+WGRDO+1AbEr8zyBuIIA\r\noSmYoasV6W+blCd+KlfA8xIORHkwOU6n6aT35YiTk1zuFHMLbifz3RdTvSzj\r\nKyvofdUFRNa0bidtvd1HjoXnjZMJjPD3PapY09APg3l2klVtg94SwWl188wr\r\n8ckStFoKY2N7QklmSVCzpOHi5ddXF2kqGuw=\r\n=M2Hn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"24fa489da64aeb372a143010174b2cfa8c540cc5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expose_process_tokens_directly"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-24fa48-lfgplxbr_1679309670887_0.8950788907902862","host":"s3://npm-registry-packages"}},"4.3.0-feature-62da7b-lfl2r1un":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-62da7b-lfl2r1un","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-62da7b-lfl2r1un","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"845bb8fb71da19a68b6d03e267c97b33738f7ce1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-62da7b-lfl2r1un.tgz","fileCount":164,"integrity":"sha512-tTYKpdS/SmF5Ujkzl/6v1jd8Nk/bqT+LP5D/1KDkfbJViitdO5umLkPTAFDdPqAyyQ9RaTl0qkIZ4LiXIiAFaA==","signatures":[{"sig":"MEQCIHEBA/tZEV7M8pRjyrlvRB3uirEg9t5sKjkJVafqHXmuAiBiVb8zzseL7E8AXPiD4J0nqYVsd+SZXeYbCEa5FbzUcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHEJqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmplAxAAjtXMNKCBgI63CCdpZ5ktyyAha9QNCSZFUgwS893yAffCsnO9\r\nOT3AsOIGeagIfZaIYK1byZPUY9EQBEt3VJdKx96K1jRmD2qBewQoLt7vt8to\r\nXG82g93P6KT+V8VZJgoUMosYBDXFXMvNGSvBIrQVfOBxDstUnxG24zw+Yauj\r\n2/dTtHrovwktPvxViGUYbALoSZchN8Yb09l3ee8AfojR9HR9LN1BbzO8lJoH\r\nnkJmLLhJcgmiIMXpAtFSd5sj8sX4Zb2TFdfEv1iN/skVbzn5ZyQRu7jPN+J2\r\nye4zOXUii9T0y9m8Pkk/LELzT0XF+wXaUG5vnf8kYDpSwRp5bfrDIL+EDoSM\r\nayBFRiBEkcZx4j+15j5lx00sx3wnhF7WpBAKcF0fhi3R+57HTVi5V8GEQSwL\r\nH7hEOI8pb83SXFdQF6HxaWxh227Jq2mDw8KdCHy+EuSCZ3hVks0PkpFfP4qK\r\nsO7sUmxUFtAQVHqRfA5DhmkqlNZ9cFWJkS6UavgYMQMr0bYWaRFXog4Jen/2\r\n5PxHkUReWame+OtafLx9df6TtjTV/f8YAlqsHsAeDbZ0q4Fkm6W0nCT1U5cv\r\ngx6E1a+n343PpFvVVkDcnaDqisOsBAw8x+edQeVKaqzSgW/8rMR6KEp9ckEf\r\nw9tbTvzzQ+EpMLu0042Pf4AOKM5RiDHNOkw=\r\n=Ce9y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"62da7b1399229502e5a5fb602c6836306f35f934","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-feature-eb27ac-lfl2my58"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-62da7b-lfl2r1un_1679573610302_0.5020615983164329","host":"s3://npm-registry-packages"}},"4.3.0-feature-57a4f9-lfqvqr12":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-57a4f9-lfqvqr12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-57a4f9-lfqvqr12","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"74d60bc0ba0f07815272bbd3e9812cb8af8a12d5","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-57a4f9-lfqvqr12.tgz","fileCount":164,"integrity":"sha512-NPohfgtoB0H8XM+k3sP+cDPttvUbv+FR1WNJGM4uAUohAe/8evVDldpIeumjiTl8LWqQ3ANyP/y78mh6HJXICg==","signatures":[{"sig":"MEUCIQDtWB3+sKVfI4K7KqK6Zh/X/VThgWguHeB6tITmMFJ02QIgQqjnRDgrpHrZBNlU0Co5j0KmMEyPKZ5mfPHCyKGV0Hk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIZ2gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqrpg//a1fEsNtLITF1WSS/zcjd7UWOBeY/Q8JaL4YqATOLrfYhuiHl\r\nDudbDFCCVo1ttyJiBoVvGvt4Bl4gOuH7KKcb4AgknqYOMf5VU9P4xHQWjIiT\r\nWkjjVAZL28q46mLFg4GogJYwMGUnfwuxCUC3xZXS2p9ntEkjcWuJ4XjCci4f\r\nw9YBPQNqgl1Ake4pnB51IEfNDFyWzXWKVFAPV3C6MuvrjZqzewudsu1DOUWm\r\nm8bKdIcPVO5+9HN7RA13Zb1E2Jc/f2JA5ZvabtdwTD6mc2m4eijs2PbFs7Gx\r\nSnKCXp17n2Sm78t8p1qSDpv4jePzBOFGMRJooh9MVFXYu3Yx9SfoS3gMi8ZW\r\ncZd8wq1SX63I4KMp3Ke9+UrVUKvoW3hDX1wuDyyz+M9m9/px+eNGw9YVZW5c\r\nX7eDND9tcl6f7S1H0BDbCrsmmPYv7qdyjBnMG6NTLZSbIztm3ajoD15A5C/u\r\nNxzpBM7AGDnu4YaozpQTaOvOaXqYcyv7lvfHVHpis+CjVhgqTuPJiCMe+rHe\r\nHBD4JkI1/qZFOPGQM333VsvuprfLdxC85ReczZ1CWrEmUi5Aq5XPt8p9a+dh\r\natEtY/pEqGvtWf0iOCdnChvOHW5uz+ScAOFX7UPoVb7R8REMunXB1+U8yp2Y\r\nzcWjERiPRpedbe2CySqdjcyDWWP+DFBlYyM=\r\n=USpw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"57a4f9d61453f08176deeabbfb7c04c78e6ac524","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-1b8dc3-lfqs0zp8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-57a4f9-lfqvqr12_1679924640312_0.15595221367687007","host":"s3://npm-registry-packages"}},"4.3.0-develop-01b3b4-lfqweb44":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-01b3b4-lfqweb44","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-01b3b4-lfqweb44","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"68492ed1bc46815ed57d620916853ea3e52f315a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-01b3b4-lfqweb44.tgz","fileCount":164,"integrity":"sha512-9PmqAC2Ce5Tu7lhcE3owIN3Isd4rTZ2vDBR3+Y4H4g31F/WqlD3/y91u70OFH3BzG6RWiQyf0bJieaUo5S/zPg==","signatures":[{"sig":"MEYCIQC625tP3cFPJDDlXOTKFBZnd1a6FKWwdjck6DJuWmyXEgIhANy9YbK2rTRbKhgFPCDATSn/wEmhVR2MG8sTQ0QB63o3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIaHnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNHxAAizc3mSgROJrmR2hQj4ICa2ai/7gDipFBA3HMMnrxHHpg8TgB\r\nX/k/f4V+bKNnnRpxsEZuEVbMRvxxWdwLCXiE7HnrbaJbAV+WPMYVA8fuyQVy\r\nL9QUEx1QzHnkGCAACDps9nR38hkPZ1Z6qJ2e10A9x8m5WQWJhiZeJrENlcf7\r\nG4Zh3XiI2ppxe/sD0LEvDdSJIbkz6O+JdXrqW61TmeBrb02kuh6UYxNtRtXb\r\nNi7QVCJYNgVlyvl73SHxGuAfyZgY75sJ6Ab0WSLVAPySMn9H1uT8ygCY6mmH\r\nsuDDdQ6nOBu5DyBS88VnoGmi4lUrQv4ymE4G9uO467Ry0ZlKFf1uueaweTKQ\r\nkT6UymtrFSplTOABJxHIFo7mj442QcMXQVxjvpen113qvpk55IJmyFqk+IXk\r\n6oy54JQ2gzCuaob4hsF847kPXpPW6F9OL4EFO8AwEx+TeKmY5Z/0Pmk0jw+B\r\nR8Ck9bNNPcMUQsBulUKNReWUTyvbxP6ON7YPIvGC37sE1Y/MJH8buULiLQye\r\nSAUAD9O9ilalZ8WgM1/ScVnUqaCd16HSsi42bio89LAXwwJDL6CHFAD1qUzu\r\ntQgjqAp/YK1EY0QkMsWM2uxCad2ooBcdQAfJfdaIFMJgZkrtRxrP8pfOehbf\r\nrP3NcnMIJsHgXp6a0YSxDns3K51woiKGunw=\r\n=yLZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"01b3b4b99e38c84dcbcfca24e6ef3a418c2af949","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-1b8dc3-lfqs0zp8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-01b3b4-lfqweb44_1679925734952_0.2622014823436194","host":"s3://npm-registry-packages"}},"4.3.0-feature-240a0c-lfqxi8l8":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-240a0c-lfqxi8l8","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-240a0c-lfqxi8l8","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dcd06a446fa7bf9040ea585853a3921681b5507c","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-240a0c-lfqxi8l8.tgz","fileCount":164,"integrity":"sha512-+L6WPbz79uf3JjROUoqXXIUbeQiqdw/Xyl/c0SVc09o+pUGmA2A/06uwb9fET6/O+H69A15go56v+2BqTS6Qnw==","signatures":[{"sig":"MEYCIQCqEPL90uIhfVMxkc6Ry6nZJtIyBr7MC0EbJrOZ2lQWtAIhAMmCIIQIKppmVIU6nkplW74a4KH6T5ZR0frQytnC/Jnq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIaktACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqupQ//UFLvkfo0lZeBmDAgLCH310LXv4ZhxzH4qujUF8tJ5W/nzDOc\r\nBrrAwdOmiz897dBYNYnBSGTIGjk9IsBzbs28UD9Di7nJZ9LG+ig4Pffbh3is\r\nYO3B4wvOfhQSwwE5HCcQYl4k9HGJ0SRW4no1pPNvMZ0iIrZYYVSuVLdfB+IR\r\nMkvnvqUaJqdaHMiYsveFPxRkGIYjJTN97CQNrnWrqTNHHujmSj0LenwGE9jN\r\nEGUQdqhRHV0Mf37l+QIhJbgFAbxHb6aKnLeUBZGknNhT12+wcH/z9A7tWQYy\r\n6zijLyEZWLLUkorHlzHGONgZuDG4d4owyfStAFmr06XDTkzzuegH5H5Jsvpi\r\naXKq5C65zfTIB60qU2fRcG6J2HRN4SYjsNSKb2Mba3szM9rt0DzpDZSz8UlA\r\no2lWYp5QpCv6JbX7JodUJd1puP2GnORh7Vnor0jTsAyKzOLu8J6LlZ8flf09\r\nLDD2Ma+dGkQmwI0eTioIqK4Poa7vryZfAeM40YgM/YqZsLnJdjszsCiTiMpD\r\n459UI7mP1xat1LKzvSLAXNyCHUBdkNV5kRup8JFgpkoDICznhv4ra4z6XoO0\r\nBz3/vJNxFHOGxAFkvf8gI6UaxJm7iY/WzbUA1h8dBdNQyG2yPDCGSKJWPpRs\r\nEMiKR8/httsJ7i7oU2H+Iu4LsHIy0Rylp28=\r\n=7lxv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"240a0c107f79c75df8ef800ccedcd4c66a934643","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~expose_process_tokens_directly"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-240a0c-lfqxi8l8_1679927597777_0.2243576680417716","host":"s3://npm-registry-packages"}},"4.3.0-feature-86966c-lfv1q4cq":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-86966c-lfv1q4cq","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-86966c-lfv1q4cq","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c6e86592431183f6904f9cba1eb1c6ac9b29e871","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-86966c-lfv1q4cq.tgz","fileCount":164,"integrity":"sha512-uDCgSMMGQBbZoUYCTNyLqg1YYTxo/YCUJRqbvPO6VeQ+HKIKbGvma68wYJsjczH5saM2+hBMkgZXqCfo0ajXpw==","signatures":[{"sig":"MEUCIQDuNjkCKVOzZKQYkYE6SC1PN/mG3YQw7b2yRJ4l8CYzCQIgdiY+rqc4q4ayS2606Uw2OgXbwy/Pp3adqnBkFl2ECv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJXWmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVzBAAmo+bbFdIPLfieytgX5djzjADsRFm6N7HhyYcTgJ7qmvL8Ly5\r\nuD+k2qb1X9WhJMtL1T94XuwxUVDMeVRawp/5zYP7qixHr5K4pWhl1VRA5pt8\r\nJI2nvc3Fv+20vhnO+dE8zsBDQ1/fDYOP3RSGCENq1sIUAozfXFFR0/WAZDtr\r\nhlqbmyuSkKVkqYg+8NR2oEB8E4HMs4gnLR7eIsBAFPQPif/bGaVXRmtooYYS\r\n+B4JzDSfXUmdngyw7emzPoBPie4KhcRKK4r89QxrIxnTs3dKHFdS0Iy7SWwI\r\nTgatpkK2icFG9sikhLkGq5EJJ/Ksi82He4IaQKvDXr4kbEkh1O3lgyxsUdud\r\nmEk85qoPMZZabc6VGSwD/+HMBglM6nC0wkWvtFGHVD7Ech7A58MFfJU9P06Z\r\nFxgGCb80htXnaEuxrO/I2fzcZ9G204jLmF7QAZMW5otCExIs4YdyOzAP6wH9\r\nUsXM72Nrgz3E/j5OQ0oy7j5lKHqq1pWmsKMOdv0qb61P36Sn6ICEsLhSZ2E5\r\nNkocj7QpAYtNXNNU9p01YYChPAg7cU9k1lvcTk2NhwRHRrbVrj9v+8foFG8Q\r\nmscHoh1ItrN3L66VC+VO56O2ODvsJBRRlYIysnX1PKtV1enIudXu4jpgoGNG\r\nUwbL+ERHl8suq9LLu8ZAYCSHh78XOghT0Lk=\r\n=t9XP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"86966c59a5a7fabd7d8a77622a2011dbc5f5a1ea","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-86966c-lfv1q4cq_1680176550563_0.3273146166278236","host":"s3://npm-registry-packages"}},"4.3.0-develop-89284e-lfv1rxtn":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-89284e-lfv1rxtn","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-89284e-lfv1rxtn","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"880c58ba5468f63d6b3a89f2826c06ade839f746","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-89284e-lfv1rxtn.tgz","fileCount":164,"integrity":"sha512-HW92CetrCfyWY7V3eg5PYbV+JGFYPVVfw6WQP5/Me3LRN1K5L8Ud29tpMFXhWrZygUEVZ9VqPoDUPgkNgHUJ2Q==","signatures":[{"sig":"MEUCIQDP+yXITJmPTLeIUMiqoTaQYyP5HWsvLQznh3TuFwffHQIgQu67StZsnlFNn59jgC28VXHmvoMDP4BShc/I6hHPwq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJXX6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoG2g/+NtbBEcZvsO7T4+IAtsfTBsEc6cg0qFZe1rH2qyejfHyuBi2q\r\nFkXPqJzoGnbSXtVeqo7ZFXTilLboxr0Zaj+qIiBEpjpcAMTnUnJVBpX04UOB\r\n7AqSwkcvrUadUyb9T642X1ipxMF3rle4op8SIYMoUQpFHjByMbG91r0fyVVy\r\n8KnrjaSfHB2jR/omiUzrMXhN27EIPmaip0QXQKns/nDUyxN6Q+HsVj7ugiRY\r\ngbpvxj0Iir+M3P4BBb+VwneT/8Hmh2CsrB1WOGHvdlRM3+hDFgdIF9YMFLYn\r\nkVLUt0fyNmaWzRXjPpuiS8DNKzw8P61X+72jxJK6ljXxT82RO+fUQx76qzi1\r\nb1BJbQRvPws+muoO/Tl+CxOOwCA0lOSAGaFLKGmSPBMuX8z1wpTxxy4oU+x1\r\n7Ho3uxZrkgZr1lX7JD39e5wF/nI/0IeSvTwgn3VdPDCzS6TC5rsb8bqO6/MR\r\ny1DsN4zqj89bIHLaD9jID+mnO8K/jqfXy58GP+2TD0bGP6gxCpjN8D/w/nxN\r\nndXTEWUDJbPwtlY4pkz+d1adBbaxLzgkANDmSZTQq5vqjA2+LSkm8Qeymrqg\r\nTGGpWiHR1eCRDKUnW1D/rxNEEsr7b+sr3PICR1uYBFSIeGiPs8W7fjkTZB/N\r\nCK9IseiIz9CK5YBrtpFApicDkQeiT2UMwQ0=\r\n=6wwF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"89284e203735b66123d75a57288940210f65343e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-89284e-lfv1rxtn_1680176633848_0.06554304456098015","host":"s3://npm-registry-packages"}},"4.3.0-alpha.11":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.11","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.11","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"207722dddca749cdcd4381481ee1d63747cdf062","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.11.tgz","fileCount":164,"integrity":"sha512-TUv3q4zVh4pfIIsdB+TeucCKvoIPoDWNkcalW2EZuwktfWMiTsQcP3AKsj5hk+68I0PhhrppO/UN4fgmZ8cL6g==","signatures":[{"sig":"MEUCIEZ5eghkDAvjIErSp+aTm1LUT+eoT41m+hoHZuXiGHCHAiEA/5VHj0yioc4v+8DaB4700skYtd5wnG6BOzeaRoCujXU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJXYUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmocqg//R96XRLJ48G4Ire/aCJlKs+Sg9vhBCXs4HfjB+Nzbt3lMj8WS\r\nd73+pQuezBk7V3R3GSt0PQ+THjxkPObLMYd6ePEBvi/JY8bDOIRikEb/Tec1\r\njhDB11HOcRmWNoKagOySWEd0E1leEBkuEwGkR8YLEN+YcNEdcwrFGVbfj4fI\r\nO2oTpBUkoHBxDl1RgAP15Oryomg1H6R5Ram0a+fk8QrvHRiHZM27Lx2N689U\r\n0ijUlzXW8aax3cIMbWc+RbnB70g9GQaur6NjiW21UZe53o9QAkxJY71yLXpQ\r\nlLGc5SQjcEs5u99T7PuO2S/2pEiNHiVbhLXHuTpr25pc8LgPK19HkNvjUtzr\r\nMo7+Ni91Dn9F5/OZgnVk5ZKaDoLD3bHY9Jemodtf3GbCfkfn52778RjVc6Fb\r\n+75Ezx8OX2+bGvLXXRdE6jW33S55xQlewNk3E7BJVxxHOoY/JVesaKoSKvZH\r\nXZBj1LEMjzEhqdmR+wFKqOwRye6VV9uMinzTA6Sd0/yJSSsmB40hfzOOn6OG\r\nLGKoufFLqkMd+c4CPnu7fm9Sbr4BUAkkqyHi+tQ16o5vN+jfy+2MUULt8JZ9\r\nuYSPwt4IvvxECM8aqPutEtYBXwmgG9tbY2IAll+IcdMwwPh0n3N0j4b47oN1\r\nDe9aj4AvkK0CciOgLGlKZSGRLHd52YR39a4=\r\n=GIeq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"32ada1af1a721e43dd84527e7ee5cec76c602ddd","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"8.19.3","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"16.19.1","dependencies":{"uuid":"^8.3.2","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.11_1680176660769_0.43163800761119187","host":"s3://npm-registry-packages"}},"4.3.0-develop-a22e64-lgmbkbyt":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-a22e64-lgmbkbyt","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-a22e64-lgmbkbyt","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"ed84e9bba8d7545dfd7e8bdef8ebf8cec43dbda1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-a22e64-lgmbkbyt.tgz","fileCount":164,"integrity":"sha512-9kcQ6Ves3TVE5pDng7wpGHtc2WG3gCKZbchcvc2OR7Ah0TRcY67/pFAKitPzT7A6kvr0GfYKzD/FsWp/dH+Rkg==","signatures":[{"sig":"MEYCIQC5BuI7Uz6YBPtNIw2+FV6qxPahOOaN31a9wMOqMD7MUgIhAKzhCzMrwajmaAYXYeXZJgQr4Y7DyeUNMoLS/y07PPft","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPp98ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGyw//ako5szrXDbwQ/1gKIZt/bG+O3WTlqDAsm9Een7I+f/POQmid\r\nEDa+FzDtcgeljrIcKK1YoSfrMncQxmEcmhNFcRbZJKFwpEsQA14+SW399s4p\r\ntB7z5DqxToEo565wZxuzWoG6yBJ30Itr7EokIlIACmlpyi073vBEt6p5GGOX\r\n0x8RWnrSluCKKTDsuGgOUNAQ+Nax5Z3bfMZTgcDACxyue7UciUlAiVUVZ92o\r\ntVsA2Ny4Qerhz5OpRqEHYjLLPq1ODIC9qTIxee62e7/wykcd5EkUBfMnUhc7\r\npDX9ZINJd2zUXVEJ6TpnbvkaKw+rai+n/xosEAY50Yvlz7oPUk45qGIonyFG\r\nKpN93/nbaIvX9Bsw8E3BXYEsh/+4iZx2t4Uq42WveRXYXCeWeQi4hLFG8/rY\r\nfnhxkl38dlkOfF4kdTxbZoQEQ5Y38z4tC6kanDVm+/yBZAG2wFzi8eCllh81\r\nNgm2W6XhC4/kNnYxAbCE8esPYeDB/huYcjwo1Hx5sq3NugNdwf3/HgUFgiDC\r\nLcPfHi2Pao0kAw8Yvy/WWMCDaXkazbn7QjGpfjLvrJAvdl2agotHIOiyNI9z\r\n4DVb4SabcJaQ3nO0hRjL3i4NLMrFoqB4DxIiewFR5Q982qRjGqeTpHu16P66\r\nThzGCcr61IO+1P7waadszBvQpA/ZB4DOT0c=\r\n=9pkr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a22e64d242a64873f85f2d822954a85d044ad97e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-alpha.10"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-a22e64-lgmbkbyt_1681825660647_0.08476756222680715","host":"s3://npm-registry-packages"}},"4.3.0-develop-a8b3cb-lgmclrhc":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-a8b3cb-lgmclrhc","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-a8b3cb-lgmclrhc","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"df2ef12b32ba5f0513162a3c51b8b8b407227686","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-a8b3cb-lgmclrhc.tgz","fileCount":164,"integrity":"sha512-aXO/uq8Ot2rv1BehAT07qzOpUJ7L6evxe/S/RHfEC1y8eiYHflESyk7jT+Zwu+VIij45wSa1cqd5ZKsuLSkjEQ==","signatures":[{"sig":"MEYCIQCUXSH/proi1biN98Sepn28QXLnShpUHQY6AgFJzxXOJAIhAI7yX5TT++9RRnvTeUViV/9HNc5wxtCwK7QR1Idyfy0q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPqZVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4Lg//YZmbqFeRUDpFhXkog64wY5xTPFb6d6nX/LpKXIXo/QDucIM9\r\ntLHd00OYfkIQmPhVUC8cVSxR0c5TBWTrqx+cHzGfYpO+RAGnMNYmL3JXVGT7\r\nKolNqB1siyeNnYf1SjLghwhz05u5L5gzc/tVmmhTO5YH1Djxy00dN+W+4Mm9\r\n+5dZ9n4yw18XYcm3GzRBx2YEDB6rNr+4iXTdsiXi97jVx10yDQ/fVoDslWdU\r\n4Tg1PYTnyLGHXD4CRkc1L7XPT2ARqUpBsg5fjHObFOyA61jm/NbpXaLP0RVE\r\nCJiK7goYpHKy9b64xb+THhh8HGbObw/PewHkYNFzmXbCIpewTvuYUpS80Wk5\r\nFBk7pkEShZt4AAp9h/At5QvpPysP80TB5vpMTnLod0VjA+lxyk5x0OBYYT7U\r\nycvu8i9ECXdINdMxKRQczD14fXk/6dXA8FKgs84mWVHSV9x9N2D6T2u1DHY/\r\nTLYRkD/eEzhl166eBDjwzA8Vxa8tz0C6udntvfZl75hwNGEY7K0kbcfNahBt\r\nkgbwUMT0G1bXnUNOYCjASTB3xB6hkke8TzkiZEMUeiKjiQj81Dfh3WVX2fNZ\r\n09Hdzm/3TWLM+RhTFa7+Lilkr1RLvFrxAu/lSL1mHBloNTiRBkgKyGM1R9sY\r\niZv2GuZEnvqHxqlQ4yQ+3qrVg85t/itmf4k=\r\n=r2h0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a8b3cb25acae3ddc8fdb5e35cb1ae8952ab7f6a1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f202eb-lgmbagf0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-a8b3cb-lgmclrhc_1681827413752_0.6018653129539413","host":"s3://npm-registry-packages"}},"4.3.0-feature-e166dc-lgmdevuo":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-e166dc-lgmdevuo","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-e166dc-lgmdevuo","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"965a9b1791983f5fef5529d339880b68f539986a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-e166dc-lgmdevuo.tgz","fileCount":164,"integrity":"sha512-4cJhOpVcr+WqRAJ5b/jJYK+DAcZFUumPkYo7IETqArNzuzXkntCCA86t/SBknU7yQx/UdcrtCvcdRXMhDWFwOA==","signatures":[{"sig":"MEUCIQCM7XUqSF9DPCNksBEfhXl+jI1byVbINU1ZgLz4nvlASQIgRBXped2Qrov3Kc6XomccnJMsZNQid0v58OTLD63ZNxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":577546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPqueACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJGA//QOXnar73yBL+XPaRSq9XU2ineKPiW+xaTdPtwmTkOlS6kXVx\r\nG9g6kpNnbCNPV6Ejp0e/uB0BTt7Q+BoC+m9wX34vtoB8HR7/j0GS1GDao75Y\r\ndnKYATVQKWB86N73X/CzmI7eGP2Dvuundx9adNkkOUtkAusneIYnpLH8DxwZ\r\ne4kVfXZ/TLb0eonmhMXQ+0ArZSTJVih3PjRWxZJRB453XmLRiuJkojxDesfZ\r\niQ/eZBUHGAlDioNyZsNZ+3xTGRTIS4X38DuFxPhSoJbuZrpYrvhu8KdSdyp1\r\nYih8u2g1LoYSxx1frgg+amC9xFeHwNUJQ1J1j3FEPpwt0C8kKt7G/d6UR6lJ\r\n+k+iGOnPlu2Ubkqt0OYZcsQUwuvWTzUAcQdQ54UCVZP7OsleYPuGv3Oy9qHN\r\nLjxyoZBIto0CgGU6VRl6si+4qcBafn2tf9cw/lhTmBM1ORcqBYtVUM/meKYX\r\nuwz0u7O5QLrme5OryYzD6s0WeoQFBmK0KhfWYSOsC01nytBt2/CqTpJgu4f7\r\nEUewY7zEY5Q0/hWl6TxhRp1oeJpVBPG6zMuG0SCfg5vWC/S4H3Oy5gM1BCQD\r\nGRf5FVSCjhytNulgi/NxW+o/q+O8vPBSZ33iCAUXoZpX8f8wLevSNnX90Zzc\r\nVsUahCYdrMDAYHpcKxEDzoPtz0ch54Oqy78=\r\n=TwSp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e166dc192dad1b06107d10410f7bd320d68ad422","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f202eb-lgmbagf0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-e166dc-lgmdevuo_1681828766433_0.19894845831524255","host":"s3://npm-registry-packages"}},"4.3.0-feature-007a92-lgmdpum1":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-007a92-lgmdpum1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-007a92-lgmdpum1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"331c27d9973b73e0d09c4e7b541d75d6e910a25e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-007a92-lgmdpum1.tgz","fileCount":164,"integrity":"sha512-NaDVVHojJCDNBcf9Hg2vXVv9GcattyXluKPqovaTtAXsBxv3ILNzJjfq0h70UqelKLP12VWXXU71+r9X78esHQ==","signatures":[{"sig":"MEYCIQDXQdZdpiRwSVQQIGpB8iQ5wcii/TISkmtRKUdM/VneBgIhALS8lzy9dwO8EVaxkNHyXyuULTP6gfabdhUx/Fu/vAQC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":577413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPq2dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAYA//WWdI9ZrzJzuwKFG2S16+QRHWEVf1qRFbToDg5HzMdhOTg+zR\r\nNRt/zkI6v7xCciqiuYdzA87g4HaFVfNk5nYho8ItK1NUPWWAVVWwl3ZOkClp\r\n+y4I/XwIxUOH7NSfG1tC3bpyBJ2jP9R9lwDYCg4O1gt2wGJE926Lr9Ds4hFZ\r\nyEgLzBZrNyqxHFFyt58jSxafGlfnDfJ6wdFOCMlsxFlGXrV7+noTQbD8FKqH\r\nHHIIAdut4VS76AXcU6agWApS1NP/Ls/IRGGd0oGXIrMuvYsN6blvfwOOn4kS\r\nyCKM4rSwIkJrxuK4S6izC6vGv2yF2a1C+wr5+Mqt8ogef0GKy11tHIaafIXr\r\nC4vw9OlnV39aItGbZzesdXnSa8JYBNmSlK4JGNqytxc6Ph3mpBgdEI+UbBW6\r\nLZui4eQQ8YbKB+erT494HvpZz+uT2cD9UqEy9FVuhGDqdG4aHt5z8AVigI+8\r\nNpquf2AGFYtK4GRrFv1fVuq/p6kkBTvGvuwRBj6byz0rAV2/oiiPUyvFGq64\r\n+/S0Dd3ct3DdvX5rmSIwf/trfeCF1BkiSblEAenRHsarG98iUNAMrWloyGMj\r\n+hShiea3prnx+m8OLvT6fdsorHyKDi21M1urDYNgJ0HqHxucxhnVGsBucaIA\r\n1kQ/BE77r7Yw3gCPYZWbTrEOcqQjml3ZH64=\r\n=nM+J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"007a929724602e3a965f96d805ee7588611cf35d","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f202eb-lgmbagf0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-007a92-lgmdpum1_1681829277622_0.8507814825232416","host":"s3://npm-registry-packages"}},"4.3.0-feature-075940-lgne23rg":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-075940-lgne23rg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-075940-lgne23rg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e43f6b0bdd3bedd9b558e4a7b186e06682e9f24d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-075940-lgne23rg.tgz","fileCount":164,"integrity":"sha512-KV0ZAR9xdRrxtJfC4UXi/wsQv8O9He+1lam9fXLkV8y8hspQoTW3EMEq8PT0zssKwUMIjfvRSyScnERq3vXzdA==","signatures":[{"sig":"MEYCIQC859CE19A/jstDX9m3G4DsatNVYO8/IR8eSPLHRbd5ZAIhAOsnJYob7/bcsWEyCRYqnnvKYGoeLlf5RbUvUmcVycBh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":577413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP5wOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2/g/8CObOcd+pdYFQBfrFbQjVQ45zvD43Sw9AObZoSjXF+Xolvy7G\r\nvoxVEWuZnrHV/QeWdVTHRYTd6Dao9cZOgL+ZA1un5FyiCXeqDyiZn/fq7YYz\r\n/aHRB2e07pVbCJLli0OdFDVyox27Utv1pnF7INl28jqCGsy5yJoowcO5DXvg\r\nq71JqI3sgUeqoKNCrx2Jzbuo/EAHjnx036XDZxRj10ZSkvgQjsYP17f9T8pz\r\nlvX5Djun/h8vOIcikKDaZAEwfRitlmLMxLEKsZ40F1VI+GGI6H3RzhCax0Us\r\nHIoQHn7zqCbazXiTZuB7WVuZkqFvyO0e5Hk9VMiHN+4XhTrT74tMFZpF6Rx7\r\ncC2yXSdYyqOEwsDU8VB7KBCWdcSRUrmHJGq1mXLaYsZr+1wiGMlFswzFP+x9\r\naK/5KHbkCQ9ZFjdga0XjUPexAZJjRTm6TukXL/Km4u8cr5dfpdlEht21zQxL\r\ncgVUBDcosa4sFCy3Z6u5Sff6wnliiXN2LF5XnQoMr7PSMs1N8iTP7HZjuM5e\r\ny6sq/6Bf2HvPQNjBEsZHlV9KyqEkzgrXnSepPpaWv5k8amCiv7JgVo0MEIoR\r\ng+5nuDgR/kIKOC8prn/JuysLJGE9c5XsraA6TZohTi7DcEY+wap+tRlhe0G2\r\nd5rIQ5UeYSSO6eIflmapS3yNJREA26rz7ZQ=\r\n=3ZuO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"07594039c736608ef5c08377193d3f758979bdae","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f5b69d-lgndwsva"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-075940-lgne23rg_1681890318726_0.9786029072150833","host":"s3://npm-registry-packages"}},"4.3.0-feature-65849d-lgne9ow6":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-65849d-lgne9ow6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-65849d-lgne9ow6","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8ccdf6784909e2b3c0b46f6b1d087409e81b47db","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-65849d-lgne9ow6.tgz","fileCount":164,"integrity":"sha512-diTsk6OwaGCpXn+f7AcF/7RRDOrajgQi8fvI4eqOn/Xfc3g4CsPVZnUHQXBKt6aRwVFqa1K5gG+49XQpEDq0kQ==","signatures":[{"sig":"MEQCIEcogN4MJl+ei5IybzZrRQgLdzTJNA0m9a2NsIBD1l4vAiAq1HK/ZBD2Y3IkQ3BEVrGEwBigbVRgHZqEtw8dAvgNwQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":577413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP51tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKJQ//dpGnCDvmsAusMQlhZsV37teit8wi0IfkAH24Do1DRCP5P6/4\r\nflJnsKztbR5aCe5J2cvfL9gl1TKe/s8zotk9CcTa+Fsr7/eETz6wHqkaJqMt\r\n8IfEkUjpnEE3w3q3oY+J4yl2DhScFeALCMTUAgxb6u4u/7MGmtTF6EgHlCWi\r\nMi4q2jAyccdVEFxnlGwMYqY6y3s+ylCXDpTx5rfLAIC0P4Gx3nIHPVNOxDQ8\r\nlmC/XxIJxfQHvPn294TFHvAq7OL44LkomX/AD+2+EcPHcnOcpTHrvyUhLvwr\r\nXDXTGJxjR1Nj9iY1N4tpQtmTlwGQg5hvjAs6njOSEE3FRZ+3OXffBN2UKsha\r\n5lnitKNOJytUriWPgxJjRNsrbeJIgKyjoUY/mbgMiCqIKxmeA+o3/ghrBjb5\r\nv+3J3geCnvJWgy6dVRqAZ34Qwm7XLsCpHUT/CZgEaCuF+OdAJXVAcs1S5mGc\r\n4dcCMambx0ytl3xB3WKhR7kq5tYAco6tw7+lDxPqMMRjLa4Eu7k9VrKOYZrc\r\nRqmRjlLmmZq+KjrgxpyJ5RCEkzs4FMn2844Mv2eTj/ZXFLZVSpyLG+aM33Z4\r\njtcxC9WCEX3MU5STOj1HoNPA71CTpyOcsA039D1QHgIzdL2SFl9SjypJtz7b\r\nnBcMOqmVJFnGFXa+qsxjAuIHeCEFATVEIgE=\r\n=c3eR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"65849d321800e74a10e370c4b0e48df15f556b31","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f5b69d-lgndwsva"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.9.5","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-65849d-lgne9ow6_1681890669626_0.05319097355026314","host":"s3://npm-registry-packages"}},"4.3.0-feature-4ab62a-lgnegkgg":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-4ab62a-lgnegkgg","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-4ab62a-lgnegkgg","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"846e92227f5accd93be37cd8f76fb3d1bfe037c1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-4ab62a-lgnegkgg.tgz","fileCount":164,"integrity":"sha512-vRaug+mQs4/B/Vgy/ZYooAvIUR2G/qNXR7aw7buP7OXjIRLzU9D7K2dMCiffUf79/Jh8Yv2Eb/iYeg0+zqmh4Q==","signatures":[{"sig":"MEUCIQD/VTI0NhJ2i8xIjv++ZdKEEgXK9razuV+30d983oFmtAIgJ/ZjrqsloG3erQ7gi9cgOwN97xE7ZBkKGEv7IUVoiUU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP56uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPPA//RHZQ7sgtCnDh215xWFEFcurWI6x/58uhmsl59qHf9s5oW6jH\r\no+GxxIuIpk7QutwtWXIYOwc+Qmwcerc6yjCFXaRM+bwC9JR+vsLVyVaaK4DG\r\nIBy0mg0BpgHFskpKpkobwcHZvKeQBTfG9LDVV1aNwRz7IcYjlYKBv1bwqlNK\r\n3j6VzXRZ3oGdPocz+eG/8P+XeDJV1CcrYEWLRaAnh2i4u2B7ECovXcfiHS8+\r\n35CBxLNDTm1OZ2+lwq20J9PFu9DGVEr11GujbSxrn/YGJjRx9bv87ouRcZRt\r\n3Em3qNBw3gv9eTa9eKgOZ95ROtznS6k4iangBGxDBEVmEgvBtrFECqeBhf5o\r\n1T/l2bdkh+LBxBiPWtmdHP51JtYkjKxtzRm+rBn5ljlILllTVK+atyzzpvEu\r\ni6U7uGWkGWHSoRfHHUgzXDi87vUAAafhGa93GbG4ErwOfIsVsiR3XMbnC28P\r\no3oFQ9+BZO3BGuJkqIJRjPTPN1TV8gqQVUUq0goi68nidBzfxYdSRK8oxkBS\r\nr2Wp2mZYm3kYXwdWp3c/hQuWD0fc9UR1z8ZZL2MgNC098VFVOb4pWsojnYFy\r\noLKi58pkrnSKVKB7t4G5AZHX1ZY4FixPXXc6zX3agYfgcERAram+M0MT1GDn\r\nKjmaxpY0TLwLX2rmjFd/NIhr+gj5bwVW/Zc=\r\n=fZM1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4ab62a915781f8321005cc26f9b5504a7bb9e45e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f5b69d-lgndwsva"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.9.5","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-4ab62a-lgnegkgg_1681890990238_0.5757863768455911","host":"s3://npm-registry-packages"}},"4.3.0-feature-4c49f5-lgnhf4c7":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-4c49f5-lgnhf4c7","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-4c49f5-lgnhf4c7","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"15f4fb4118fff71566331c63f96f905a65de8bd0","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-4c49f5-lgnhf4c7.tgz","fileCount":164,"integrity":"sha512-dtAUm4gy+MbwMPvvh3BBqr3tasTdPXMW21qqzC8/nc27oT/rktcvJvx/ZjsyQHjI27xs0xDGjomNS4vjklCYRg==","signatures":[{"sig":"MEUCIFxYJmo/lVb5zLNVxFU7fYedtLvh83kiRTG28ZYDbNEKAiEAplhCUPmWJs4q/AHWA2UNzzUAoOCp2FEQZSrLUem1qEU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP7IfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyYw//ZeL8e9jnvE12L35ZFcSZzm4bfrW4euyV8hFarNEFEbs4d+vy\r\nIrykwo1jmz7nmfm+TaTiHOrYgmVOIk00gQZGSVzhmWTQgNX2QcK/ZfP5VmkC\r\neppN+t1HgbJqirKUubAqLEnK5ud5ZJAZ0pQPohOb7JSwAbx14WP6NMZtfhNJ\r\nTU021BB+rODhyUeonmfqGHC+nM332sDEy0F6X0IvvQLuG2N3xx6+OLx4nNV9\r\nfcDh3G4W7s6BXta0MAvKdMDOp0cP5j2dc93KZMtbMOabk75tqh+zlglW/sjN\r\npvKXgN+l2TJz/ZGr7uvRYIDvJVmVKxX95clg4YfeYNUlMmytuBresCAh1Gzc\r\nvPyZ5XRR54NkPwIrWOxCzdFP5pwLuXzcUGQglT9SmKl/E+F4z4/8jZ494zhp\r\nwyxCbgpmLU8x58877GJjHzjJiy5Wohzm1CiFVEy4DgF4LCh8ZOy/k3u/1pUM\r\nLBUw5qWJe4MtVT2HYVyOdW4feJhGVR1iAmWxqLmWnNQzFP/vFF+vIsiKRN3D\r\n+eL4farUa8I4f/SdlZ2aUsO0TaeWgcnf2m2W84M9RERcvZSaa37uM/q3q6ik\r\n2cZp4DnbE617rTnMzYbh3hXKqVZbwS68CwlUD+pwOvAsMDSqioixGbn0E32+\r\nzKNU0bHJVxtEzBGH6/0cwOPRfmZNUbmtGr0=\r\n=UJL1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4c49f5be40fee85dea60c7ea8cc04471676b5fff","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f5b69d-lgndwsva"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.9.5","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-4c49f5-lgnhf4c7_1681895967411_0.7999801917373495","host":"s3://npm-registry-packages"}},"4.3.0-feature-91ad42-lgnhmn5e":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-91ad42-lgnhmn5e","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-91ad42-lgnhmn5e","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7ed769974165921de734f313ad2ace788788d07e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-91ad42-lgnhmn5e.tgz","fileCount":163,"integrity":"sha512-jMCePrDQEX6mSrf0X7GWnVGnpZ3241OKpyku+L77f/3oPhon3cdYNhCIFUQjv9x0/xnNRguEj1XfOx7BwWDCAA==","signatures":[{"sig":"MEUCIFcgB02HxzczYMHarINAvW4EvroTM2M7uf4FMWFyfmJoAiEA5z/oZIrDLErON1naBITMvln8GpeyUUxbZJuSLzbVxso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP7N4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpofA/9GvsFO4uP9Tkq/VRTgbQ89WPV4yZLF4gQBMEi3XjWxB5Q4aZu\r\n/v5wgRby64TXPeLT24SYjviNIL3g+RIjRE8fZKo6VJaGB5SDwJahMP3qsPUR\r\nwZc+5vN9yOHLg3OzPRFpsiUxAdHnbdwY1A7cE7O4B5rMJpquDev3vUIJaSLv\r\nKouM50fEhTryAfU3uQUXOd2VFm7+/FeyfiVQGY2C5gWHmkC6+NiihdDr5avV\r\nNqKzYGp5H+vYoVJziEJZC6dBDDZ9MfJX1DcKFOJmkSgP3EMCDYdap2fao2dh\r\nRdnb12tbrmLCqXAmNk1GZajDsArsFRA+ynTen6irrlM/e4So6Qf9MQKtq4HL\r\n2xgkv2yG/ZBjSweItIIn1+eKSxM72xcGt7gFeYZw8cqMaaypp7QvuTIddlck\r\nnBMA5fvOf0Eqk8L2AScZSeKbnKEk1Ya5wHzYWvCs17nCoTy8BcmlatD9EW40\r\nBQ1F/UIiXXi77/nCfp0g1RfYJzVvv81XQynOcif7wmuCV1GdExLZKIxayZNf\r\nkjWE40PwEeo6p9UZ2NwSP4QhYCXTT3Vz7zDrIF10LgARtPZ6AC7koO/FedN8\r\n0RmlurX4IGpWE/MU32ClkSIIpcYr+L7r7n7rvyj28j0o5G1Mo5SRQvgKoEoN\r\nduJBL0GA6UESxGUGncvY1ZufebsJbo7lWbE=\r\n=O46g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"91ad4291d5150810398cb512ca3f653d4c078977","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f5b69d-lgndwsva"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.9.5","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-91ad42-lgnhmn5e_1681896312563_0.8650169605351758","host":"s3://npm-registry-packages"}},"4.3.0-develop-8e0e9e-lgnijqyr":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-8e0e9e-lgnijqyr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-8e0e9e-lgnijqyr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"fc2f4a1bc8164d954e66ebb8ea5366768c498c69","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-8e0e9e-lgnijqyr.tgz","fileCount":163,"integrity":"sha512-VvZTunZrlRHvQR9sOLgRuPwOc0OUcjZJZzIxsEQXHy4A3s3+NxFwb4/6ZpDmAlb9rXuLKO7HoApVXKzWu4A6nA==","signatures":[{"sig":"MEUCIG/60mXwJxDEAHMz7imf+qCbxMyhy3SHEKnPRkJUDkaVAiEA4X6/JHl5NP6HUFv2Ns0zWKOqD+2JDVUOgIFtaZ2UAug=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP7mCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3zw//R8NcQuWFRnXHnygmGUPoYPgiqr3oWphGnpXD3i2Yx4jy7rxf\r\nwsyZ4bwt35wN6lyF5EcZJA6IMqli6pDnLyYn4HTZW08eRP8tfWzU5p67nOKu\r\nlU4uLJjmnzKye1qrU7Pb0K9j7o26HQMjTML70K/0dGoddVhNU53MU0N8UUfE\r\nZwslk2SUhGxzuGZn4ER1ekp6gKdLy7LDZa4xTbryFq2UbcoW2vtpGty1UaGR\r\nCwK7GxpB87VrLd7vTu53mg4Z/eP8BzW8YCqBkx6/li2SYDE0OL8c6Q3Gigb/\r\nxE69YdnbOhgWtFbzSFAMm4rA3SLMEaBk692fvNLQPK9WTnFVe4BpyhlaCsNr\r\nTou9wLMLGzloOg/022qHusd7CJwYe9IKL2ag6sdRd/iheprlKEyPqbKzrVhm\r\nvGfFAb/47MoHJ5d07jKY3gs/0l0BtkE5R56ixDwK/Pbj5qhenuYmWkrY3pdg\r\nlOcHHVwqIl0qPrBH3xCuDA+nxiFjbbw6cNr+cnrxUbEwwVTB/kKQZrg9/Wxj\r\nGXX4HCKmU8ArDTUwPNq17cecfaZbzIKk1JB40688hd6FYIoyIs/NntVuvVQn\r\n1wGaUNOKsfAyyYZ5hDrj4Ot7aZ6Oy8iiUcawvB28+IscrFdUDW7nVXjHZABi\r\naywFz4tCuvm/1JKxcr74sXDdwXlVEkwf0nI=\r\n=X7f0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8e0e9e28612d2c68926643c267852328b38127c2","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","socket.io-client":"4.6.1","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f5b69d-lgndwsva"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.9.5","@types/node":"^18.15.11"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-8e0e9e-lgnijqyr_1681897858100_0.1185738605103166","host":"s3://npm-registry-packages"}},"4.3.0-develop-a8b3cb-lgnj7lpr":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-a8b3cb-lgnj7lpr","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-a8b3cb-lgnj7lpr","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"f367135a06293287679b4f2bfe44b4a28776d31d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-a8b3cb-lgnj7lpr.tgz","fileCount":164,"integrity":"sha512-z/G7miND4moEJtkxYJgV7ISvMFiAUEqkXDE5X2JOD9GFXoN2mtdW+NUsoMSb8Dh/ztoBi4XW7FVH73TmplCbuQ==","signatures":[{"sig":"MEYCIQDj5tEH0Fk5srrWR4SH0h1oqEauRW4RatNW6gqCNfecTAIhAKony5VfjHhG9LCrKL2p7cJMzlVgsrYWpQnJEPb2oBdH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP73gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpK7w/+OzKT1loNJl4oQgp9NNnKKu9kn5rtNbad9wQGLV9uL3L4JEzi\r\nW2nfMc5okfJg/SM6fwN7WcFcBaGjRK/NMmplhiJME4SzfDs5r8oWQLrMJ/Ob\r\nZWiX5vmwIElas8AsaNmWK9P/HdsxaXXkmEniYtZBHgAqP6k08qGBIzrxrnpD\r\nVo8i0oRDB+hj9wxkDpaZj6yqZFnfZk54JHFtN5PUmjRfCNyHHj/Lq5CJdNc7\r\nRgoCvcKsiODLsLNyRbv7x1bcUWCW0PNei0iNQs6/WoBuxgoJZjE+LIEoH7Wh\r\nqulFDw3nA31NkFzOp2/GMrtAx/reOO3e3ze/Tony9whIOVY/rrGGP9T28juo\r\nn5WEQvGfyeKwt6bCr5A3hGgB0XWc4uHf1vzUezuKRl1fFeuh8m2+lDyVBC4h\r\nh7Ya+u4uOKbsL6/Zut9uoZ7qy/mBwrSe0t5gQJeXVHSGs+9YPBG+f9Eoc3ki\r\ndYZSudStGE0iRUSXi29GMNp5itzzH1Say9PYd0CQA3CZfmfaNp5jFRq1zcAs\r\nnSdjXoebVnQV7lABLblMP6yDgWTifyebtgJRghx9BB9wRxZvC0WDQXL9Dpcg\r\nyRD8mS6dhLco7JUA0fN8xKTyty8tjfsOJoYpVVwghG/6/uuiy2zet5z5/i72\r\njwyMaTC1E58jgBK485KB/slw+3DZjupkbGM=\r\n=Pzo7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"a8b3cb25acae3ddc8fdb5e35cb1ae8952ab7f6a1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f202eb-lgmbagf0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-a8b3cb-lgnj7lpr_1681898976035_0.7574028120690981","host":"s3://npm-registry-packages"}},"4.3.0-feature-883c6c-lgnvfyrz":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-883c6c-lgnvfyrz","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-883c6c-lgnvfyrz","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5abbcbf74db5768985538c9ea62895a5aeaab1c1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-883c6c-lgnvfyrz.tgz","fileCount":164,"integrity":"sha512-NMvSRSAu5bLTgHXYbbDncFHovJp7rMoVUPXFZoDB+S36mEus97vyiFisu5ME3glf//iQTULFcKrcb3BPXXwi7g==","signatures":[{"sig":"MEUCIApupNqW5REg45/qFw44pU+mpzYSKrAAv3GmhdDtGaBbAiEAhWVjkeK/iW04mvlGWgT5Wn3oYOvDtWpkFGuBvqbiCOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQA4mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq12xAAiOQJhP/2cvvZFmHOEOQNyvsIqYMriF4M5O1bAOzk2XWAKk7+\r\nHVXSJvKEPFQOAMbfu/PM1IQQr9c1xIEEeddc3LrJ7byMJ28PLH0jNiXU0VWI\r\nqU66GpP+has7kxcsokCGNTuL+sLAdmBOElUmlSZvBv0/9CJI+4Hpn5BypQ96\r\nI0TQErQhihxjDIbwh+cBsFZIWlLL/fmCBY7U6W6so2+xYFGTwV3bGEoDpkRT\r\nqX4fokSaM1qd0HwWZZD6DA1ebqqw4aPdsAnkoSJqsjEqVfV/it9947mYmQDC\r\n50rhGIkka8sr+SAX0UHG+Vyb4fJSCN+Y7vvZbg/TPXtLs6GEjkBgNKGYiVV3\r\nbXSby8243YBk/dpJSs9v3HHJAbdxGgX36ZtKqDx6WtyFASz2yZJQmb1C987E\r\nUIUtVBFcQb3F+5a2amAdgLSXRFvhid1ihHdNMaaJzpOYe4yu1TEdY1hcqIcc\r\nT+EUd/PqMFQaQFfnmHr2dk1bkZf9YAoKl3fgC4vltbBiSf6i1W3t2T2UKdH1\r\nRiTUXeDlzgqQ8eZCF3cYQIGYu+mDpgvDZ7d5/vSga2CGuHoWAmyxOaO9XaHU\r\nRkOvdxpUOjpmg0xaGU++hrH7M0U5Qz8lmTbVCHbq6olH4qezMz/BzDA4GM5Y\r\nRBby8+2M2fKlwSEXjuf1nOdMTR6f52p55cs=\r\n=OvMl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"883c6cf4dea15258625807b60fd96bc3a3b52464","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.0","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.15.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f202eb-lgmbagf0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-883c6c-lgnvfyrz_1681919526114_0.09427339743374485","host":"s3://npm-registry-packages"}},"4.3.0-develop-f1649c-lgqbycoj":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-f1649c-lgqbycoj","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-f1649c-lgqbycoj","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3108863cf6cb0b5932489814f2bdf2cb40bc5a53","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-f1649c-lgqbycoj.tgz","fileCount":164,"integrity":"sha512-v7RuRw9PQ3uVsLcKX93aim9LPaDGcZ4aIKyTUrOEQnJwhqd6qozHaIU+052NiWgHe7Mqv5nj5mrQ8otY1VeSxQ==","signatures":[{"sig":"MEUCIDBsi9PXQUW23KnHcd25MqaMKc4AYnT3TxhyfmyIzyZqAiEAokZ0yS3exBd1OtkShLvk1Q3yDmvUN2ldGHws6vsXjU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQlLYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKoQ/+JxlMQkw07csK8ojllr/7ZpQnyXlNtD8/YGTKScRv+ixMytf3\r\nZF+Z9kDUb1IxPufjaKnkFoefasaOwQuFkBFameazFdfSl8yRfISg8BqLZRY5\r\nYRSwB1aQaRplFx4GuD/ZtoiEXjekgG0rNpQBW6BUUAFy7QoQgsd6IWGcZTa9\r\nbOxLPThhfVcYYfdGfi6o/wmB7aW6HljMo/mNslK7dz7cL1gRgNR0QfcTElxj\r\nn3g/vxgfkRg2758v5kOdHgLvtHQ1f1V900TKsMyhrTZS7NxRQW4SP/uiPYrD\r\nI6XRxG4YvYXfTyAe+Lb0I10HRv2aYXYyAcBIQZVRRLOOa+FNjSddhQY4bAWg\r\noUT/pl5cTXTXMgy69duZqVmPyBRV7H8uHtriEBUCVRbuCoIGkCd9SB70VVxt\r\nqm8Ojo4anA7dQBsxgZq0/GnER9NfeDS1TtJKc7kR3Qjl/fD+A1zp0zI0kuXu\r\nEqGR1b9ktkD9qnt1U9UKaCSttMyHd6XpxPL7mkO0FjQ6v1Jj266IiwwyZZIe\r\nsMGWJjl2l7auRMZ+k86bO/OQ8fHtV/2aUYO8EqUWJRm9SK1QCE/WrxHnCiWp\r\nBdhtFqj1vJy4Zf0gUInE+5B2vhHt0+0/Q5kqe6mC1aQYImgjICoPdlpKkChQ\r\nAQgAQHO3hvJZLQmv53vj6xQmjds7lKhwAOU=\r\n=Jzm1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f1649cb33e2f340b259fe3aa8a21369501b523a5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-develop-f202eb-lgmbagf0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-f1649c-lgqbycoj_1682068184555_0.7968039807326546","host":"s3://npm-registry-packages"}},"4.3.0-beta.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-beta.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-beta.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"012ba50543cbdcf9696bd552a8369382c599a996","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-beta.1.tgz","fileCount":164,"integrity":"sha512-/nVQv8wK+UWIKdSsHZ8Q0PZuNWECehxNp3uFKIfKni6O8eqImjiC3RvsgZ/LyWPTF705kePNWp9cq9jvXZdTHQ==","signatures":[{"sig":"MEQCIAg3hujBcvJjWIjyaHUy6DUt+CyIOC6dKGn7MG0OW7DDAiAQs1KIG5zH6hrGwWbMcyIsQc95+0UWHA94NJqWTH21vw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQmSQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqk4g//fSmRHbb087yxAV57EXj9K9WflOVknILxUKEIo+seF+Lotp3C\r\ng6Ip1MHFUCr2BoDSDFVc8DqmhiAVwB4GblIWhAa4RzHcABeb33vMfm837SXe\r\naJS7wZ6ZHySy2vfCXmaGo+WQQzcWmO1va8qAun0egAhDmID8RSGeqV9i2rEN\r\n5ZdLIkLY1zBga+sfDI/1yYOWPUo23Fj5diF0+Tp+4D0Myw+6TV4JIy4b/xyK\r\njOUlP2PV6noCVtp+7ZwShtB5iip3GXApOkmuWEcPdygTDpsVQnCEcNDdKbRx\r\n3lcR7nZp2TR54WlrUZr4rrumpQ5Y4IBxBnZn9QoHElxsNhQH5Z5hpqH+Eqo3\r\neOfx70RqtPl7y/tAn25qt9WkzIpQ8Qityj5w9trObOr6V2m7r95N3IS2aq4j\r\nTRJoAKwhbvbikbEK+Pkwv4/J6he1NOGyb7nZvyKkcQI3evkIK+zae0z/9bI9\r\n9sO1dXmkqDXmnGy5QuafozyoXbBm1p5lL5wYLExZJIdy+nmTmZOUeljAFfFV\r\ncKZqB1eR7RSGy+K5F4t3q9R5yVdTgK6kcA9Pj4/x2xw7A8Vwe72tnYTAcM+N\r\nmzvJweNM8L8Cid1JwhVSuTikUGF60YThDi6qgsbpXQkfpNaRcUrsZvnU2RSz\r\nURDgAeqTQqvhpoZmFW4kMFHBZnrhEmbFz6U=\r\n=PFLL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"f83e8c39e6fd7e98f237e84edf48a08ad9f10e45","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-beta.1_1682072720182_0.8702056121102422","host":"s3://npm-registry-packages"}},"4.3.0-alpha.12":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-alpha.12","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-alpha.12","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"dcf444828e3eb6b970b8cf08e14520f5e1067da1","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-alpha.12.tgz","fileCount":164,"integrity":"sha512-nB+xCkXtDNYQ+gHp6pE1O/nGAilEfGSOEAZA0HCCAnrw03SKn544Zhn098b/dIqaQJhfnsCkuTHVJGo5/M4YAQ==","signatures":[{"sig":"MEUCIQDof5Uj4XcS7hDMLhObFRUuDyUJqmERzOG7sX6CL+eNJwIgHR6tp5XF/r84B4BEHEwcKP7yYZF4C05qm3eNWg4klQ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQmTpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Sw/+KxhzSIvw3/jqrcRicckvzk095N1+sRo22BSiadXptZ1GXEOM\r\nNSwCrUDK36ZGFFNjo7rLJA1XnVggEOL/50FUgKZ8vuaGp9S9LyBN6ZQTs4l0\r\nv84vwyQaiyvDiVKaA160ZnnC67vnTz/1+ic+RtOYc7IIiTiOblcgJup3Mzwl\r\n5RwL9adiyDO7O3snHoXPoVywvCY4Q4BnLI6pmhPPEAYL3xYi/DlQ5f7TqPwj\r\nYrQAQp3EwnRA0HkgNzCoKMBi+f0fFNRadh4QdZOWXovDKaZrVX64tJcyirvY\r\nzebT3RCmsSmYdd9C/6vjEWJhC/HQUkfKHxkjGv6dAoM1J0kCtUmkANgnTZ4r\r\nK7qOjxefI3phoOd4YATzChKCu/wUZTKUO6GbEdekmacrqGzxd/IHpFywiSmg\r\nIKfkF/4fVkwDPdYmiv4UWp5vpZWH+LKz1rb1MHvVtBBe/7Sk9mlwf7jXlnwh\r\naRsATUwAuL8kbRAQ3sKRoEyZTcGigMSoEjyHX/98ER6oY/nyHcp8761AvMEP\r\nLH+VgucfBd/xZBjgJRXrMGaU+KHf98p78Qjxgt6zs5CA9nzt9ZwMeEW65VVX\r\n8ZWNmOg2PxMnikbPtMrDTAYCArGjSd1yXfMo1UPL1UgobM4LlRuj/JygC61I\r\nWx6Uy5pdTrLShNvsd9pRQE8yEk7cXY6uYr0=\r\n=WmKs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"e464cd6d648a73516ffe67df6be0a554f07e1ff1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-alpha.12_1682072809225_0.23136558774370886","host":"s3://npm-registry-packages"}},"4.3.0-feature-acc21d-lgyunr3i":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-acc21d-lgyunr3i","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-acc21d-lgyunr3i","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"9e08dd383e991373511b80aeb71e04c9d724d2f7","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-acc21d-lgyunr3i.tgz","fileCount":164,"integrity":"sha512-eZjMPgs2kSBCHsJmL6ZwuQLalHHa7p1+EZ0iKEuDxjapiQQ1b1CAHayOLInJwG0JSXdJJQCdFdXEpPP+vZThzg==","signatures":[{"sig":"MEQCIBdnQjrsRE3JPYguzy5miBk35UcV9hfHN2+drw2IMdyvAiALJ80tnydlhYQC656dJCtuhk+E2ceBlKNhjniKweuw9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSi8fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0Bg//XIuPgv5HzWBekvZOwLsn9NqVF/Gg5scWOsv5Hf6k+GN+vOHZ\r\nQr3kwOh1VAzCNHBxi95Vqo6XyEsQ+MqmnPA7a6edw0DZicyMesGVU0tiKH3Z\r\nAzfMhwEgoqMXFQWvHDrxrODhCc+kSEecAzsoOX8gh+ocYn8bM5zMPXv4odIJ\r\nOmWRAiPKXuAvlArjBehzbQC0ZGG+iYVuUMK8AT2CQ4ooBVHn6tiDM4x24tvT\r\nk0Q88rHlxJZAAfOGpNiNytcjmc8YIImJhP5kz+45Vj5/waBhah44yDGJEwST\r\nV/aYz+j/gEyKidFrk/Ii0+Hfn6EelL/lcZGGf1FGu+SNvq3iEHVcbg73CvQN\r\nwp51H7KYrgMhobX1n0W1jtCGKT4q0j0MifxBiXGYB8VYiczjBlI1XQNN79DU\r\nH5sCm86Way0ViZRx49cOaP6fqwJcuy/rydLrrtDoA0GsAt7zBrqT6tsPoKgF\r\nSe0OQzhrkJORNt5WhaQEuokPSzrM7uGJJQShKJqey97EIHE9eCsMU+N3tnx4\r\nX0iI5IhtfULrjPo8HWl6uW9ad73LU6R9NYcfkP2RSYfKvDQTsTD4T8J6vk2f\r\nZEvjnB8RVBocx/Jp0gqvtUgMvFipLpfuTN5P8Lmg4Hbh2GGV9GhjSIFVbM0B\r\nYLBwDIVHgX/6sDilyVwsLkOfmqrji8nxKr8=\r\n=c3ar\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"acc21d3516be376db2528065f71f4ea09404aa05","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~parse_process_model_versions"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-acc21d-lgyunr3i_1682583327277_0.017220247299187363","host":"s3://npm-registry-packages"}},"4.3.0-feature-1772a0-lh0cstey":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-1772a0-lh0cstey","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-1772a0-lh0cstey","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4730724a3de92da65296d4526beaef35ab61c52e","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-1772a0-lh0cstey.tgz","fileCount":164,"integrity":"sha512-sHJrS1sxhJgwC//tu6yrZote6hzq90u4ynBmQvn8k/SW0ZycDeTumfX8PZvaW5DEDyIy+eagxsWg4QP2Tzie/g==","signatures":[{"sig":"MEYCIQDpW9A/UyATBuHqiknNEhhW0hHtQq/0wk2louAz4ptPewIhAPExVLFUjwzhXNn+OnmYs9VUINxmC+6WFVyrx9ozEi4F","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS5JbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOfhAAj04mkT6JE6Avbz7ZK6YkETyhgS9QOMG1l2DI+ypxnhKooGcF\r\nj3GW8rzDsAOxBoQd1otZ9XfBQ//MAZ2Ko1p0QOlnfia60nEnXpJnq3dpTPpL\r\nHDKftH4Iq6ohAIM9Wwaqgnrrazo9cDqK6pLzIRPDjpJEaaQ9NUABL96WeJo/\r\nB3uXqGq/sd9ctgXf59HXBmYJ4ZC7qr8dIv9PjhDEN16PveHUOdBDO3mou7vD\r\neeFlqRDx9q24OLqqSr2jMOdjqQm5Fm5xJkULax8gc+mx0XGi0pL1p6XDPBqi\r\npeCMh5QJYBzHByna4e2ygRWQ/MN+PuVOFtpFoHGIbEJ8LsDWXSJ+WioyAcXl\r\nhqs/92AWmqt8Gsg3/YyiQ//WL8rvB33YXivTo0E+4pN3CGej1Nh6RSaURwcJ\r\n/yeFDDqzrxS5CC3S2UbWS/dSboA8QdV6RcTmnd2cIaR3rpBCg0jDUYYDO6N+\r\nP3THG6IJiGy0khv9ZPtz3CTJu5CDsESKDzXoL3meYDZ3mlAvWQWN60VOPJnQ\r\nQgNfsRLV6gHBYZywUp9jf2K0lLjvQDXKOdrAJH93X2IqMpMWwDISo9Pl6M6P\r\nfk7DLGJ0Styn6dfer0G0szfpJuiGvoib54w7vfKzIieWhrBVF6PhJ182FBNv\r\nCd8ViPE4wVY3t9LV2AgQDeeflpdnnDretdE=\r\n=BTu7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"1772a031f3c1e55c72a004a11746b22a28d037fc","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-1772a0-lh0cstey_1682674267558_0.07611587853883894","host":"s3://npm-registry-packages"}},"4.3.0-develop-475589-lh0cts5p":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-475589-lh0cts5p","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-475589-lh0cts5p","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"05d6e3c58c2461921d35014114222a6198078d1d","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-475589-lh0cts5p.tgz","fileCount":164,"integrity":"sha512-sD8c4L8s5vNVlIJf8S/PhMBIAuX72szbY8IvfwWWd/1vZug2E9e25RuZNL7gdamlIShv17PRihpR1HxKli9m6A==","signatures":[{"sig":"MEUCIQD01kgmUCXG/PwoAiIwA9DJheU4Q9vKsrDrzm60DVIzoAIgRXegYE4C+QQEOobziTft60gQHstNsp0Y4Mz4Uv9JIUM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS5KDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq19BAAl666Yuke6xthz9JDpFyH1zea7RGt6I6MMx41hP0ZrEvZ455J\r\nj9acOr4Hl1vvkUDL0/6Fr2ibjNOil3R7qHpTf1oMI7fRgSj9+u81+AgZaNp6\r\nSKvhFtnrXPB5++WDNLAdC0RnGCbmn/F85/o2LJ5uGHTdQvD+7tm8DRwwXpC7\r\n133hu/JJg2uIexFZxUZWIBU6DIi6SeHwZkZlszNHoY3ASx0R0yl1jE3lb3zO\r\nqHWgKvC7rYdajkr05lvnlOqZU28FdGmKfddzf/U4YSiVF/bICXhB4d3sP5Xc\r\nZe06SIG7eWVayeeXbrBKccz05HFMV71bETA8kUSb9kvOgiF7M0yZbr427Oyv\r\nqQtp8nm4JJqek3jNEUR8nB8ztm1mU9MnkTha7wwiKWAmEhoWknONthsy2NlR\r\nDmj0K/GwSxFaiNNoYxr8OPlEzRBHRJ1Ou6ehExxwS0X1FD3ccd2jTf7ho3XL\r\nnOjHtGGEEPGoyFGIPnv34JxydJOZOYU0s0lf1uqT3ydgSfuj8yn4Th9OV7O6\r\nC2OqF/DhdIBAkmWorKiyFSdCpRMIC+k/ReI1LnlPtRMqY9wavR1CeSqkyGyM\r\n+X66uOoKB/oJhfjKK+EbBVh+VRTrpBJxPhifMe0etmJwd8AMHxIEuIy97AtM\r\n8Ho/0+qvaV/vVA0XqxvMmoxlPucxt2FsxJU=\r\n=I1H8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"4755893c7a247751e0cae577a2f4d165739d8a1e","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-475589-lh0cts5p_1682674307627_0.36317103116692695","host":"s3://npm-registry-packages"}},"4.3.0-beta.2":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-beta.2","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-beta.2","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alexander.kasten@5minds.de"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"2b1dc48f0de63efc82dec61b39f573c82c175ace","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-beta.2.tgz","fileCount":164,"integrity":"sha512-jrW+j26az6SRLA3IyjktfWdh9mhaBX2IF8CAhDRNyz50FJCo2Y4x5ShZVPYWPc4cdnlKglffj7rK6994PejRIg==","signatures":[{"sig":"MEYCIQCH1OME0Cp3CzycY+OpbtZiuyDqYo7Ge3vSu7hN9mPU5AIhANm+C3yit//a8S/okYQTPsNOStYrCOBBTojo9V/tHxOb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS5KyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6zA//QLw1o6wLeHFj+vjCoVUqSMYq7UezVcaJtU6KWdFDZfzKA9uE\r\npsINgdgrNY1vxzZW0XpVo+UbU70XDpQbuKfbZ8oukc+uzytTahpgxfwex1ai\r\nLIUNy/0D30fGP+an7IpGN4rbU82XRhHHTD9TwMzebsrGBVubsglhoxq0zvN5\r\nTM3f87NhvARZ+EIJMFejLxJwzf+pVjXjhq3y5hAJNp+3Mh46pzYGYH0h+JHX\r\nNCyKjF/JqzMgjmvbRrdUMFqNbmUEMnFgLZa0MaVrA2Zr/ccZH0tds0xNSiQ9\r\nTkI41XJhc6PtzO9erkVkUECz81/2HLPfpdBhL5mfaMdqZXUbwUSOVQkVk+gL\r\nFgOuhji0WOqdpOWrMBYH2VqLAeoOqyhhOuFVJz7QMiOCIRjPoKNWgmPjinmm\r\njyUd2B9TDIs01VyhcGU5yOlKAZrJzf0ufyQdkgiVn1KnF69EXR12SdI0cSww\r\n1y0t/B8yupH4Js4+aMue6CzgO0NpmBLHSDSkQPiw+Juykb0MKbQsJX/E+xH1\r\n3mbB/hQY93tH1YsPM81SG26+J6F/ElrzFbRxPn/Irh780IPlcIAfxlfRRJEO\r\ncldmff7HCMddvlyMTdqUjR+3qp7U5MydBAk10Q5dz6c8R63HOpZkCtGTvZBR\r\n6NkML0tucFieVYuGMJCpwmJsGFNTRoADF0M=\r\n=Wpdz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"07ca0ec9e456686e83f6686ea5dd53399536db22","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.4.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-beta.2_1682674353984_0.006399167563722052","host":"s3://npm-registry-packages"}},"4.3.0-feature-8dc180-lhkbx2we":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-feature-8dc180-lhkbx2we","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-feature-8dc180-lhkbx2we","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"1fa9bb6d715ac1961f4813510167a134eae01665","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-feature-8dc180-lhkbx2we.tgz","fileCount":164,"integrity":"sha512-PAVAfGh9GiPujzERdTaAfye8yE4VJfsHkRcOYQxTBdeehb+VLg9oglXDlJWAMXdTCU+lsi2i0IKeJTrXSfqJqA==","signatures":[{"sig":"MEYCIQCU1jNQZqfuc32Do3quSoLoDIlDauT3TfypNbANwP71KwIhAIMFp9JK8xanZ/7QcTc6P+7r8eMSmILUmu/b/S6hvYlZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579821},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"8dc1804863a27d8696adae4ce425e9f6c97c8675","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~replace_custom_swagger-generator"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-feature-8dc180-lhkbx2we_1683882105894_0.803051950833674","host":"s3://npm-registry-packages"}},"4.3.0-develop-3edc26-lhru6r08":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-develop-3edc26-lhru6r08","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-develop-3edc26-lhru6r08","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"68759e1a4704c396bc9c01f653b1d351dc0f9159","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-develop-3edc26-lhru6r08.tgz","fileCount":164,"integrity":"sha512-3krSlDzY6OTR+Rh+8ZARbVALZMqmi5uDg61GF9rMuhzqjm/ufTTNNe3NIADDtDgNqWuiwxO4rSd7ylq+Q7nEqA==","signatures":[{"sig":"MEUCIQCCyQ2yTQS07nxGnrrc687IRDHyz9L6YyQhsja2bYUE6QIgMl7OEzMmyf47EyQg1YGikrZFRYL8FshZjbT1Gidkmv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579821},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"3edc26d68b9370505c316cc1845babd8a53e6ac1","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"feature~replace_custom_swagger-generator"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-develop-3edc26-lhru6r08_1684336058900_0.12676345772667585","host":"s3://npm-registry-packages"}},"4.3.0-beta.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-beta.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-beta.3","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"28a317105dd8e0b1fe2b0cb48853a5f48270e312","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-beta.3.tgz","fileCount":164,"integrity":"sha512-g8n8fjGIzrepoi07KdjXLJobahRehLB2xrxPPzuUT+7/Hwa/hsLruQH7Dr/z6c+Y/TDs/8G77yOWEPwgN/icaw==","signatures":[{"sig":"MEUCIGfUSKW5UwYB26fegjUHnlE+4tKI843tXM8/10APOSSaAiEAix5XwJs/Ohd1zoTgMPlYNd6hXLELKKmm8vTBK/vqOBI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579776},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ea359de1dee4ad7f51146176ce4d3877d09eba6b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-beta.3_1684481479018_0.8667589077626834","host":"s3://npm-registry-packages"}},"4.3.0-beta.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0-beta.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0-beta.4","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"8862397b7324319b4003c83812dbfd3519e529d3","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0-beta.4.tgz","fileCount":164,"integrity":"sha512-bLDi3Yf47olJcr8Bk++H5SvITJ4VF8NQSjj7qT66JJcWaVb7phdw7Gixm1+pDuwnzaIo/ORUq3EnVeklRRFWUQ==","signatures":[{"sig":"MEUCIQDr5O3qlIsnXnwtcPRsmMEBj/IkUasMnEJd/0UcooXrswIgAXinYxL+G8DblUhQgEd8uXvo2B5sxln2Jha1Mq9N/Hs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579776},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ac060e90b69c6ceb3ca3e17e6d4c4960523793fb","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0-beta.4_1685025102715_0.6418575281718215","host":"s3://npm-registry-packages"}},"4.3.0":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.0","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.0","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"5c7bba8bec998956036ecf110d9cda14140f61ff","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.0.tgz","fileCount":164,"integrity":"sha512-AxWJ+V70GQWTiIW+qfNK0dn88zuA4XnfuPU8B14aNOoKPuSNUWgpT1wTjJTDDE+vKd8aYlwJCl2+8Yadw6zbNw==","signatures":[{"sig":"MEUCICHi2bdD+4h2ezSGEyzNMXyq3XGSrjTJ63PwHDCT7wMMAiEAsnnIC6h5ayKC5Gv3ZxliKEtggcf2b8mt3YI2sSHo92U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579769},"main":"dist/commonjs/index.js","gitHead":"9ab1a816a0cafe94cb70a6578f34a0589aaf985b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.0_1685438082897_0.267295078996691","host":"s3://npm-registry-packages"}},"4.4.0-alpha.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.4.0-alpha.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.4.0-alpha.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"371e6f7e0b5f4614612a4c9397bef0a6b1ca1069","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.4.0-alpha.1.tgz","fileCount":164,"integrity":"sha512-ob4noHD4SMm/KYvUvJPAHW1GHYqhlCl5JdLUgNachxCR7IeUlFISZmuu1FYxC6V4qy2nwHsqUGeHoCFbnNJTyw==","signatures":[{"sig":"MEUCIEJW+/t5lxuXNn/K3CPmhUw2AqPxAAVpOTX3H4w6cLYgAiEA0FjXogezm8IkZfurkLbZEzqlMmGXpqdkTlsbgtqw8OY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579777},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nA client for communicating with the `Engine`.\n\nIt is written in TypeScript and implemented in NodeJS.\n\n## Quick example\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({});\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n## How to use the client\n\nYou only need to provide an url to the `Engine` you want to access.\nAfter that, the client is ready to use.\n\nYou can either create a single EngineClient, which exposes references to all other clients,\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const processInstances = await client.processInstances.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\nor create multiple specific clients with the ClientFactory:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\n  const processInstances = await processInstanceClient.query({}, null, 0, 100);\n\n  console.log(processInstances);\n}\n\nrun();\n```\n\n### Starting Process Instances\n\nYou can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -\nResolves right after the Process Instance was started\n\nWhere `parameters` is an object that collects all startup parameters.\n\nThe following parameters are required:\n- `processModelId`: The ID of the Process Model to execute\n- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.\n\nIn addition, the following optional parameters are available:\n- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated\n- `initialToken`: The initial process token with which to start the Process Instance\n- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,\nthis contains the ID of the parent Process Instance\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -\nResolves when the Process Instance has finished with any End Event\n\nor through\n\n`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -\nResolves after the ProcessInstance has reached a specific End Event\nand has additionally the required endEventId parameter:\n- `endEventId`: The ID of the End Event to wait for\n\nExamples:\n\n#### Start Process Instance and wait for it to start\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for it to finish\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n}\n\nrun();\n```\n\n#### Start Process Instance and wait for an End Event\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');\n}\n\nrun();\n```\n\n#### Start Process Instance with custom payload and correlation ID\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    correlationId: 'my_custom_correlation_id',\n    initialToken: {\n      hello: 'world',\n    },\n  });\n}\n\nrun();\n```\n\n#### Start Process Instance as a sub process\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  await client.processDefinitions.startProcessInstance({\n    processModelId: 'myProcessModelId',\n    parentProcessInstanceId: 'Some-Other-Process-Instance-Id',\n  });\n}\n\nrun();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n\n## Query UserTasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const userTasks = await client.userTasks.query({\n    processModelId: 'myProcessModelId',\n    state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n  });\n\n  console.log(userTasks);\n}\n\nrun();\n```\n\n## How to use External Task Workers\n\nAn External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.\n\n### Basic\n\nYou need to provide three arguments to a worker:\n\n- The url of the Engine where the worker should connect to\n- The topic by which to poll External Tasks\n- A handler function for processing the External Tasks\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nasync function run() {\n  const client = new EngineClient(engineUri);\n\n  const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);\n\n  externalTaskWorker.start();\n}\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  console.log('Receive payload from process instance');\n  console.log(JSON.stringify(payload));\n\n  return Promise.resolve(result);\n}\n\nrun();\n\n```\n\nNote that by subscribing to a single topic, you create a specific worker for this topic.\n\n### Starting and stopping\n\nStart the worker with:\n\n```ts\nexternalTaskWorker.start();\n```\n\nAnd stop it with:\n\n```ts\nexternalTaskWorker.stop();\n```\n\n### Code Samples\n\nYou can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).\n","gitHead":"ef5eda114c6486ca8319fd7edd4297a5082503c7","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0-beta.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.4.0-alpha.1_1685438373960_0.011811204077405213","host":"s3://npm-registry-packages"}},"4.3.1":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.1","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.1","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4a8b9a9c063a56facaa71137bf5189d8c3c6c8a4","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.1.tgz","fileCount":164,"integrity":"sha512-xDF/xdGyCatXfRXGltsgo25KXjDHLC70hyP/4hSjfWqaNPNeYK3s7ItHXcNLkOo9qChKQ8QLlTOJEWVIJ6Wc/Q==","signatures":[{"sig":"MEQCIEeEXvu2tojEjjdf79SB38VW7XilMZM1XgJpJPOFMWBIAiAnui4SDmG1vgx+FT/s+NhdHcMDp7u8advX1lGFTddCXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579762},"main":"dist/commonjs/index.js","gitHead":"ffd1fbffc6e1253ae9f6335328f44f9f1f3776b4","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.1_1685445551961_0.5085856854153532","host":"s3://npm-registry-packages"}},"4.4.0-develop-b60523-liu6rxos":{"name":"@atlas-engine/atlas_engine_client","version":"4.4.0-develop-b60523-liu6rxos","author":{"url":"https://5minds.de/","name":"5Minds IT-Solutions GmbH & Co. KG","email":"info@5minds.de"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.4.0-develop-b60523-liu6rxos","maintainers":[{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"rrrene","email":"rf@bamaru.de"},{"name":"steffen982","email":"Steffenknaup@hotmail.de"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"fvanbraak","email":"frank.vanbraak@5minds.de"},{"name":"lukas.huerter","email":"lukas.huerter@5minds.de"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"a2719ba6e53eb19c2bf530da240de3b3567d45da","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.4.0-develop-b60523-liu6rxos.tgz","fileCount":164,"integrity":"sha512-ItfsnZO46RAfgRp1KEm0CwM+Ypkyz6TECTJYGIiFpQI3tpwNz2JxE9gEG7QnOkcvQZiJtVRKYu+kGPgOuh8ekA==","signatures":[{"sig":"MEUCIQCXRkbH2nT95/UOJAtgehZfgD2+KDwa7umjwvQXngimZgIgD+AhE5ktf7oTHyeyzGvTo2AxwpFNjljs/FlEZ3tYVSw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":578369},"main":"dist/commonjs/index.js","types":"dist/index.d.ts","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport {ClientFactory} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport {EngineClient} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport {EngineClient, DataModels} from '@atlas-engine/atlas_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@atlas-engine/atlas_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"b60523a0b2f49c958fb5ea788aa6b72d6307df7c","scripts":{"test":":","build":"npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","clean-build":"npm run clean && npm run build","build-commonjs":"tsc"},"_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.6","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@atlas-engine/atlas_engine_sdk":"3.3.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.1.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.4.0-develop-b60523-liu6rxos_1686654912910_0.79644337200081","host":"s3://npm-registry-packages"}},"4.3.3-hotfix-b4c82b-ll204dqx":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.3-hotfix-b4c82b-ll204dqx","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.3-hotfix-b4c82b-ll204dqx","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"3d48ef81d298315cc981975fb539088b6284d175","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.3-hotfix-b4c82b-ll204dqx.tgz","fileCount":164,"integrity":"sha512-tjd5a/QOIiG4PN0/G2yx7LKy7SmvB3Yu5X9JkV7yNZPB1cqpW8ntOoTzhnPmcFyt1ZURIv6DXKGDGXZpBNykNA==","signatures":[{"sig":"MEUCIQCslZe4mXAf3OAQQ6TXg6QxWkFD7ijfqzxRepAHwIJdtQIgMk8779mANXiM2E6RZD/KZ/PpeIDd3sQgVz7UQfG2TOY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579026},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"b4c82bfcb7384a8a3bfe8eb4504adc3de1e25653","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.2-hotfix-5e5851-ll1zhz20"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.3-hotfix-b4c82b-ll204dqx_1691481039753_0.3113836617188146","host":"s3://npm-registry-packages"}},"4.3.3-hotfix-48bfe1-ll6ekw9r":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.3-hotfix-48bfe1-ll6ekw9r","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.3-hotfix-48bfe1-ll6ekw9r","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"07facd8ac4178d12bdb0ffa8f3058ad042b1460b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.3-hotfix-48bfe1-ll6ekw9r.tgz","fileCount":164,"integrity":"sha512-rZJ5MNak469MkorVrMs4KDfQUcLC+j2gQRSIvyBegN8gYh2WezBni7UOHeMmFuqqFugdyB4XsFlyPdMoYolhMA==","signatures":[{"sig":"MEYCIQDqD9NBPdVcrxZhkqXI+Ku+9qBxZY8wrxVjF+zmI61IUQIhAONbB2EK6+XwffoFd6Ve1ZWKhBOtEdAfWiZoBqY7oS++","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579041},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"48bfe1ad51b2398b93f40e2f30b932f88b5a097b","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.3-hotfix-48bfe1-ll6ekw9r_1691747194289_0.9461222966026086","host":"s3://npm-registry-packages"}},"4.3.3-hotfix-d805ae-ll6etdb6":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.3-hotfix-d805ae-ll6etdb6","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.3-hotfix-d805ae-ll6etdb6","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"96fd44c65c3019a7c5ac576cd06334572db8554a","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.3-hotfix-d805ae-ll6etdb6.tgz","fileCount":164,"integrity":"sha512-+AKeqNRoMQ1CX6rtbPYQgLHr87QSCCSzG96O+jTSQKIMIuqSJx1EayXKXv/gZb2RJlQens/EmNWMHNHzJ6v0ng==","signatures":[{"sig":"MEUCIEo+UpY8CP7xFM7bHxyNF4mwyhv8ExcYD/dnZ+U/13dOAiEA38q/Egu4ve0+vkkTRGy9zERTLcYo/9r9MgsvoPyWXrg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579026},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"d805ae23f915034e45ad17bd01c0290284c00c33","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.2-hotfix-5e5851-ll1zhz20"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.3-hotfix-d805ae-ll6etdb6_1691747582644_0.42740432982164256","host":"s3://npm-registry-packages"}},"4.3.3-hotfix-c9f91b-llc464d4":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.3-hotfix-c9f91b-llc464d4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.3-hotfix-c9f91b-llc464d4","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"4f4ea751571d05bdfa90528a733a72bcae0ff9d9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.3-hotfix-c9f91b-llc464d4.tgz","fileCount":164,"integrity":"sha512-jGAd5y78t/CHmPgqbNp8wKTKx4N8Koin2hEDQgGuTjDn1onrbhg8zqMC4nGq4uZ7SgF/Fy6NpqYN8JjkITZT7w==","signatures":[{"sig":"MEUCIQDWElSabGfxfSwP4GasuqJhowVDR6yy9r6WkVUaNx1dkwIgaVvu3gJL77M/hTZNeXAW+xSc3cCUiMbgvS134/ZZLDE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":579026},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"c9f91bec9cbc6127e1c893d52fb731981bf70a3c","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.2-hotfix-5e5851-ll1zhz20"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.3-hotfix-c9f91b-llc464d4_1692092504272_0.49953615232027504","host":"s3://npm-registry-packages"}},"4.3.3-hotfix-b50325-llcidshi":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.3-hotfix-b50325-llcidshi","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.3-hotfix-b50325-llcidshi","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c8e875f86eb1a3ad6d9c20948fc830520768f612","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.3-hotfix-b50325-llcidshi.tgz","fileCount":164,"integrity":"sha512-34D/EdRR4OvZLOyIWb84Q7kJp+NERHl7rNbdd80IF/rMnmadyZ/vDMTFP21SCq1pzYKWXclhwkWVufQDUqkorg==","signatures":[{"sig":"MEQCICtslaJgMyMD9VZA2h0QDotxdGfZtD6y9ijciUh6hCHUAiBZvYcsu94Ox7Z/dmQO1TChQOJ4uMrh+ESs72NGvfLjDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580506},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"b50325278f33c9a16ac2545e52972cb2b9979f55","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.3-hotfix-b50325-llcidshi_1692116376116_0.26730579647701247","host":"s3://npm-registry-packages"}},"4.3.3":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.3","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.3","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"20be25e7e9da9aea13bfc03f670b4fe096c0e641","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.3.tgz","fileCount":164,"integrity":"sha512-ZvUoCXc/XPYvFDrSVgruIePLVznuOtEHNP/MxYQS17ehkTnyC+UikL4NiBKT41O5l9vHCQvgjALrB2dywQQBSw==","signatures":[{"sig":"MEUCIQCdJM7PcsQIDFLcwl/tlG6/gzTwf80mifeXXRu6gDf47wIgZiLscpsgOO62Jc/oIHj3ooSbhiYD3WRsyMU0POdYXgI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580483},"main":"dist/commonjs/index.js","gitHead":"f9224b1e5ba1ef71751e3f696786b320b9cdeeca","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.0","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.3_1692116484918_0.9961312264213651","host":"s3://npm-registry-packages"}},"4.3.4-feature-fdec9d-llkqx388":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.4-feature-fdec9d-llkqx388","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.4-feature-fdec9d-llkqx388","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"90f45cebbbc026ca5eb71e6b8b8d6e3035f925a9","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.4-feature-fdec9d-llkqx388.tgz","fileCount":164,"integrity":"sha512-NX7A9C/PK2ocVhjeTgtFv+zT35vC1nPyNhjMrnAde4QQQKJre3Y0V/ZGNq4BQyk1PKjzf6rA6seUemWHYCcrbw==","signatures":[{"sig":"MEQCIFXjrWW2bNyZLv1dAdD0eNfddp8/zkJv5yPZ2FqHHdWAAiBxWucUlN3CYDgsnEwOMZG5PzxbWJKUL9SBtM13Z6vbqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580547},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"fdec9d2236e288397c1598b51c61e500530297a9","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.1","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"feature~PCE-340_Allow_public_extension_routes"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.4-feature-fdec9d-llkqx388_1692614443030_0.22638340747672325","host":"s3://npm-registry-packages"}},"4.3.4-feature-30916d-llmaydqv":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.4-feature-30916d-llmaydqv","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.4-feature-30916d-llmaydqv","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"e08efe9c91cfff1619bceacc0fe0034f581125ba","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.4-feature-30916d-llmaydqv.tgz","fileCount":164,"integrity":"sha512-5wJgW/dm/xzQFtvX/H+5FfIqRwNQ4pDgFXAA5lGnwUlLbN70HZRymfY2OMqo+oaWn0JeCiILb9zcRSFhvfu4jg==","signatures":[{"sig":"MEYCIQDbBWyB+KtgAtiWl0foPWOhZ/qlC3gpxU9pVGopzpVhnQIhANbu7uZIG0Pi4xkaNz1MypWcMn1lnFCeRpIW+Frvb0qu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580507},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"30916d0c2bc523851fd91bba358606ea6abaaba0","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.1","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.4-feature-30916d-llmaydqv_1692708560632_0.901643441575416","host":"s3://npm-registry-packages"}},"4.3.4":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.4","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.4","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"43700de8bf01d58a2f0ed18ba625468f2b24b5cf","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.4.tgz","fileCount":164,"integrity":"sha512-EYQY1tPFSX9TfLE8vmgOGZfGAG9kg+NREkVZbuj6I6NMPxCZM98rJ1ODtPyp06H2NFN5SvjcALyBOPSPLLazRA==","signatures":[{"sig":"MEYCIQDj0IUjkmgKbscJad0dxOFCbz7XobDMupxt4E3ncNLj3wIhAKtcd4g0qYnLGCV2YDjIvH4RwGOUFFQgIqn9OmK3ElVh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580483},"main":"dist/commonjs/index.js","gitHead":"52ef2473f51365f7ae130c7142f878ccdab7cad2","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.1","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.3"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.4_1692708626776_0.5075924377542713","host":"s3://npm-registry-packages"}},"4.3.6-hotfix-42ad31-lm4v2mgb":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.6-hotfix-42ad31-lm4v2mgb","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.6-hotfix-42ad31-lm4v2mgb","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"b94a3c18da6fa5580ad1067ac8173aa56896267b","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.6-hotfix-42ad31-lm4v2mgb.tgz","fileCount":164,"integrity":"sha512-3L1Vq3PSAXWN/D96UroNyV0/mWeXi7soueIBJykqlhu9DOm3sHCrZhimhfTbLfwkbrJy1LjYdijQoRrshaDe1Q==","signatures":[{"sig":"MEYCIQDNq++gjNPgddMbcuwGqc/k9oCCXM+LE55HpCEPtxZyMAIhAI4yiYspWOmiti5Yo062wOXaB5HOMA9fX44z7Pjeew+S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580506},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"42ad31376f63d171f8dc4c3415b792e9a9c3aab5","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.1","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.6-hotfix-42ad31-lm4v2mgb_1693830744785_0.7789396446920072","host":"s3://npm-registry-packages"}},"4.3.5-hotfix-0a8209-lm4v5vx9":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.5-hotfix-0a8209-lm4v5vx9","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.5-hotfix-0a8209-lm4v5vx9","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"7bab24c479bda2fd981c195603d227115a2acf81","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.5-hotfix-0a8209-lm4v5vx9.tgz","fileCount":164,"integrity":"sha512-UOFiIFgrlKNUSo+KgoZHMIPDgGoXvTFKYyzz++Wv3py4JPRfQJuMEHGLth6eROGHSpi+1e+x62WBpEx1mTSB4g==","signatures":[{"sig":"MEUCIQChAzXq8M9aC0Cm7FHrpCOo7xkAlUmnfbsSDn/oVfDH/gIgL4Pi6VfF9Zow1274iDhxDmJSei/Z5PmIjnEdP+HzyHs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580506},"main":"dist/commonjs/index.js","readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","gitHead":"0a820927612949ed4c8f42bd737341e11fd70409","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.1","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.5-hotfix-0a8209-lm4v5vx9_1693830891132_0.33791549784024744","host":"s3://npm-registry-packages"}},"4.3.5":{"name":"@atlas-engine/atlas_engine_client","version":"4.3.5","author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","_id":"@atlas-engine/atlas_engine_client@4.3.5","maintainers":[{"name":"developers5minds","email":"developers+npm@5minds.de"},{"name":"moellenbeck","email":"martin.moellenbeck@5minds.de"},{"name":"obivarg","email":"christian.werner@5minds.de"},{"name":"alexanderkasten","email":"alex@kasten.pw"},{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},{"name":"s3bastiangriesa5minds","email":"sebastian.griesa@5minds.de"}],"homepage":"https://github.com/atlas-engine/Client.ts#readme","bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"dist":{"shasum":"c07228b865dbe25c37cc5def7dfd08b13c89dea2","tarball":"https://registry.npmjs.org/@atlas-engine/atlas_engine_client/-/atlas_engine_client-4.3.5.tgz","fileCount":164,"integrity":"sha512-tWP+ZqHOxmgewuJUYgpWFhmzdUswuKoQz6Yw5oEmqkpxbCnKXGTZFDPbgyNsmwroy4KjMnAJtJXYFZJ1vS++2Q==","signatures":[{"sig":"MEUCIQC26PMih16B6QMVMSVunkPExxhxa2SDOEejN3XCAVnQ6wIgHRm/CbyQVo9PX1AbBg7sqU2sMswLkZ2WR6IcXECK9jY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":580483},"main":"dist/commonjs/index.js","gitHead":"411174153294ee8180f46dd004bf2a89fa674f21","scripts":{"test":":","build":"npm run clean && npm run build-commonjs && npm run build-amd","clean":"rm -rf dist","prepare":"npm run build","build-amd":"tsc --module amd --outDir ./dist/amd","reinstall":"./reinstall.sh","build-commonjs":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"process-engine-ci","email":"ci+npm@process-engine.io"},"deprecated":"This package was renamed to @5minds/processcube_engine_client. Please switch as soon as possible.","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"_npmVersion":"9.6.7","description":"Contains a typescript based client for accessing the Engine.","directories":{},"_nodeVersion":"18.17.1","dependencies":{"uuid":"^9.0.0","cross-fetch":"3.1.5","@types/socket.io":"^2.1.13","socket.io-client":"2.5.0","@types/socket.io-client":"^1.4.36","@5minds/processcube_engine_sdk":"3.3.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/atlas_engine_client_4.3.5_1693830945602_0.6993690916720079","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-05-24T10:33:20.886Z","modified":"2026-05-20T11:36:37.834Z","0.0.1":"2019-05-24T10:33:21.182Z","0.4.5":"2020-02-26T20:40:54.560Z","0.4.6":"2020-02-27T13:48:47.079Z","0.4.7":"2020-02-27T19:27:08.690Z","0.4.8":"2020-02-27T21:21:15.049Z","0.5.0":"2020-02-28T09:28:47.731Z","0.5.1":"2020-03-05T07:33:02.450Z","0.5.1-alpha.1":"2020-03-05T08:34:21.556Z","0.5.1-alpha.2":"2020-03-18T09:01:16.477Z","0.5.1-alpha.3":"2020-03-18T11:28:45.958Z","0.5.1-beta.1":"2020-03-19T18:42:39.949Z","0.5.1-alpha.4":"2020-03-24T09:49:37.677Z","0.5.1-feature-fb1f56-k85pxdvu":"2020-03-24T09:50:44.970Z","0.5.1-alpha.5":"2020-03-24T09:55:56.149Z","0.5.1-feature-5ef729-k85q4x8h":"2020-03-24T09:56:29.178Z","0.5.1-feature-a60f5f-k85q70xa":"2020-03-24T09:58:06.961Z","0.5.1-feature-93f927-k85q9jyj":"2020-03-24T10:00:02.651Z","0.5.1-feature-1df8e3-k865ilq2":"2020-03-24T17:07:01.891Z","0.5.1-alpha.6":"2020-03-24T17:13:55.077Z","0.5.1-alpha.7":"2020-03-24T17:26:09.364Z","1.0.0-alpha.1":"2020-03-26T09:49:05.240Z","1.0.0-alpha.2":"2020-03-27T17:56:30.881Z","1.0.0-beta.1":"2020-03-30T13:39:38.345Z","1.0.0-alpha.3":"2020-04-02T14:40:57.917Z","1.0.0-beta.2":"2020-04-08T15:07:16.389Z","1.0.0-feature-bbf574-k91cmxzs":"2020-04-15T13:07:11.658Z","1.0.0-feature-5b7fdb-k92bx2v3":"2020-04-16T05:34:51.332Z","1.0.0-feature-5b7fdb-k92bzgab":"2020-04-16T05:36:42.372Z","1.0.0-alpha.4":"2020-04-16T05:41:14.407Z","1.0.0-feature-159aa3-k943s99k":"2020-04-17T11:22:41.236Z","1.0.0-feature-7d9f87-k9459azd":"2020-04-17T12:03:54.607Z","1.0.0-feature-e0b190-k947hzxm":"2020-04-17T13:06:37.141Z","1.0.0-feature-763216-k98ysqfx":"2020-04-20T21:01:56.668Z","1.0.0-beta.3":"2020-04-21T17:27:27.000Z","1.0.0-alpha.5":"2020-04-24T08:07:38.041Z","1.0.0-feature-35aee3-k9eantv6":"2020-04-24T14:32:53.737Z","1.0.0-alpha.6":"2020-04-24T14:39:55.756Z","1.0.0-alpha.7":"2020-04-27T09:27:47.751Z","1.0.0-alpha.8":"2020-04-28T09:57:16.825Z","1.0.0-feature-f4e6f2-k9l12az8":"2020-04-29T07:38:36.322Z","1.0.0-beta.4":"2020-04-29T12:33:23.819Z","1.0.0-alpha.9":"2020-04-29T12:35:11.043Z","1.0.0-feature-e61998-k9lcwhq6":"2020-04-29T13:10:00.424Z","1.0.0-feature-4d321d-k9ldj5dt":"2020-04-29T13:27:38.346Z","1.0.0-feature-1cd49e-k9mv3n8b":"2020-04-30T14:27:13.820Z","1.0.0-feature-c25694-k9mvblin":"2020-04-30T14:33:23.541Z","1.0.0-alpha.10":"2020-04-30T14:37:40.252Z","1.0.0-feature-1a1c0e-k9s9sldf":"2020-05-04T09:17:23.440Z","1.0.0-feature-8bf16f-k9scgzz8":"2020-05-04T10:32:20.243Z","1.0.0-feature-d57137-k9siik1a":"2020-05-04T13:21:30.014Z","1.0.0-alpha.11":"2020-05-04T13:24:50.755Z","1.0.0-beta.5":"2020-05-06T09:05:36.706Z","1.0.0-alpha.12":"2020-05-06T09:08:42.726Z","1.0.0-feature-a5609d-ka6eaisu":"2020-05-14T06:32:03.431Z","1.0.0-feature-9fb734-ka6muf4c":"2020-05-14T10:31:27.925Z","1.0.0-feature-cf7872-ka6s4zw2":"2020-05-14T12:59:41.301Z","1.0.0-feature-ba0967-ka6spfwz":"2020-05-14T13:15:34.388Z","1.0.0-feature-fdca2b-ka80w5go":"2020-05-15T09:52:32.016Z","1.0.0-feature-f8a081-ka83om83":"2020-05-15T11:10:38.404Z","1.0.0-feature-f8a081-ka83se29":"2020-05-15T11:13:34.964Z","1.0.0-feature-08ef84-kacihp9g":"2020-05-18T13:16:17.989Z","1.0.0-feature-5af654-kack573v":"2020-05-18T14:02:31.939Z","1.0.0-feature-24fd4e-kackau3v":"2020-05-18T14:06:54.107Z","1.0.0-feature-d1a6a3-kacllkus":"2020-05-18T14:43:16.120Z","1.0.0-alpha.13":"2020-05-18T14:45:21.194Z","1.0.0-feature-30326c-kadoduu9":"2020-05-19T08:49:00.562Z","1.0.0-feature-c5a39c-kadzsncz":"2020-05-19T14:08:26.117Z","1.0.0-feature-1ec9fa-kaezbhnm":"2020-05-20T06:42:49.538Z","1.0.0-alpha.14":"2020-05-20T06:46:27.787Z","1.0.0-beta.6":"2020-05-20T09:28:36.723Z","1.0.0-alpha.15":"2020-05-20T09:31:56.264Z","1.0.0-feature-d53efd-kaqtu7he":"2020-05-28T13:42:42.529Z","1.0.0-feature-bc88a8-karztpgi":"2020-05-29T09:18:02.531Z","1.0.0-alpha.16":"2020-05-29T09:19:24.612Z","1.0.0-alpha.17":"2020-06-02T14:35:14.012Z","1.0.0-beta.7":"2020-06-03T10:05:40.996Z","1.0.0-alpha.18":"2020-06-03T10:12:07.004Z","1.0.0-feature-bbffef-kb1wm9bz":"2020-06-05T07:45:56.956Z","1.0.0-feature-f7759a-kb6l4tja":"2020-06-08T14:23:22.503Z","1.0.0-alpha.19":"2020-06-08T14:25:14.593Z","1.0.0-alpha.20":"2020-06-08T14:49:36.439Z","1.0.0-beta.8":"2020-06-09T09:06:14.346Z","1.0.0-alpha.21":"2020-06-09T09:15:37.056Z","1.0.0-feature-68e2ac-kb7tgytk":"2020-06-09T11:04:29.639Z","1.0.0-feature-3fddf3-kb7y02h6":"2020-06-09T13:11:19.194Z","1.0.0-feature-c13826-kb80ejvd":"2020-06-09T14:18:34.743Z","1.0.0-feature-5ca483-kb81ikfq":"2020-06-09T14:49:43.134Z","1.0.0-feature-1d0741-kb93699u":"2020-06-10T08:23:51.343Z","1.0.0-feature-3ffcd9-kb97sjx7":"2020-06-10T10:33:10.227Z","1.0.0-feature-d9774f-kb97xwkz":"2020-06-10T10:37:19.992Z","1.0.0-feature-1004c8-kb98ov4l":"2020-06-10T10:58:18.053Z","1.0.0-feature-3c0316-kb98ovf9":"2020-06-10T10:58:33.298Z","1.0.0-feature-0f2dc4-kb9fork9":"2020-06-10T14:14:13.690Z","1.0.0-alpha.22":"2020-06-10T14:19:05.936Z","1.0.0-beta.9":"2020-06-16T07:00:05.253Z","1.0.0-alpha.23":"2020-06-16T07:03:44.389Z","1.0.0-feature-d31e0c-kbi1vhxj":"2020-06-16T14:57:24.889Z","1.0.0-feature-4997f6-kbi26rmj":"2020-06-16T15:06:12.376Z","1.0.0-alpha.24":"2020-06-16T17:12:02.487Z","1.0.0-feature-18906a-kbko7f9g":"2020-06-18T10:58:05.981Z","1.0.0-feature-46b998-kbqhp5gu":"2020-06-22T12:42:33.849Z","1.0.0-feature-e62beb-kbqhq0vu":"2020-06-22T12:43:15.181Z","1.0.0-beta.10":"2020-06-23T07:28:37.341Z","1.0.0-feature-1ed13c-kbtcp5eu":"2020-06-24T12:45:56.888Z","1.0.0-feature-b2d529-kc2160iz":"2020-06-30T14:33:05.383Z","1.0.0-feature-233c2b-kc21ln10":"2020-06-30T14:45:08.618Z","1.0.0-feature-00d40b-kc4rqd5j":"2020-07-02T12:32:15.588Z","1.0.0-alpha.25":"2020-07-02T12:38:15.865Z","1.0.0-feature-10d0d8-kc4sdbq9":"2020-07-02T12:50:03.170Z","1.0.0-feature-447604-kc5wvmho":"2020-07-03T07:44:01.086Z","1.0.0-alpha.26":"2020-07-03T07:45:44.362Z","1.0.0-alpha.27":"2020-07-06T12:04:41.397Z","1.0.0-feature-15d243-kcamqa8a":"2020-07-06T14:58:46.071Z","1.0.0-feature-be2cc2-kcan6aa5":"2020-07-06T15:11:14.528Z","1.0.0-feature-51038c-kcaqbypj":"2020-07-06T16:39:39.727Z","1.0.0-feature-15d243-kcbqk7im":"2020-07-07T09:33:49.643Z","1.0.0-feature-040e3d-kcbqulu9":"2020-07-07T09:41:55.192Z","1.0.0-feature-b46475-kcbrcjl1":"2020-07-07T09:55:51.567Z","1.0.0-feature-42f230-kcbtd5ge":"2020-07-07T10:52:17.697Z","1.0.0-feature-a7ce03-kcc0n9oj":"2020-07-07T14:16:05.131Z","1.0.0-alpha.28":"2020-07-07T19:05:55.854Z","1.0.0-beta.11":"2020-07-08T08:41:39.736Z","1.0.0-alpha.29":"2020-07-08T08:44:24.368Z","1.0.0-feature-1759db-kcd8aj10":"2020-07-08T10:37:55.493Z","1.0.0-alpha.30":"2020-07-08T14:41:05.446Z","1.0.0-feature-8a9906-kcegeh72":"2020-07-09T07:12:44.911Z","1.0.0-feature-6f6b69-kcehl700":"2020-07-09T07:45:55.766Z","1.0.0-feature-20b3ba-kceim4ih":"2020-07-09T08:14:38.672Z","1.0.0-feature-3d917d-kceix0qg":"2020-07-09T08:23:07.379Z","1.0.0-feature-1243fb-kcekc6h0":"2020-07-09T09:02:56.507Z","1.0.0-feature-1323f2-kcelh9gj":"2020-07-09T09:34:50.935Z","1.0.0-feature-31fe70-kcem6i7z":"2020-07-09T09:54:31.406Z","1.0.0-feature-6538ee-kcfwbuk9":"2020-07-10T07:26:21.220Z","1.0.0-alpha.31":"2020-07-10T07:29:46.550Z","1.0.0-feature-75d1b0-kcg0djct":"2020-07-10T09:19:41.294Z","1.0.0-feature-b7594d-kck8o23e":"2020-07-13T08:22:51.616Z","1.0.0-feature-da86ca-kck9kvfi":"2020-07-13T08:48:24.053Z","1.0.0-alpha.32":"2020-07-13T08:52:38.076Z","1.0.0-feature-60ee24-kckc8usx":"2020-07-13T10:03:01.497Z","1.0.0-feature-552f63-kckeqypg":"2020-07-13T11:13:01.504Z","1.0.0-feature-360250-kckernrv":"2020-07-13T11:13:35.225Z","1.0.0-alpha.33":"2020-07-13T12:37:51.046Z","1.0.0-feature-53a12c-kckjecy1":"2020-07-13T13:23:15.486Z","1.0.0-feature-e377d5-kckneha7":"2020-07-13T15:15:18.598Z","1.0.0-feature-497e04-kckoe5ir":"2020-07-13T15:43:01.513Z","1.0.0-feature-0852d9-kckqaugx":"2020-07-13T16:36:27.907Z","1.0.0-feature-844ba8-kclkuigz":"2020-07-14T06:51:34.249Z","1.0.0-feature-2f37b5-kclkuugf":"2020-07-14T06:51:45.756Z","1.0.0-feature-529f62-kclnmtgp":"2020-07-14T08:09:35.850Z","1.0.0-feature-df929d-kclqf6xs":"2020-07-14T09:27:36.990Z","1.0.0-feature-49e398-kclqthh3":"2020-07-14T09:38:43.999Z","1.0.0-feature-524f3f-kclrs2uf":"2020-07-14T10:05:37.400Z","1.0.0-feature-43bb87-kclruw4d":"2020-07-14T10:07:49.657Z","1.0.0-feature-159092-kclry22f":"2020-07-14T10:10:17.635Z","1.0.0-feature-959560-kcls68em":"2020-07-14T10:16:36.918Z","1.0.0-feature-060085-kcm4r7j0":"2020-07-14T16:08:51.219Z","1.0.0-alpha.34":"2020-07-14T16:12:57.153Z","1.0.0-beta.12":"2020-07-15T07:35:11.318Z","1.0.0-alpha.35":"2020-07-15T07:37:16.735Z","1.0.0-feature-558d25-kcoj8bu7":"2020-07-16T08:29:39.029Z","1.0.0-feature-8ddc94-kconbqkk":"2020-07-16T10:24:12.954Z","1.0.0-alpha.36":"2020-07-16T10:26:32.299Z","1.0.0-feature-923d06-kcpu1480":"2020-07-17T06:19:41.490Z","1.0.0-feature-4ba7bf-kcpudwo0":"2020-07-17T06:29:39.077Z","1.0.0-feature-a29fc3-kcpujytg":"2020-07-17T06:34:22.054Z","1.0.0-feature-a9c7f8-kcpv5yrq":"2020-07-17T06:51:29.932Z","1.0.0-feature-0735e4-kcpwunng":"2020-07-17T07:38:41.675Z","1.0.0-feature-bf7b58-kcpwy9ku":"2020-07-17T07:41:27.859Z","1.0.0-feature-387ea6-kcpz2pub":"2020-07-17T08:40:57.277Z","1.0.0-feature-a4b950-kcpz3j07":"2020-07-17T08:41:31.011Z","1.0.0-feature-46c4ea-kcpzftpf":"2020-07-17T08:51:06.974Z","1.0.0-feature-abe6a0-kcq477m0":"2020-07-17T11:04:23.972Z","1.0.0-feature-8f3f3c-kcvlf2xe":"2020-07-21T07:05:16.851Z","1.0.0-alpha.37":"2020-07-21T07:06:56.239Z","1.0.0-release-17b27a-kcx7lehq":"2020-07-22T10:13:49.479Z","1.0.0-beta.13":"2020-07-22T10:36:34.855Z","1.0.0-alpha.38":"2020-07-22T10:36:54.832Z","1.0.0-feature-33a491-kd5orz82":"2020-07-28T08:36:55.191Z","1.0.0-feature-ab2f0f-kd5oud5f":"2020-07-28T08:38:50.177Z","1.0.0-feature-fe745f-kd5v6rxf":"2020-07-28T11:36:33.590Z","1.0.0-feature-d4d7e4-kd5vjh4k":"2020-07-28T11:46:26.609Z","1.0.0-feature-1732d3-kd60j5xc":"2020-07-28T14:06:12.130Z","1.0.0-feature-49c611-kd72ctxg":"2020-07-29T07:44:55.876Z","1.0.0-feature-79cbd2-kd77d5fb":"2020-07-29T10:05:03.604Z","1.0.0-feature-5a909f-kd78z56k":"2020-07-29T10:50:18.309Z","1.0.0-feature-e69d34-kd7a5498":"2020-07-29T11:22:51.159Z","1.0.0-alpha.39":"2020-07-29T11:22:57.815Z","1.0.0-feature-2bf421-kd7a8u3z":"2020-07-29T11:25:47.659Z","1.0.0-alpha.40":"2020-07-29T11:27:45.399Z","1.0.0-alpha.41":"2020-07-29T11:31:00.670Z","1.0.0-beta.14":"2020-07-29T13:52:07.651Z","1.0.0-alpha.42":"2020-07-29T13:53:52.608Z","1.0.0":"2020-08-05T12:08:05.771Z","1.1.0-alpha.1":"2020-08-14T09:22:53.496Z","1.1.0-feature-b89c89-kdykcoh2":"2020-08-17T13:38:25.564Z","1.1.0-feature-8b4393-kdymjxfp":"2020-08-17T14:40:06.107Z","1.1.0-feature-f0db9e-ke142ftg":"2020-08-19T08:26:00.236Z","1.1.0-alpha.2":"2020-08-19T08:30:04.660Z","1.1.0-beta.1":"2020-08-19T09:09:33.999Z","1.1.0-alpha.3":"2020-08-19T09:11:28.773Z","1.1.0-feature-717290-ke2k9kq4":"2020-08-20T08:47:05.506Z","1.1.0-feature-716d42-ke3uvbav":"2020-08-21T06:31:46.192Z","1.1.0-feature-55cbb4-ke3xdbfe":"2020-08-21T07:41:45.772Z","1.1.0-feature-034a5f-ke483xm5":"2020-08-21T12:42:26.827Z","1.1.0-feature-3b0d13-ke49yxbc":"2020-08-21T13:34:30.826Z","1.1.0-alpha.4":"2020-08-21T14:33:14.304Z","1.1.0-feature-5ccd3c-ke4dlxwu":"2020-08-21T15:16:27.853Z","1.1.0-feature-66ee12-ke87hcd5":"2020-08-24T07:35:52.224Z","1.1.0-feature-968a64-ke87i5uu":"2020-08-24T07:36:31.032Z","1.1.0-alpha.5":"2020-08-24T07:38:58.688Z","1.1.0-feature-feb216-ke8bd3ld":"2020-08-24T09:24:36.361Z","1.1.0-alpha.6":"2020-08-25T13:42:09.812Z","1.1.0-beta.2":"2020-08-26T07:34:44.654Z","1.1.0-alpha.7":"2020-08-26T07:36:26.380Z","1.1.0-feature-611790-kei8twgu":"2020-08-31T08:11:22.045Z","1.1.0":"2020-09-02T08:56:26.293Z","1.1.0-feature-4202a4-kel7bqk2":"2020-09-02T09:52:34.042Z","1.1.0-feature-d9b11d-kemu91ut":"2020-09-03T13:22:07.108Z","1.2.0-alpha.1":"2020-09-03T13:48:47.429Z","1.2.0-feature-2929ed-kemv9mqi":"2020-09-03T13:50:33.817Z","1.2.0-feature-d33bc3-kemvcdus":"2020-09-03T13:52:39.673Z","1.2.0-alpha.2":"2020-09-03T14:00:48.854Z","1.2.0-feature-3a225d-kemvotbz":"2020-09-03T14:02:22.365Z","1.2.0-alpha.3":"2020-09-04T09:44:00.539Z","1.1.0-feature-953719-kese79d5":"2020-09-07T10:39:25.189Z","1.1.0-feature-3c4364-kesjr80z":"2020-09-07T13:14:57.728Z","1.1.0-feature-3148ae-ketlycqd":"2020-09-08T07:04:11.998Z","1.1.0-feature-125120-ketmhz1q":"2020-09-08T07:19:30.407Z","1.1.0-feature-f66cf1-ketn06zz":"2020-09-08T07:33:38.350Z","1.2.0-feature-890417-kets566g":"2020-09-08T09:57:30.311Z","1.2.0-alpha.4":"2020-09-08T13:51:06.720Z","1.2.0-feature-576806-kev5jxe7":"2020-09-09T09:00:40.997Z","1.2.0-beta.1":"2020-09-09T12:48:34.085Z","1.2.0-alpha.5":"2020-09-09T12:48:51.722Z","1.2.0-feature-bb4993-kevdxge3":"2020-09-09T12:55:07.007Z","1.2.0-feature-51cdf0-kevdz41m":"2020-09-09T12:56:22.125Z","1.2.0-alpha.6":"2020-09-09T12:57:10.436Z","1.2.0-feature-01a280-kewntif2":"2020-09-10T10:19:46.998Z","1.2.0-feature-fcf59a-kewnttc6":"2020-09-10T10:19:59.938Z","1.2.0-feature-fcf59a-kewnweu6":"2020-09-10T10:21:59.010Z","1.2.0-feature-e27d7e-kewnzbc3":"2020-09-10T10:24:12.021Z","1.2.0-feature-a1481f-kewwg997":"2020-09-10T14:21:24.109Z","1.2.0-alpha.7":"2020-09-16T07:00:42.824Z","1.2.0-beta.2":"2020-09-16T08:23:34.792Z","1.2.0-alpha.8":"2020-09-16T08:23:42.197Z","1.2.0-feature-a86d16-kfgsnrfq":"2020-09-24T12:30:42.133Z","1.2.0-feature-632a58-kfgtktcs":"2020-09-24T12:56:21.988Z","1.2.0-alpha.9":"2020-09-24T12:59:32.755Z","1.2.0-beta.3":"2020-09-24T14:20:40.232Z","1.2.0-alpha.10":"2020-09-24T14:20:59.029Z","1.2.0-alpha.11":"2020-10-01T07:52:06.867Z","1.2.0-feature-7f0d08-kfqu28m0":"2020-10-01T13:07:36.364Z","1.2.0-alpha.12":"2020-10-01T13:18:31.315Z","1.2.0-feature-f45df3-kfxqjojm":"2020-10-06T09:03:34.672Z","1.2.0-alpha.13":"2020-10-06T11:38:11.570Z","1.2.0-feature-8b089e-kfz69r71":"2020-10-07T09:11:28.260Z","1.2.0-feature-2727f1-kfz7qtg9":"2020-10-07T09:52:47.539Z","1.2.0-feature-cfe293-kfz86ib4":"2020-10-07T10:04:58.197Z","2.0.0-feature-edc40d-kfz8wd0x":"2020-10-07T10:25:04.783Z","1.2.0":"2020-10-07T11:36:28.537Z","1.2.0-alpha.14":"2020-10-07T11:38:33.252Z","1.2.0-feature-e9ec70-kfzbr7gf":"2020-10-07T11:45:07.826Z","1.2.0-feature-db3ab4-kfzeuhkr":"2020-10-07T13:11:35.543Z","1.2.0-feature-c3f1ab-kfzjunlw":"2020-10-07T15:31:42.443Z","2.0.0-feature-02c2b6-kg0o4k00":"2020-10-08T10:19:09.095Z","2.0.0-feature-2b0f71-kg0o9dic":"2020-10-08T10:22:52.358Z","1.2.0-feature-f37701-kg0wxv3j":"2020-10-08T14:25:53.106Z","1.2.0-alpha.15":"2020-10-08T15:33:08.841Z","2.0.0-alpha.1":"2020-10-08T15:42:34.099Z","2.0.0-alpha.2":"2020-10-08T15:58:32.888Z","2.0.0-alpha.3":"2020-10-08T16:15:31.314Z","2.0.0-feature-3aa0f1-kg21mz84":"2020-10-09T09:25:08.651Z","2.0.0-feature-7f6a25-kg21tzrx":"2020-10-09T09:30:35.019Z","2.0.0-alpha.4":"2020-10-09T09:37:02.514Z","2.0.0-feature-51316e-kg24k7xr":"2020-10-09T10:46:57.087Z","2.0.0-beta.1":"2020-10-14T10:27:44.926Z","2.0.0-alpha.5":"2020-10-14T10:29:04.818Z","2.0.0-feature-1240a0-kgc15zg2":"2020-10-16T09:09:38.665Z","2.0.0-feature-625201-kgcdtz6w":"2020-10-16T15:04:12.800Z","2.0.0-feature-725d71-kgkufpsg":"2020-10-22T13:11:08.541Z","2.0.0-feature-6ef479-kgkwhmp1":"2020-10-22T14:08:39.670Z","2.0.0-feature-5dd74e-kglx8hkk":"2020-10-23T07:17:15.790Z","2.0.0-feature-9ac89d-kglyw8zw":"2020-10-23T08:03:45.833Z","2.0.0-alpha.6":"2020-10-23T08:06:03.589Z","2.0.0-feature-f65e64-kglz1c6e":"2020-10-23T08:07:44.850Z","2.0.0-alpha.7":"2020-10-23T08:10:11.762Z","2.0.0-alpha.8":"2020-10-23T13:47:32.588Z","2.0.0-alpha.9":"2020-10-23T14:13:21.645Z","2.0.0-beta.2":"2020-10-28T10:28:40.047Z","2.0.0-alpha.10":"2020-10-28T10:31:08.319Z","2.0.0-feature-93211a-kgt9hvj9":"2020-10-28T10:34:55.178Z","2.0.0-beta.3":"2020-10-28T15:30:38.533Z","2.0.0-alpha.11":"2020-10-28T15:33:28.731Z","2.0.0-feature-c54d9d-kguyc6vx":"2020-10-29T14:58:05.879Z","2.0.0-feature-ae0416-kgw48tnt":"2020-10-30T10:31:09.535Z","2.0.0-alpha.12":"2020-11-02T09:13:26.567Z","2.0.0-feature-fb9b44-kh1tnhji":"2020-11-03T10:21:16.930Z","2.0.0-alpha.13":"2020-11-03T16:22:47.832Z","2.0.0-feature-1981fb-kh27krsi":"2020-11-03T16:51:08.338Z","2.0.0-feature-287111-kh2fxshz":"2020-11-03T20:45:09.788Z","2.0.0-alpha.14":"2020-11-03T20:47:00.106Z","2.0.0-feature-012698-kh38b8zn":"2020-11-04T09:59:26.409Z","2.0.0-feature-916f68-kh3fxb0r":"2020-11-04T13:32:33.590Z","2.0.0-feature-1de19b-kh3ijkox":"2020-11-04T14:45:56.330Z","2.0.0-feature-51071f-kh3ilwvy":"2020-11-04T14:47:41.169Z","2.0.0-alpha.15":"2020-11-04T14:50:55.520Z","2.0.0-feature-67813f-kh3keapy":"2020-11-04T15:37:44.029Z","2.0.0-feature-b89d5e-kh3kysv9":"2020-11-04T15:53:41.437Z","2.0.0-alpha.16":"2020-11-05T07:54:50.227Z","2.0.0-feature-0644f4-kh4lmz3l":"2020-11-05T09:00:15.471Z","2.0.0-feature-a2a8d2-kh4lr2oj":"2020-11-05T09:03:27.108Z","2.0.0-alpha.17":"2020-11-05T09:26:32.858Z","2.0.0-alpha.18":"2020-11-05T10:09:55.657Z","2.0.0-feature-4a7b82-kh4qs7u1":"2020-11-05T11:24:17.080Z","2.0.0-feature-8b46fc-kh4s50v3":"2020-11-05T12:02:15.145Z","2.0.0-alpha.19":"2020-11-05T13:36:23.453Z","2.0.0-beta.4":"2020-11-06T10:25:43.385Z","2.0.0-alpha.20":"2020-11-06T10:25:52.244Z","2.0.0":"2020-11-11T12:03:15.570Z","2.0.0-beta.5":"2020-11-11T12:03:29.591Z","2.0.1-hotfix-ede8c1-khejphka":"2020-11-12T08:03:53.840Z","2.0.1":"2020-11-12T09:36:01.452Z","2.1.0-beta.1":"2020-11-12T09:38:58.816Z","2.1.0-alpha.1":"2020-11-19T13:44:37.693Z","2.1.0-feature-8b1187-khum1upm":"2020-11-23T13:53:50.042Z","2.1.0-feature-9e9e8d-khvqfj4e":"2020-11-24T08:44:09.898Z","2.1.0-feature-65ac47-khvqn0ys":"2020-11-24T08:50:02.725Z","2.1.0-feature-bef1e9-khvqrkx5":"2020-11-24T08:53:36.077Z","2.1.0-feature-8ed657-khvsxg03":"2020-11-24T09:54:06.912Z","2.1.0-feature-531f3a-khvthzxn":"2020-11-24T10:10:05.235Z","2.1.0-feature-c55038-khvtl821":"2020-11-24T10:12:38.234Z","2.1.0-alpha.2":"2020-11-24T14:39:58.836Z","2.1.0-beta.2":"2020-11-25T11:47:14.418Z","2.1.0-alpha.3":"2020-11-25T11:47:25.480Z","2.1.0":"2020-12-02T09:09:41.925Z","2.1.0-alpha.4":"2020-12-02T09:09:51.236Z","2.2.0-feature-b82451-kjtx7n3b":"2021-01-12T11:37:56.611Z","2.2.0-feature-a4d644-kjty8dur":"2021-01-12T12:06:28.961Z","2.2.0-feature-097eda-kjtyde5x":"2021-01-12T12:10:23.344Z","2.2.0-feature-a678f3-kju2wsk7":"2021-01-12T14:17:27.710Z","2.2.0-feature-152dea-kju60mbe":"2021-01-12T15:44:19.772Z","2.2.0-alpha.1":"2021-01-13T08:31:54.088Z","2.2.0-feature-e5a547-kjv9oqym":"2021-01-13T10:14:55.096Z","2.2.0-alpha.2":"2021-01-13T12:04:37.349Z","2.1.0-hotfix-295f60-kjvhyiaa":"2021-01-13T14:06:30.716Z","2.1.0-hotfix-e9b7ba-kjvlsqtm":"2021-01-13T15:53:57.246Z","2.1.1-hotfix-d87b50-kjvqelab":"2021-01-13T18:02:52.708Z","2.1.1":"2021-01-13T18:07:29.535Z","2.1.1-beta.1":"2021-01-13T18:09:03.661Z","2.2.0-alpha.3":"2021-01-13T18:11:04.339Z","2.2.0-beta.1":"2021-01-14T10:55:08.848Z","2.2.0-feature-c25f24-kk78k453":"2021-01-21T19:16:32.488Z","2.2.0-feature-e04399-kk78rpu8":"2021-01-21T19:22:24.752Z","3.0.0-feature-504c05-kk797519":"2021-01-21T19:34:23.076Z","2.2.0-feature-cdd56b-kk7abf23":"2021-01-21T20:05:43.053Z","2.2.0-feature-7cc8f7-kk7ckmi4":"2021-01-21T21:08:56.025Z","2.2.0-feature-bf967a-kk7d7tjs":"2021-01-21T21:27:00.766Z","2.2.0-feature-ba5a52-kk81obns":"2021-01-22T08:51:38.287Z","2.2.0-alpha.5":"2021-01-22T09:01:25.598Z","2.2.0-feature-d203e0-kk82av9f":"2021-01-22T09:09:06.232Z","2.2.0-alpha.6":"2021-01-22T09:20:15.985Z","2.2.0-feature-85c129-kk82romu":"2021-01-22T09:22:12.040Z","2.2.0-feature-6685e7-kk858xpn":"2021-01-22T10:31:36.885Z","2.2.0-alpha.7":"2021-01-22T10:35:15.073Z","2.2.0-feature-b00a83-kkcq1cf8":"2021-01-25T15:24:42.394Z","2.2.0-feature-8b14e5-kkdopklx":"2021-01-26T07:35:17.436Z","2.2.0-beta.2":"2021-02-06T15:55:02.788Z","2.2.0-alpha.8":"2021-02-06T15:56:09.497Z","2.2.0-betafix-d06880-kkz91yh9":"2021-02-10T09:47:58.686Z","2.2.0-beta.3":"2021-02-11T08:34:55.688Z","2.2.0":"2021-02-11T09:43:58.356Z","2.2.0-beta.4":"2021-02-11T09:44:05.975Z","2.3.0-alpha.1":"2021-02-11T09:47:35.692Z","2.2.0-feature-57f592-kl0prrc9":"2021-02-11T10:23:42.337Z","2.2.0-feature-a19034-kl0pshy3":"2021-02-11T10:24:13.675Z","2.2.0-feature-ce9530-kl0vmct1":"2021-02-11T13:07:30.084Z","2.3.0-feature-98b0cd-kl0ywvlg":"2021-02-11T14:39:45.118Z","2.3.0-alpha.2":"2021-02-12T08:12:56.357Z","2.3.0-feature-27d1a0-kl6g526r":"2021-02-15T10:40:44.355Z","2.3.0-feature-9be3ec-kl6gu0rm":"2021-02-15T11:00:10.664Z","2.3.0-feature-f975d5-kl6i77pn":"2021-02-15T11:38:25.977Z","2.3.0-feature-96d790-kl6kxfkh":"2021-02-15T12:54:42.899Z","2.3.0-alpha.3":"2021-02-15T13:34:16.444Z","2.3.0-beta.1":"2021-02-16T16:51:48.162Z","2.3.0-alpha.4":"2021-02-16T16:52:02.035Z","2.3.0-feature-9db248-klc3ebf4":"2021-02-19T09:30:39.761Z","2.3.0-feature-911f88-klc4dpaf":"2021-02-19T09:58:08.477Z","2.3.0-feature-9926f4-klgahizi":"2021-02-22T08:00:14.838Z","2.3.0-feature-ce5c7c-klgb10fk":"2021-02-22T08:15:21.764Z","2.3.0-feature-6ffe60-klgcq1gl":"2021-02-22T09:02:47.005Z","2.3.0-feature-dd3f31-klgcrl7y":"2021-02-22T09:03:57.239Z","2.3.0-feature-9003dd-klgcs0ev":"2021-02-22T09:04:19.561Z","2.3.0-feature-272620-klgctuue":"2021-02-22T09:05:50.435Z","2.3.0-feature-3b4e72-klgj3tyt":"2021-02-22T12:01:31.191Z","2.3.0-alpha.5":"2021-02-22T13:32:00.250Z","2.3.0-feature-8d02ef-klhrc2pj":"2021-02-23T08:39:37.951Z","2.3.0-alpha.6":"2021-02-23T10:05:36.731Z","2.3.0-alpha.7":"2021-02-23T13:21:56.725Z","2.3.0-feature-fc343d-klj86w87":"2021-02-24T09:19:10.571Z","2.3.0-alpha.8":"2021-02-25T11:26:46.129Z","2.3.0-beta.2":"2021-02-25T11:56:42.966Z","2.3.0-alpha.9":"2021-02-25T11:57:07.684Z","2.3.0-feature-b89d04-klkyln1s":"2021-02-25T14:26:17.019Z","2.3.0-alpha.10":"2021-02-26T15:56:37.343Z","2.3.0-feature-24b1ca-klrr323p":"2021-03-02T08:30:16.287Z","2.3.0-alpha.11":"2021-03-02T08:34:14.018Z","2.3.0-beta.3":"2021-03-03T15:51:26.357Z","2.3.0-alpha.12":"2021-03-03T15:51:34.001Z","2.3.0-feature-897d9a-kluiyqv2":"2021-03-04T07:06:19.950Z","2.3.0-feature-b948bf-km0yq4ii":"2021-03-08T19:14:10.280Z","2.3.0-feature-cd60b7-km0yr826":"2021-03-08T19:14:56.906Z","2.3.0-feature-b68307-km1uoyyn":"2021-03-09T10:09:02.853Z","2.3.0-feature-74f5cb-km2b1kjr":"2021-03-09T17:46:42.262Z","2.3.0-betafix-c74fd6-km38zltq":"2021-03-10T09:37:06.610Z","2.3.0-betafix-c875f3-km3cw6d2":"2021-03-10T11:26:16.129Z","2.3.0-beta.4":"2021-03-10T11:43:32.064Z","2.3.0-alpha.13":"2021-03-10T11:45:55.198Z","2.3.0":"2021-03-12T13:19:28.705Z","2.3.0-beta.5":"2021-03-12T13:19:43.725Z","2.4.0-alpha.1":"2021-03-12T13:20:57.455Z","2.4.0-feature-2059b5-kmbtkqnj":"2021-03-16T09:35:25.564Z","2.3.0-hotfix-ac48ea-kmc5snkb":"2021-03-16T15:17:31.736Z","2.3.1-hotfix-678da9-kmeotf2t":"2021-03-18T09:45:28.663Z","2.3.1-hotfixes-1a397a-kmgdwhti":"2021-03-19T14:15:27.232Z","2.3.1-hotfix-dbcb82-kmge2lwb":"2021-03-19T14:20:19.813Z","2.3.1":"2021-03-19T16:38:55.296Z","2.3.1-beta.1":"2021-03-19T16:39:48.384Z","2.4.0-alpha.2":"2021-03-19T16:40:51.703Z","2.3.0-feature-ae4949-kmkb41pq":"2021-03-22T08:08:30.687Z","2.4.0-feature-27ac61-kmkcmp8q":"2021-03-22T08:50:58.740Z","2.4.0-feature-8ea21d-kmkd2c3m":"2021-03-22T09:03:08.967Z","2.4.0-feature-0940d7-kmkk776p":"2021-03-22T12:22:54.664Z","2.3.1-feature-6692a1-kmlr8pb2":"2021-03-23T08:27:52.195Z","2.3.1-feature-0c81bd-kmlsuctp":"2021-03-23T09:12:39.060Z","2.3.1-hotfixes-2a2404-kmlswu51":"2021-03-23T09:14:29.974Z","2.4.0-alpha.3":"2021-03-23T09:47:41.901Z","2.3.1-feature-3c704b-kmlyfgdj":"2021-03-23T11:48:59.494Z","2.3.1-feature-547f71-kmlz6h86":"2021-03-23T12:10:03.429Z","2.3.1-hotfixes-8717de-kmlz8sth":"2021-03-23T12:11:52.042Z","2.4.0-feature-6bec9b-kmp9a2oh":"2021-03-25T19:16:01.367Z","2.4.0-alpha.4":"2021-03-30T09:21:57.849Z","2.4.0-feature-4fc2ec-kmvz8jl0":"2021-03-30T12:09:11.207Z","2.4.0-hotfixes-cdf151-kmz3cd51":"2021-04-01T16:27:32.619Z","2.3.2-hotfixes-06cf07-kmz6ntql":"2021-04-01T18:00:26.350Z","2.3.2":"2021-04-01T18:00:31.574Z","2.3.2-beta.1":"2021-04-01T18:01:24.442Z","2.3.2-alpha.1":"2021-04-01T18:01:32.766Z","2.3.2-hotfix-78ae2c-kn8tqw74":"2021-04-08T11:56:39.610Z","2.3.2-hotfix-338bcc-kna30cu0":"2021-04-09T09:03:41.074Z","2.3.2-feature-4def57-kngcid4c":"2021-04-13T18:16:11.500Z","2.3.2-feature-f80e03-knhcm2vu":"2021-04-14T11:06:50.833Z","2.3.2-feature-9a3233-knhcvq8n":"2021-04-14T11:14:23.919Z","2.3.2-feature-35c950-knhjrw2q":"2021-04-14T14:27:20.547Z","2.3.2-feature-5efbf8-knhkzevj":"2021-04-14T15:01:07.322Z","2.3.2-feature-9b0c74-knhpx1tm":"2021-04-14T17:19:16.857Z","2.3.2-hotfix-b44d1e-knj7igca":"2021-04-15T18:19:41.051Z","2.3.2-feature-9b930b-knk14po0":"2021-04-16T08:08:43.831Z","2.3.2-feature-d0e468-knk1c6xh":"2021-04-16T08:14:27.878Z","2.3.3-feature-90f794-knkaz2fw":"2021-04-16T12:44:17.496Z","2.3.3-feature-209212-knkepnfk":"2021-04-16T14:28:56.150Z","2.3.3-feature-72344c-knkf3ki2":"2021-04-16T14:39:46.472Z","2.3.2-hotfix-9b74db-knoaubro":"2021-04-19T07:51:42.582Z","2.3.2-hotfix-16235a-knobmpsd":"2021-04-19T08:13:49.677Z","2.3.2-hotfixes-4290f4-knoccr5w":"2021-04-19T08:34:03.984Z","2.3.2-hotfix-44140f-knopxn6t":"2021-04-19T14:54:10.652Z","2.3.2-hotfixes-546291-knoq070n":"2021-04-19T14:56:09.796Z","2.3.3-feature-b03208-knoudiac":"2021-04-19T16:58:31.165Z","2.3.3-hotfixes-e924e2-knq35xhi":"2021-04-20T13:52:19.255Z","2.3.3-hotfixes-ddc7fd-knqf4gnc":"2021-04-20T19:27:05.913Z","2.3.3":"2021-04-20T19:27:36.244Z","2.3.3-beta.1":"2021-04-20T19:30:35.175Z","2.3.3-alpha.1":"2021-04-20T19:31:25.602Z","2.3.3-hotfix-69d93b-kobg3an5":"2021-05-05T12:37:21.316Z","2.3.3-hotfix-dbb364-kocw9r53":"2021-05-06T12:58:01.760Z","2.3.3-alpha.2":"2021-05-06T13:19:10.033Z","2.3.3-hotfixes-7e258e-kocx4v2s":"2021-05-06T13:22:14.383Z","2.3.3-hotfix-a98bc0-koiexpmc":"2021-05-10T09:39:27.881Z","2.3.3-hotfixes-be3efc-koiirq2t":"2021-05-10T11:26:40.870Z","2.3.4-hotfixes-aef401-kok19wvn":"2021-05-11T12:52:28.958Z","2.3.4":"2021-05-11T12:52:40.362Z","2.3.4-beta.1":"2021-05-11T12:53:20.894Z","2.3.4-alpha.1":"2021-05-11T12:53:59.110Z","2.3.3-hotfix-a4f26b-kol8mh6w":"2021-05-12T09:05:55.796Z","2.3.4-hotfix-f19a41-kos9up27":"2021-05-17T07:14:45.301Z","2.3.4-hotfix-2f135a-kou9phcl":"2021-05-18T16:46:13.634Z","2.3.4-hotfixes-f3e89e-kov6w64i":"2021-05-19T08:15:13.922Z","2.3.4-hotfixes-242576-kov8bxm0":"2021-05-19T08:55:24.702Z","2.3.4-feature-d4db8e-kovaf9pc":"2021-05-19T09:53:56.380Z","2.3.4-feature-8d1e77-kovarbzq":"2021-05-19T10:03:23.384Z","2.3.5":"2021-05-19T13:40:56.595Z","2.3.5-hotfixes-7c5653-kovijao5":"2021-05-19T13:41:08.368Z","2.3.5-beta.1":"2021-05-19T13:41:32.280Z","2.3.5-alpha.1":"2021-05-19T13:41:58.198Z","2.3.5-feature-0d9b92-koviojv9":"2021-05-19T13:45:10.107Z","2.3.5-feature-77d6de-kovmjm20":"2021-05-19T15:33:18.013Z","2.3.5-feature-ffefab-kovr1gij":"2021-05-19T17:39:05.511Z","2.3.6-feature-ffc7d9-kp4450qk":"2021-05-25T14:08:04.430Z","2.3.5-feature-3c0088-kp574ql0":"2021-05-26T08:19:32.200Z","2.3.5-feature-adf0ce-kp584bni":"2021-05-26T08:47:06.764Z","2.3.5-feature-36862c-kp5b1bfh":"2021-05-26T10:08:47.847Z","2.3.5-feature-4761dd-kp5dvado":"2021-05-26T11:28:04.559Z","2.3.5-feature-55d189-kp5ihw39":"2021-05-26T13:37:42.251Z","2.3.5-feature-016b69-kp5nk2xy":"2021-05-26T15:59:18.189Z","2.4.0-feature-fb894d-kp5q9zee":"2021-05-26T17:15:25.990Z","2.4.0-alpha.5":"2021-05-26T17:22:17.526Z","2.4.0-alpha.6":"2021-05-28T07:03:24.697Z","3.0.0-alpha.1":"2021-05-28T07:18:48.407Z","3.0.0-alpha.2":"2021-05-28T11:39:38.667Z","3.0.0-alpha.3":"2021-05-28T12:06:02.436Z","2.3.6-hotfix-b9ff4d-kpe8wgw1":"2021-06-01T16:19:03.585Z","2.3.6":"2021-06-02T15:15:42.206Z","2.3.6-hotfixes-7338e8-kpfm342j":"2021-06-02T15:15:52.664Z","2.3.6-beta.1":"2021-06-02T15:16:32.832Z","3.0.0-alpha.4":"2021-06-02T15:17:29.945Z","2.3.6-hotfix-ae8feb-kpmjtyus":"2021-06-07T11:47:16.787Z","3.0.0-feature-7d4801-kpmlctfv":"2021-06-07T12:29:49.438Z","3.0.0-feature-f79c64-kpmml00t":"2021-06-07T13:04:09.117Z","2.3.6-hotfix-8a204f-kpnobvpi":"2021-06-08T06:40:54.175Z","2.3.6-hotfixes-b80212-kpnoezb1":"2021-06-08T06:43:17.205Z","3.0.0-feature-028852-kpnt77di":"2021-06-08T08:57:05.948Z","3.0.0-alpha.5":"2021-06-08T08:58:35.983Z","3.0.0-feature-87f794-kpp3ku50":"2021-06-09T06:35:25.193Z","3.0.0-feature-015c9b-kpqmvlg7":"2021-06-10T08:23:25.614Z","3.0.0-feature-b4f6dd-kpqxgc7d":"2021-06-10T13:19:33.839Z","3.0.0-feature-898b94-kq0sn53c":"2021-06-17T11:02:32.132Z","3.0.0-beta.1":"2021-06-18T14:22:51.810Z","3.0.0-beta.2":"2021-06-18T14:34:26.963Z","3.0.0-feature-451e1e-kq6i2mvc":"2021-06-21T10:53:28.593Z","3.0.0-feature-937c17-kq6i3jbx":"2021-06-21T10:53:59.737Z","3.0.0-feature-bfe7dd-kq6n9wc8":"2021-06-21T13:18:52.031Z","3.0.0-feature-98198f-kq6p9g3v":"2021-06-21T14:14:29.105Z","3.0.0-feature-637971-kq6phcuu":"2021-06-21T14:20:40.956Z","3.0.0-alpha.6":"2021-06-21T14:22:15.642Z","3.0.0-alpha.7":"2021-06-21T14:23:45.173Z","3.0.0-feature-c7aa56-kq6prfyd":"2021-06-21T14:28:31.262Z","3.0.0-alpha.8":"2021-06-22T13:17:04.566Z","3.0.0-feature-e0ac74-kqgcl4ff":"2021-06-28T08:17:21.841Z","2.3.7":"2021-07-01T12:38:44.937Z","3.0.0-beta.3":"2021-07-01T12:43:54.712Z","3.0.0-alpha.9":"2021-07-01T12:44:01.810Z","3.0.0-feature-3c36e9-kqkwuqq8":"2021-07-01T12:55:50.875Z","3.0.0-feature-29ab5f-krbzsrg0":"2021-07-20T11:48:06.230Z","3.0.0-feature-0f5c90-kremznkr":"2021-07-22T08:12:49.326Z","3.0.0-feature-e74bd9-kreqpz11":"2021-07-22T09:57:10.821Z","3.0.0-feature-e884c1-kretd8p2":"2021-07-22T11:11:17.468Z","3.0.0-feature-a7d9bc-kreu7pob":"2021-07-22T11:34:58.799Z","2.3.7-hotfix-a8b9c5-krfz7y9j":"2021-07-23T06:42:56.767Z","2.3.7-hotfix-16c86a-krfzco6z":"2021-07-23T06:46:37.322Z","2.3.7-hotfix-87a708-krfzrz6y":"2021-07-23T06:58:32.328Z","2.3.7-hotfixes-3392a0-krg0cr2g":"2021-07-23T07:14:45.596Z","3.0.0-feature-b81d1a-krg11tzo":"2021-07-23T07:34:14.209Z","3.0.0-alpha.10":"2021-07-23T08:54:39.028Z","3.0.0-feature-5cfc41-krg3y92m":"2021-07-23T08:55:18.658Z","3.0.0-feature-628ee0-krg3ygc2":"2021-07-23T08:55:30.118Z","3.0.0-feature-2f11a6-krg422tx":"2021-07-23T08:58:23.087Z","3.0.0-feature-3bdcd0-krg427h8":"2021-07-23T08:58:32.961Z","2.3.8":"2021-07-23T10:05:43.620Z","2.3.8-hotfixes-56401b-krg6gpit":"2021-07-23T10:05:48.706Z","2.3.8-alpha.1":"2021-07-23T10:06:03.409Z","3.0.0-alpha.11":"2021-07-23T10:09:00.746Z","3.0.0-feature-16ef0e-krg6nj80":"2021-07-23T10:10:59.339Z","3.0.0-beta.4":"2021-07-23T10:13:50.049Z","3.0.0-alpha.12":"2021-07-23T10:14:03.824Z","3.0.0-feature-845c9c-krg6stkt":"2021-07-23T10:15:05.677Z","3.0.0-feature-0d34a4-krg6t9s6":"2021-07-23T10:15:26.906Z","3.0.0-feature-aa9697-krgar090":"2021-07-23T12:05:39.774Z","3.0.0-alpha.13":"2021-07-23T12:08:57.828Z","3.0.0-feature-c46bb0-krgaz3lq":"2021-07-23T12:11:56.949Z","3.0.0-feature-82d41e-krkpr5ek":"2021-07-26T14:16:50.445Z","3.0.0-feature-9a5f47-krkqvt86":"2021-07-26T14:48:24.872Z","3.0.0-feature-af91db-krlswxxk":"2021-07-27T08:33:02.927Z","3.0.0-feature-2d1dbc-krlzlp3k":"2021-07-27T11:40:13.469Z","3.0.0-feature-c565bc-krm3ptce":"2021-07-27T13:35:24.419Z","3.0.0-feature-51f0ac-krm64alc":"2021-07-27T14:42:38.775Z","3.0.0-feature-c3ca8e-krm7550d":"2021-07-27T15:11:17.894Z","3.0.0-feature-930014-krowp856":"2021-07-29T12:42:15.864Z","3.0.0-feature-93172e-krp873ty":"2021-07-29T18:04:07.698Z","3.0.0-alpha.14":"2021-07-29T18:05:52.409Z","3.0.0-feature-b9f41f-krp8eask":"2021-07-29T18:09:49.348Z","3.0.0-feature-981ac2-krp8fx7q":"2021-07-29T18:10:59.392Z","3.0.0-beta.5":"2021-07-30T08:06:24.030Z","3.0.0-alpha.15":"2021-07-30T08:06:42.303Z","3.0.0-feature-ec37a4-krq2c3mf":"2021-07-30T08:07:49.809Z","3.0.0-feature-e627b9-krq2p1dm":"2021-07-30T08:17:53.080Z","3.0.0-feature-11c0ce-krq2qbl1":"2021-07-30T08:18:56.791Z","3.0.0-feature-5e4d1b-krq8fcty":"2021-07-30T10:58:18.986Z","3.0.0-feature-a8d43c-krqb2z57":"2021-07-30T12:12:40.569Z","3.0.0-feature-06aedd-kruv6aw8":"2021-08-02T16:46:14.608Z","3.0.0-alpha.16":"2021-08-02T16:47:51.135Z","3.0.0-feature-08df19-kruyxag0":"2021-08-02T18:31:14.457Z","3.0.0-beta.6":"2021-08-03T11:44:25.887Z","3.0.0":"2021-08-03T12:35:32.894Z","3.0.0-feature-41475a-krw1rrf0":"2021-08-03T12:38:37.852Z","3.0.0-hotfix-85515b-krxhlkbp":"2021-08-04T12:49:32.309Z","3.0.1-hotfix-3d8055-krxhomu6":"2021-08-04T12:51:50.771Z","3.0.1-hotfix-3bb287-krxk66za":"2021-08-04T14:01:28.448Z","3.0.1":"2021-08-04T14:03:26.320Z","3.0.1-beta.1":"2021-08-04T14:08:18.737Z","3.0.1-feature-1700b4-krxmvnjb":"2021-08-04T15:17:21.874Z","3.0.2":"2021-08-09T12:58:25.471Z","3.0.2-beta.1":"2021-08-09T12:59:03.183Z","3.0.2-alpha.1":"2021-08-09T12:59:56.035Z","3.0.2-feature-d39293-ks5seqhp":"2021-08-10T08:14:20.638Z","3.0.3-hotfix-57a74d-ksa79jgm":"2021-08-13T10:21:14.342Z","3.0.3":"2021-08-13T10:44:58.807Z","3.0.3-alpha.1":"2021-08-13T10:47:03.812Z","3.0.3-beta.1":"2021-08-13T10:47:22.391Z","3.0.3-feature-ede14e-ksaencrg":"2021-08-13T13:47:52.707Z","3.0.3-feature-a4acb9-ksg4bxqv":"2021-08-17T13:45:40.994Z","3.0.3-hotfix-fdfe72-ksg513ed":"2021-08-17T14:05:19.473Z","3.0.4-hotfix-68baca-ksg54jbm":"2021-08-17T14:07:55.020Z","3.0.4":"2021-08-17T14:12:54.110Z","3.0.4-beta.1":"2021-08-17T14:16:03.180Z","3.0.4-alpha.1":"2021-08-17T14:16:10.525Z","3.0.4-feature-9ab6a8-ksg5msfk":"2021-08-17T14:22:14.153Z","3.0.4-feature-2e967f-ksizstfg":"2021-08-19T14:02:12.015Z","3.0.4-feature-d9bcb4-ksk4p88f":"2021-08-20T09:07:13.617Z","3.0.4-feature-de9741-ksk99squ":"2021-08-20T11:15:04.339Z","3.0.4-feature-e34104-kszv407j":"2021-08-31T09:22:56.219Z","3.0.4-alpha.2":"2021-08-31T13:14:35.583Z","3.0.4-hotfix-2c363c-kt07nqgh":"2021-08-31T15:14:18.026Z","3.0.4-hotfix-766ef6-kt2praaa":"2021-09-02T09:16:24.802Z","3.0.4-hotfix-2cf296-kt2puq3i":"2021-09-02T09:19:06.453Z","3.0.5-hotfix-8a56d3-kt48qm62":"2021-09-03T10:55:36.677Z","3.0.5":"2021-09-03T10:57:37.847Z","3.0.5-beta.1":"2021-09-03T12:24:48.315Z","3.0.5-alpha.1":"2021-09-03T12:26:08.526Z","3.0.5-feature-a4238f-kt8hgfwy":"2021-09-06T10:10:46.732Z","3.0.5-feature-87a74a-kt8hh2lq":"2021-09-06T10:11:09.487Z","3.0.5-feature-2cd4ca-kt8ir3f7":"2021-09-06T10:46:55.553Z","3.0.5-feature-bd74c3-kt8kwlru":"2021-09-06T11:47:19.812Z","3.0.5-feature-0adc1b-kt8njett":"2021-09-06T13:00:57.996Z","3.0.6-hotfix-9ad571-ktcmsrjn":"2021-09-09T07:51:17.268Z","3.0.6":"2021-09-09T07:59:37.959Z","3.0.6-beta.1":"2021-09-09T08:00:27.633Z","3.0.6-alpha.1":"2021-09-09T08:01:33.655Z","3.0.6-feature-cdd707-ktcnymqx":"2021-09-09T08:23:55.905Z","3.0.6-feature-12e9f3-ktjtcmip":"2021-09-14T08:29:03.947Z","3.1.0-feature-d44aca-ktjwigdt":"2021-09-14T09:57:41.971Z","3.1.0-feature-109523-ktjwipel":"2021-09-14T09:57:52.084Z","3.1.0-feature-738f38-ktjwj5u2":"2021-09-14T09:58:08.650Z","3.1.0-feature-4b8f5d-ktjwjgba":"2021-09-14T09:58:24.999Z","3.1.0-feature-7200cb-ktjwye0m":"2021-09-14T10:09:58.912Z","3.1.0-feature-e8f4ef-ktjxz9wu":"2021-09-14T10:38:38.973Z","3.0.6-feature-0cb867-ktjy8q96":"2021-09-14T10:46:05.266Z","3.1.0-feature-88c080-ktjy9b6o":"2021-09-14T10:46:35.087Z","3.1.0-feature-136fd6-ktjzscsz":"2021-09-14T11:29:15.697Z","3.1.0-alpha.1":"2021-09-14T11:30:08.211Z","3.1.0-feature-74b3b8-ktjzvja8":"2021-09-14T11:31:50.146Z","3.1.0-feature-093c1a-ktk046y9":"2021-09-14T11:38:34.288Z","3.1.0-alpha.2":"2021-09-14T11:59:36.847Z","3.1.0-feature-d380ab-ktk1087f":"2021-09-14T12:03:27.611Z","3.1.0-feature-d6072c-ktk112zm":"2021-09-14T12:04:03.671Z","3.1.0-feature-46cbc2-ktk11pgn":"2021-09-14T12:04:36.470Z","3.1.0-feature-404418-ktk46pru":"2021-09-14T13:32:24.281Z","3.1.0-alpha.3":"2021-09-14T13:35:13.880Z","3.1.0-feature-5375e1-ktk4f10z":"2021-09-14T13:38:57.295Z","3.1.0-feature-7f6b66-ktk4gbww":"2021-09-14T13:39:53.443Z","3.1.0-feature-ef7fbd-ktk4hhxa":"2021-09-14T13:40:47.996Z","3.0.7":"2021-09-14T14:07:48.131Z","3.0.7-beta.1":"2021-09-14T14:08:50.162Z","3.1.0-alpha.4":"2021-09-14T14:09:59.988Z","3.1.0-feature-335261-ktk867yx":"2021-09-14T15:23:59.124Z","3.1.0-feature-a304c1-ktk88kap":"2021-09-14T15:25:55.332Z","3.1.0-feature-cc0a2f-ktk8aiew":"2021-09-14T15:27:26.452Z","3.1.0-feature-0dd132-ktlcw0lo":"2021-09-15T10:23:48.790Z","3.1.0-feature-1247be-ktlcxu3q":"2021-09-15T10:25:15.181Z","3.1.0-alpha.5":"2021-09-15T10:27:04.857Z","3.1.0-feature-cdcfd7-ktld9w75":"2021-09-15T10:34:35.409Z","3.1.0-feature-d6e585-ktldauzr":"2021-09-15T10:35:20.984Z","3.1.0-feature-735faa-kttz4fef":"2021-09-21T11:08:26.691Z","3.1.0-feature-4eba40-ktu026nc":"2021-09-21T11:34:40.075Z","3.1.0-feature-491f7a-ktu44qc6":"2021-09-21T13:28:39.171Z","3.1.0-feature-9ef297-ktu8d7rk":"2021-09-21T15:27:10.656Z","3.1.0-feature-e0b348-ktv8dxeq":"2021-09-22T08:15:28.491Z","3.1.0-feature-0d8333-ktvf3ayd":"2021-09-22T11:23:14.405Z","3.1.0-feature-45b58a-ktvf7jky":"2021-09-22T11:26:31.680Z","3.1.0-feature-3f7c29-ktvg7zd1":"2021-09-22T11:54:48.198Z","3.1.0-feature-70a59a-ktvhab3h":"2021-09-22T12:24:40.478Z","3.1.0-feature-3eb785-ktvhq5gq":"2021-09-22T12:36:59.094Z","3.1.0-feature-9e8787-ktvijda5":"2021-09-22T12:59:42.040Z","3.1.0-feature-dd2668-ktvju824":"2021-09-22T13:36:08.500Z","3.1.0-feature-a1e45d-ktws0nkm":"2021-09-23T10:12:53.601Z","3.1.0-feature-9dc146-ktws5lmi":"2021-09-23T10:16:42.170Z","3.1.0-alpha.6":"2021-09-23T10:19:37.450Z","3.1.0-beta.1":"2021-09-23T10:27:17.862Z","3.1.0-feature-42777f-ku73q8rw":"2021-09-30T15:38:19.020Z","3.1.0-feature-c3b656-ku73shbq":"2021-09-30T15:40:03.849Z","3.1.0-alpha.7":"2021-10-22T09:10:59.898Z","3.1.0-beta.2":"2021-10-22T09:11:15.264Z","3.1.0-feature-52d2b1-kv80l4kb":"2021-10-26T11:37:50.230Z","3.1.0-feature-69e029-kv80mumc":"2021-10-26T11:39:14.490Z","3.0.7-feature-9cb8fc-kvba0li2":"2021-10-28T18:25:09.797Z","3.0.7-feature-04ee1c-kvck6wsz":"2021-10-29T15:57:47.688Z","3.0.7-release-989ebe-kvckbjt4":"2021-10-29T16:01:22.926Z","3.2.0-alpha.1":"2021-11-02T08:48:28.404Z","3.2.0-beta.1":"2021-11-02T08:48:37.402Z","3.1.0":"2021-11-03T13:40:55.193Z","3.2.0-beta.2":"2021-11-03T13:42:51.750Z","3.2.0-feature-59fd16-kvjkow4u":"2021-11-03T13:46:08.685Z","3.2.0-feature-b5d5bc-kvjkrx7o":"2021-11-03T13:48:29.418Z","3.1.1":"2021-11-03T13:53:18.669Z","3.2.0-beta.3":"2021-11-03T13:56:05.484Z","3.2.0-alpha.3":"2021-11-03T13:56:11.673Z","3.2.0-feature-18a73b-kvjl32en":"2021-11-03T13:57:11.998Z","3.2.0-feature-a8b59c-kvjl4jby":"2021-11-03T13:58:17.344Z","3.1.2-feature-5132da-kvrzv3iz":"2021-11-09T11:13:04.683Z","3.1.2-feature-77d634-kvs0bxcw":"2021-11-09T11:26:08.074Z","3.1.2-feature-461308-kvsaqlq0":"2021-11-09T16:17:31.308Z","3.1.2":"2021-11-09T16:17:54.168Z","3.2.0-beta.4":"2021-11-09T16:20:34.868Z","3.2.0-alpha.4":"2021-11-09T16:20:49.781Z","3.2.0-feature-1e5586-kvtfsneb":"2021-11-10T11:26:45.059Z","3.2.0-feature-f79875-kvtfutli":"2021-11-10T11:28:29.297Z","3.2.0-feature-d93749-kw39vzdl":"2021-11-17T08:39:08.360Z","3.2.0-feature-2636e6-kw3a7sqn":"2021-11-17T08:48:22.813Z","3.2.0-feature-0038cd-kw3advo7":"2021-11-17T08:53:05.348Z","3.1.2-feature-01658d-kw3ahkte":"2021-11-17T08:55:56.265Z","3.1.3-feature-45628e-kw3asxt8":"2021-11-17T09:04:41.124Z","3.1.3-feature-3015e8-kw3avnar":"2021-11-17T09:06:52.550Z","3.1.3":"2021-11-17T09:08:44.366Z","3.2.0-alpha.5":"2021-11-17T09:12:05.753Z","3.2.0-beta.5":"2021-11-17T09:15:43.343Z","3.2.0-feature-79d2e2-kw3bfzwk":"2021-11-17T09:22:42.576Z","3.2.0-feature-733bc9-kw3bg91o":"2021-11-17T09:22:56.105Z","3.2.0-feature-f25e09-kw3bhkhm":"2021-11-17T09:23:50.732Z","3.2.0-feature-a6ca15-kw3bhrsr":"2021-11-17T09:24:03.120Z","3.2.0-feature-01137a-kw3dnnob":"2021-11-17T10:24:34.364Z","3.1.3-feature-47b05c-kw3i5m86":"2021-11-17T12:30:32.758Z","3.1.3-feature-f80460-kw3obgwp":"2021-11-17T15:23:05.878Z","3.2.0-feature-028b3b-kw680jue":"2021-11-19T10:09:56.957Z","3.1.3-feature-29ce55-kwakw3mc":"2021-11-22T11:21:32.038Z","3.2.0-feature-06361c-kwamkj4k":"2021-11-22T12:08:31.154Z","3.2.0":"2021-11-22T12:12:02.306Z","3.2.0-feature-a262e5-kwamupat":"2021-11-22T12:16:28.540Z","3.2.0-feature-d12934-kwamuz7g":"2021-11-22T12:16:36.453Z","3.2.0-feature-a1f19d-kwamx3yz":"2021-11-22T12:18:21.229Z","3.3.0-feature-6d857f-kwamxlda":"2021-11-22T12:18:37.674Z","3.3.0-alpha.1":"2021-11-22T12:18:48.829Z","3.3.0-feature-d76c0b-kwamxza4":"2021-11-22T12:18:55.349Z","3.3.0-feature-2ea9b7-kwamy2e8":"2021-11-22T12:19:02.134Z","3.2.0-feature-e168dc-kwaowhld":"2021-11-22T13:13:49.432Z","3.2.0-feature-af0eb7-kwc547h0":"2021-11-23T13:35:25.035Z","3.3.0-feature-6faa82-kwc8t2vj":"2021-11-23T15:18:52.848Z","3.3.0-feature-6a1f7d-kwd9aowa":"2021-11-24T08:20:12.549Z","3.3.0-feature-8ba4dd-kwet3amu":"2021-11-25T10:22:06.065Z","3.2.1":"2021-11-25T14:35:55.016Z","3.3.0-beta.1":"2021-11-25T14:38:41.269Z","3.3.0-feature-3bd033-kwf2kdls":"2021-11-25T14:47:18.827Z","3.3.0-feature-f1b686-kwf2m34r":"2021-11-25T14:48:40.181Z","3.3.0-feature-1b798b-kwf2obf6":"2021-11-25T14:50:23.960Z","3.3.0-feature-874cbb-kwg8gnc9":"2021-11-26T10:20:11.028Z","3.3.0-alpha.3":"2021-11-26T10:27:33.656Z","3.3.0-alpha.4":"2021-11-26T11:26:11.283Z","3.3.0-alpha.5":"2021-11-26T11:51:50.035Z","3.3.0-feature-3ce44d-kwgidjxb":"2021-11-26T14:57:44.656Z","3.3.0-feature-7dbe42-kwgig92l":"2021-11-26T14:59:53.044Z","3.3.0-feature-56a746-kwgincrn":"2021-11-26T15:05:21.893Z","3.3.0-feature-d4ce1c-kwko9tud":"2021-11-29T12:53:55.774Z","3.3.0-feature-f6d9cf-kwkph9jc":"2021-11-29T13:27:38.524Z","3.3.0-feature-0605c9-kwlurnnn":"2021-11-30T08:43:26.964Z","3.3.0-feature-725aa5-kwm2sx3z":"2021-11-30T12:28:30.336Z","3.3.0-feature-a0ea5f-kwm7uug2":"2021-11-30T14:49:53.326Z","3.3.0-feature-9cdb35-kwn77e4h":"2021-12-01T07:19:27.194Z","3.3.0-alpha.6":"2021-12-01T08:30:36.224Z","3.3.0-feature-ad40e7-kwnjgttt":"2021-12-01T13:02:43.882Z","3.3.0-feature-202876-kwnkel3h":"2021-12-01T13:28:56.673Z","3.3.0-feature-880267-kwnmbacy":"2021-12-01T14:22:17.222Z","3.3.0-alpha.7":"2021-12-01T14:25:23.576Z","3.3.0-beta.2":"2021-12-01T14:27:49.212Z","3.3.0-feature-e15295-kwnmnihm":"2021-12-01T14:31:49.601Z","3.3.0-feature-1638c1-kwnmw4ar":"2021-12-01T14:38:32.595Z","3.3.0-feature-67fc78-kwovs914":"2021-12-02T11:35:14.546Z","3.3.0-feature-793fd2-kwq7piji":"2021-12-03T09:56:49.094Z","3.3.0-feature-ef5364-kwucoqiz":"2021-12-06T07:27:11.704Z","3.3.0-feature-66f73c-kwun397h":"2021-12-06T12:18:29.859Z","3.3.0-alpha.8":"2021-12-06T12:20:18.663Z","3.3.0-feature-e1a4e8-kwut56lj":"2021-12-06T15:07:56.750Z","3.3.0-feature-d577c3-kwute4t6":"2021-12-06T15:14:53.141Z","3.3.0-alpha.9":"2021-12-06T15:16:42.253Z","3.3.0-feature-e40013-kwxgkeo3":"2021-12-08T11:39:13.218Z","3.3.0-beta.3":"2021-12-08T12:11:37.333Z","3.3.0-feature-381f4d-kwxhv3fj":"2021-12-08T12:15:24.774Z","3.3.0-feature-a499e4-kx7eiy8b":"2021-12-15T10:39:44.350Z","3.3.0-feature-20dc46-kxfttlai":"2021-12-21T08:10:06.403Z","3.3.0-betafix-b5b694-kxg4v1wd":"2021-12-21T13:19:09.394Z","3.3.0-betafix-51f112-kxg5v6e7":"2021-12-21T13:47:11.286Z","3.3.0-betafix-79b09e-kxhal5o5":"2021-12-22T08:47:11.618Z","3.3.0-beta.4":"2021-12-22T08:49:30.432Z","3.3.0-feature-5eb067-kxhayhbg":"2021-12-22T08:57:36.334Z","3.3.0-feature-3bfedf-kxymjdyx":"2022-01-03T11:53:46.572Z","3.3.0-feature-c79b05-ky02x9bz":"2022-01-04T12:20:18.548Z","3.3.0-feature-1a3c58-ky06wtjq":"2022-01-04T14:11:53.201Z","3.3.0-feature-5b636e-ky09s1ns":"2022-01-04T15:32:07.580Z","3.3.0-feature-0bba0c-ky1irvm1":"2022-01-05T12:31:41.494Z","3.3.0-feature-636ff6-ky8hgn14":"2022-01-10T09:29:24.224Z","3.3.0-feature-b85816-ky9rt6xv":"2022-01-11T07:06:53.513Z","3.3.0-feature-eeb1ec-kybg5ahe":"2022-01-12T11:15:55.427Z","3.3.0-feature-542acc-kybgw0kf":"2022-01-12T11:36:42.991Z","3.3.0-feature-ddc842-kybjbajs":"2022-01-12T12:44:29.880Z","3.4.0-feature-ef822c-kybondbm":"2022-01-12T15:13:54.947Z","3.4.0-alpha.1":"2022-01-12T15:16:10.640Z","3.4.0-feature-0f7d6d-kybsjtr9":"2022-01-12T17:03:03.966Z","3.4.0-feature-aed2c0-kycrao3a":"2022-01-13T09:15:45.417Z","3.4.0-feature-918d65-kycro2i2":"2022-01-13T09:26:14.354Z","3.3.0-betafix-ea90f0-kyd131b1":"2022-01-13T13:49:43.155Z","3.3.0-betafix-ee339e-kyd1lm72":"2022-01-13T14:04:17.633Z","3.3.0-betafix-d8f8a0-kyd29nq3":"2022-01-13T14:22:57.496Z","3.3.0-betafix-1a0d5e-kyd3ufg5":"2022-01-13T15:07:05.017Z","3.4.0-alpha.2":"2022-01-14T12:31:07.598Z","3.3.0-betafix-a5ca5e-kyeehfbf":"2022-01-14T12:52:40.214Z","3.3.0-beta.5":"2022-01-14T13:01:34.760Z","3.4.0-alpha.3":"2022-01-14T13:05:21.718Z","3.4.0-alpha.4":"2022-01-14T14:16:46.350Z","3.4.0-feature-5fa596-kyehtzkk":"2022-01-14T14:26:21.222Z","3.4.0-feature-f1f7e1-kyehzwy2":"2022-01-14T14:30:57.349Z","3.4.0-feature-0d8c97-kyei2zd8":"2022-01-14T14:33:24.745Z","3.4.0-alpha.5":"2022-01-14T14:56:22.701Z","3.4.0-feature-20a65d-kyej46pv":"2022-01-14T15:02:15.880Z","3.4.0-feature-ca3d9e-kyej66v5":"2022-01-14T15:03:49.090Z","3.4.0-feature-de919a-kyej7tfg":"2022-01-14T15:05:10.380Z","3.4.0-alpha.6":"2022-01-14T15:38:17.923Z","3.4.0-feature-0276df-kyekub2v":"2022-01-14T15:50:34.750Z","3.4.0-alpha.7":"2022-01-14T15:52:57.887Z","3.4.0-feature-3712e2-kyekzbzk":"2022-01-14T15:54:33.534Z","3.4.0-feature-77f4d1-kyel1bbi":"2022-01-14T15:56:04.746Z","3.4.0-feature-d76964-kyel2bdh":"2022-01-14T15:56:47.998Z","3.4.0-feature-6a5555-kyjy1p6v":"2022-01-18T09:59:11.541Z","3.4.0-feature-2ba072-kylm055e":"2022-01-19T13:57:33.337Z","3.4.0-alpha.8":"2022-01-19T13:59:15.117Z","3.4.0-feature-a3a926-kylm6g0u":"2022-01-19T14:02:26.826Z","3.4.0-feature-1d149c-kylm7zl3":"2022-01-19T14:03:39.333Z","3.4.0-feature-174f7e-kyms90wb":"2022-01-20T09:40:12.496Z","3.4.0-feature-fb380f-kymzwz2u":"2022-01-20T13:14:45.969Z","3.4.0-alpha.9":"2022-01-20T13:15:16.738Z","3.4.0-feature-3cf69f-kyn0260t":"2022-01-20T13:18:52.523Z","3.4.0-feature-e5e078-kyo6bisf":"2022-01-21T09:01:42.767Z","3.4.0-feature-1ca315-kyo6jara":"2022-01-21T09:07:55.049Z","3.4.0-feature-db4b7c-kyo9wlai":"2022-01-21T10:42:10.637Z","3.4.0-feature-7bed99-kyob0lq5":"2022-01-21T11:13:14.001Z","3.4.0-feature-6758a5-kyoitxb5":"2022-01-21T14:52:02.981Z","3.4.0-feature-82b8b7-kysfso4a":"2022-01-24T08:38:13.751Z","3.4.0-feature-d6f757-kyu4xzjy":"2022-01-25T13:09:49.495Z","3.4.0-feature-2e83a5-kyu68p4t":"2022-01-25T13:46:10.693Z","3.4.0-feature-387f29-kyuc9bjk":"2022-01-25T16:34:36.942Z","3.4.0-feature-944580-kyucjcja":"2022-01-25T16:42:23.307Z","3.4.0-alpha.10":"2022-01-25T16:45:45.091Z","3.4.0-feature-2dd7d8-kyvm0j57":"2022-01-26T13:55:29.015Z","3.4.0-feature-c956b1-kyvm6ie9":"2022-01-26T14:00:09.575Z","3.4.0-feature-6379e8-kyvm94hc":"2022-01-26T14:02:10.628Z","3.3.0":"2022-02-02T13:20:46.840Z","3.4.0-alpha.11":"2022-02-02T13:28:11.268Z","3.4.0-beta.1":"2022-02-02T13:29:36.956Z","3.4.0-feature-e49a62-kz5ljwgl":"2022-02-02T13:40:15.493Z","3.4.0-feature-aec683-kzdvf7we":"2022-02-08T08:38:42.735Z","3.4.0-feature-6e248f-kzfbnisw":"2022-02-09T09:00:52.732Z","3.4.0-feature-a49609-kzfeh9zn":"2022-02-09T10:19:57.211Z","3.4.0-alpha.12":"2022-02-09T10:21:54.454Z","3.4.0-feature-3cee38-kzfepzwd":"2022-02-09T10:26:54.691Z","3.4.0-feature-f245e2-kzfeqww2":"2022-02-09T10:27:29.012Z","3.4.0-feature-76c56a-kzffx58e":"2022-02-09T11:00:22.593Z","3.4.0-alpha.13":"2022-02-09T11:02:38.817Z","3.4.0-feature-e95323-kzfg4hfw":"2022-02-09T11:06:01.485Z","3.4.0-beta.2":"2022-02-09T12:28:50.396Z","3.4.0-alpha.14":"2022-02-09T12:30:46.745Z","3.4.0-beta.3":"2022-02-09T13:06:24.806Z","3.4.0-alpha.15":"2022-02-09T13:09:09.950Z","3.4.0-feature-ed1af6-kzfklvil":"2022-02-09T13:11:33.239Z","3.4.0-feature-d5c11f-kzmha38m":"2022-02-14T09:12:52.429Z","3.4.0-feature-1bf6f4-kzmky629":"2022-02-14T10:55:31.317Z","3.4.0-feature-177af7-kzmm64yi":"2022-02-14T11:29:41.518Z","3.4.0-feature-7e3ed9-kzmngz04":"2022-02-14T12:06:04.349Z","3.4.0-feature-68215f-kzmsiz2l":"2022-02-14T14:27:38.458Z","3.4.0-feature-c09b99-kzmx4x32":"2022-02-14T16:36:42.817Z","3.4.0-feature-81ee3a-kzo2v14u":"2022-02-15T12:04:38.962Z","3.4.0-feature-371380-kzpervze":"2022-02-16T10:25:58.662Z","3.4.0-feature-dbdb24-kzpf2mss":"2022-02-16T10:34:21.169Z","3.4.0-feature-c2eb78-kzphc0r2":"2022-02-16T11:37:36.348Z","3.4.0-feature-c75900-kzpi90wn":"2022-02-16T12:03:13.283Z","3.4.0-alpha.16":"2022-02-16T12:03:49.080Z","3.4.0-feature-1c4a02-kzpige1s":"2022-02-16T12:08:54.859Z","3.4.0-beta.4":"2022-02-16T15:24:56.177Z","3.4.0-feature-c0ab0e-kzpqjk8d":"2022-02-16T15:55:21.549Z","4.0.0-feature-95bfcf-kzy6x3i0":"2022-02-22T13:55:59.505Z","4.0.0-feature-bd4980-kzy9d3yd":"2022-02-22T15:04:23.701Z","3.4.0":"2022-03-09T11:11:55.570Z","3.4.0-feature-19085a-l0kslk8l":"2022-03-10T09:33:49.645Z","4.0.0-feature-b90b35-l0kvz0c6":"2022-03-10T11:08:10.912Z","3.4.0-feature-de0ebb-l0kwl4uf":"2022-03-10T11:25:27.812Z","3.4.0-feature-598ccb-l127d2de":"2022-03-22T13:59:07.645Z","3.4.0-feature-9b47f1-l127zh3v":"2022-03-22T14:16:33.330Z","3.4.0-feature-0c084d-l12927u8":"2022-03-22T14:46:49.388Z","3.4.0-feature-472705-l13e53mr":"2022-03-23T09:56:40.909Z","3.4.0-feature-81fdbb-l13f7yf8":"2022-03-23T10:26:52.498Z","3.4.0-feature-d45eee-l13jxqhr":"2022-03-23T12:38:54.523Z","3.4.0-feature-32ca58-l13kdrf9":"2022-03-23T12:51:21.744Z","3.4.0-feature-d34a58-l13lfi8t":"2022-03-23T13:20:49.291Z","3.4.0-feature-04fb48-l13nvtg4":"2022-03-23T14:29:26.727Z","3.4.0-feature-b315e2-l13q8lbz":"2022-03-23T15:35:25.438Z","3.4.0-feature-e1f4c3-l13thnf1":"2022-03-23T17:06:24.508Z","3.4.0-feature-5074f4-l13v9lh9":"2022-03-23T17:56:03.617Z","3.4.1-hotfix-606de3-l1518hud":"2022-03-24T13:31:02.283Z","3.4.1-hotfix-313916-l152rg86":"2022-03-24T14:13:39.478Z","3.4.1-hotfix-4d6af8-l153zd2y":"2022-03-24T14:47:51.680Z","3.4.1-beta.1":"2022-03-24T14:48:26.411Z","3.4.1":"2022-03-24T14:53:34.907Z","3.4.2-feature-84c975-l168vrqb":"2022-03-25T09:52:49.441Z","3.4.2-feature-463b10-l169y9tg":"2022-03-25T10:22:41.594Z","3.4.2-feature-fd4a3a-l169za52":"2022-03-25T10:23:31.392Z","3.4.2-feature-759af3-l16a0omh":"2022-03-25T10:24:37.853Z","3.4.2":"2022-03-25T10:26:40.523Z","3.4.0-feature-e1ff35-l1ahxwa5":"2022-03-28T09:17:24.265Z","3.4.2-feature-dbdf2b-l1asf7o2":"2022-03-28T14:10:54.217Z","3.4.2-feature-869d08-l1c2vk2w":"2022-03-29T11:51:18.773Z","3.4.2-feature-0d505e-l1dako7j":"2022-03-30T08:14:39.985Z","3.4.2-feature-479635-l1uga57e":"2022-04-11T08:26:28.901Z","3.4.2-feature-9262f1-l2egfjp3":"2022-04-25T08:26:00.733Z","3.4.2-feature-6ec1f6-l306dr9g":"2022-05-10T13:15:33.006Z","4.0.0-feature-616cba-l3bg5bph":"2022-05-18T10:34:24.008Z","3.4.2-hotfix-fe89ba-l3edgzbw":"2022-05-20T11:42:47.366Z","3.4.2-hotfix-ee97db-l3ee8mxp":"2022-05-20T12:04:17.230Z","3.4.2-hotfix-f2b6ec-l3ikfa42":"2022-05-23T10:08:30.009Z","3.4.2-hotfix-dc36bd-l3iqhrio":"2022-05-23T12:58:27.890Z","3.4.3-hotfix-e17e7d-l3irwhd6":"2022-05-23T13:37:50.014Z","3.4.3":"2022-05-23T13:38:16.087Z","3.4.3-beta.1":"2022-05-23T13:39:14.298Z","3.4.3-alpha.1":"2022-05-23T13:39:43.816Z","3.4.3-feature-041c21-l3jsp418":"2022-05-24T06:47:51.771Z","3.4.3-feature-a16da4-l3jxi8bg":"2022-05-24T09:02:30.652Z","3.4.3-feature-4bf6c3-l3jxqtvj":"2022-05-24T09:09:09.847Z","3.4.2-feature-6a5e3c-l3vcjfwk":"2022-06-01T08:48:48.323Z","3.4.3-feature-73f2c9-l3x2uq6x":"2022-06-02T13:53:09.997Z","3.5.0-feature-4aa753-l3x2vjwq":"2022-06-02T13:53:54.459Z","4.0.0-feature-1c92da-l3x2xat4":"2022-06-02T13:55:10.155Z","4.0.0-feature-1c92da-l3x4bcs2":"2022-06-02T14:34:07.408Z","3.4.2-feature-1c703f-l4cok6bx":"2022-06-13T11:57:28.861Z","3.4.2-feature-1d46c0-l4e4uwcw":"2022-06-14T12:21:22.855Z","3.4.2-feature-9f987d-l4e68vs4":"2022-06-14T13:00:21.054Z","3.4.2-feature-85dbcc-l4eb2xmz":"2022-06-14T15:15:36.205Z","3.4.2-feature-eae38c-l4fdeq2i":"2022-06-15T09:08:30.584Z","3.4.4-alpha.1":"2022-06-15T11:30:31.506Z","3.4.4":"2022-06-15T11:30:40.064Z","3.4.4-beta.1":"2022-06-15T11:31:16.441Z","3.4.4-alpha.2":"2022-06-15T11:32:08.226Z","3.4.4-alpha.3":"2022-06-15T11:38:18.977Z","3.4.4-feature-b8e0d9-l4i7lwtf":"2022-06-17T08:49:27.718Z","3.4.4-feature-e849e1-l4i96hjf":"2022-06-17T09:33:26.114Z","3.4.4-feature-4590df-l4i9owk7":"2022-06-17T09:47:45.886Z","3.4.4-feature-21d69b-l4ib29rm":"2022-06-17T10:26:12.784Z","3.4.4-feature-893523-l4icg445":"2022-06-17T11:04:57.460Z","3.4.4-feature-9c1a06-l4ijnrxi":"2022-06-17T14:26:49.457Z","3.4.5-hotfix-ef6186-l4mf7kwy":"2022-06-20T07:33:19.483Z","3.4.5":"2022-06-20T07:35:41.491Z","3.5.0-alpha.1":"2022-06-20T07:50:34.692Z","3.5.0-feature-9d6ac8-l4mg6ho5":"2022-06-20T08:00:26.932Z","3.5.0-alpha.2":"2022-06-20T08:01:55.390Z","3.5.0-feature-13e482-l4mgnqj3":"2022-06-20T08:13:58.303Z","3.5.0-feature-c2e797-l4mgoiux":"2022-06-20T08:14:33.138Z","3.5.0-alpha.3":"2022-06-20T08:15:37.629Z","3.5.0-feature-e23d59-l4mh1bks":"2022-06-20T08:24:27.520Z","3.5.0-feature-c356ca-l4mhlg8k":"2022-06-20T08:40:11.800Z","3.5.0-feature-bb44fe-l4mhsymg":"2022-06-20T08:45:56.741Z","3.5.0-feature-aa29d9-l4mo06vs":"2022-06-20T11:39:32.730Z","3.5.0-alpha.4":"2022-06-20T11:41:04.012Z","4.0.0-feature-92cb17-l4mqk50m":"2022-06-20T12:51:10.923Z","4.0.0-feature-c4a014-l4mqkv2p":"2022-06-20T12:51:35.207Z","3.5.0-feature-d55cce-l4mqkxid":"2022-06-20T12:51:42.834Z","3.5.0-feature-e74d9d-l4mt3dg8":"2022-06-20T14:01:58.748Z","3.5.0-feature-2ef82d-l4ntne76":"2022-06-21T07:05:18.714Z","3.5.0-feature-39feaa-l4nuzhcs":"2022-06-21T07:42:42.877Z","3.5.0-feature-4b8fc1-l4ny79qt":"2022-06-21T09:12:48.169Z","3.5.0-feature-0b186f-l4o6fbh8":"2022-06-21T13:02:59.037Z","3.5.0-alpha.5":"2022-06-21T13:03:23.300Z","3.5.0-feature-139ffc-l4oagzdg":"2022-06-21T14:56:13.560Z","4.0.0-feature-2af349-l4oddryg":"2022-06-21T16:17:48.577Z","3.5.0-feature-52afda-l4pa1q26":"2022-06-22T07:32:16.857Z","3.5.0-alpha.6":"2022-06-22T12:02:45.986Z","3.5.0-feature-dfe585-l4pjvlgn":"2022-06-22T12:07:17.222Z","3.5.0-beta.1":"2022-06-22T13:40:58.289Z","3.5.0-feature-080d13-l4pnbuxt":"2022-06-22T13:43:56.320Z","4.0.0-feature-e4413e-l4pnsi46":"2022-06-22T13:56:52.420Z","4.0.0-feature-473276-l4qua1e8":"2022-06-23T09:46:15.232Z","3.5.0-feature-59de58-l4qwogdv":"2022-06-23T10:53:31.102Z","3.5.0-feature-2e0d29-l4wv5813":"2022-06-27T14:57:05.922Z","3.5.0-alpha.7":"2022-06-27T14:58:53.875Z","3.5.0-feature-d199f9-l4yccscd":"2022-06-28T15:46:38.077Z","3.5.0-feature-267302-l4zaybsm":"2022-06-29T07:55:10.483Z","3.5.0-alpha.8":"2022-06-29T07:56:15.541Z","3.5.0-feature-2e6249-l4zf1t8w":"2022-06-29T09:49:50.975Z","3.5.0-feature-4a1f27-l4zfmko9":"2022-06-29T10:06:00.308Z","3.5.0-feature-f9d9ef-l50rt2ms":"2022-06-30T08:34:45.513Z","3.5.0-alpha.9":"2022-06-30T08:35:59.747Z","4.0.0-feature-fd9ff0-l50s23sn":"2022-06-30T08:41:45.616Z","3.5.0-beta.2":"2022-07-01T15:45:18.475Z","4.0.0-feature-de3cce-l52oabrd":"2022-07-01T16:31:43.311Z","3.5.0-beta.3":"2022-07-07T17:06:11.704Z","3.5.0":"2022-07-12T09:52:43.059Z","4.0.0-feature-0a0312-l5uxzn2p":"2022-07-21T11:20:53.740Z","4.0.0-feature-2e6f52-l5uy075v":"2022-07-21T11:21:21.142Z","4.0.0-feature-081160-l6apjf08":"2022-08-01T12:08:38.926Z","4.0.0-feature-d8b80b-l6ar0tuf":"2022-08-01T12:50:17.801Z","4.0.0-feature-2fca99-l6arst0w":"2022-08-01T13:11:57.730Z","4.0.0-feature-fb70fa-l6c6bre1":"2022-08-02T12:46:22.153Z","4.0.0-feature-346c08-l6c92kr5":"2022-08-02T14:03:12.249Z","4.0.0-feature-0f3521-l6dlt0n1":"2022-08-03T12:47:33.249Z","4.0.0-alpha.1":"2022-08-03T12:48:18.870Z","4.0.0-beta.1":"2022-08-03T12:54:42.117Z","4.0.0-beta.2":"2022-08-05T10:57:25.404Z","4.0.0-feature-502e08-l6ki4j6i":"2022-08-08T08:38:49.481Z","4.0.0-feature-5a08c6-l6kj5mu1":"2022-08-08T09:07:45.453Z","4.0.0-feature-2d693f-l6kjt9de":"2022-08-08T09:26:02.877Z","4.0.0-feature-895562-l6klxqrf":"2022-08-08T10:25:31.195Z","4.0.0-alpha.2":"2022-08-08T10:27:19.722Z","4.0.0-feature-508b5a-l6km2ivd":"2022-08-08T10:29:18.400Z","4.0.0-feature-760a4c-l6ly65bi":"2022-08-09T08:55:46.419Z","4.0.0-alpha.3":"2022-08-09T12:01:08.047Z","4.0.0-beta.3":"2022-08-10T10:14:15.063Z","4.0.0-alpha.4":"2022-08-10T10:16:25.395Z","4.0.0-feature-938dd8-l6w4rnjr":"2022-08-16T11:58:08.422Z","4.0.0-alpha.5":"2022-08-16T12:00:04.829Z","4.0.0-feature-aecb15-l6xh35y5":"2022-08-17T10:30:50.626Z","4.0.0-feature-3cb6ad-l6xhk6gm":"2022-08-17T10:44:03.311Z","4.0.0-feature-f35011-l6xjequv":"2022-08-17T11:35:46.869Z","4.0.0-alpha.6":"2022-08-17T11:39:15.467Z","4.0.0-beta.4":"2022-08-17T11:43:28.081Z","4.0.0-feature-f13ce0-l6xngaoj":"2022-08-17T13:28:56.699Z","4.0.0-feature-29adeb-l6xqh5xh":"2022-08-17T14:53:37.289Z","4.0.0-feature-bf7c52-l6z49whn":"2022-08-18T14:07:38.974Z","4.0.0-feature-a393f7-l6z4i58b":"2022-08-18T14:14:03.689Z","4.0.0-feature-d40d8e-l6z4qy7e":"2022-08-18T14:20:58.034Z","4.0.0-feature-cca828-l70ce0kh":"2022-08-19T10:42:33.841Z","4.0.0-feature-a559e6-l70cg0xv":"2022-08-19T10:44:13.491Z","4.0.0-feature-fd525a-l70eo01y":"2022-08-19T11:46:18.808Z","4.0.0-feature-9a57a3-l70g6cev":"2022-08-19T12:28:38.167Z","4.0.0-feature-d2459b-l75vs594":"2022-08-23T07:44:21.062Z","4.0.0-feature-d37df2-l75xi3dx":"2022-08-23T08:32:26.648Z","4.0.0-feature-649085-l77dacog":"2022-08-24T08:42:04.988Z","4.0.0-feature-c9b86e-l77epihh":"2022-08-24T09:21:53.614Z","4.0.0-feature-a09d66-l77ilwfp":"2022-08-24T11:11:02.967Z","4.0.0-feature-a30eae-l77m0fsu":"2022-08-24T12:46:19.889Z","4.0.0-feature-fb229b-l77n1f6x":"2022-08-24T13:15:05.906Z","4.0.0-feature-87e53d-l77no92l":"2022-08-24T13:32:48.949Z","4.0.0-feature-cd6267-l77qv0ga":"2022-08-24T15:02:04.130Z","4.0.0-feature-2cd9c4-l78pqor0":"2022-08-25T07:18:32.161Z","4.0.0-feature-1ed50d-l7fyt4sg":"2022-08-30T09:06:42.643Z","4.0.0-alpha.7":"2022-08-30T09:08:52.074Z","4.0.0-feature-e89e34-l7g4nula":"2022-08-30T11:50:33.977Z","4.0.0-feature-b0bb6f-l7hcl95s":"2022-08-31T08:20:16.163Z","4.0.0-feature-8c4103-l7hkydbu":"2022-08-31T12:14:25.840Z","4.0.0-feature-6042e9-l7hl3qym":"2022-08-31T12:18:35.571Z","4.0.0-alpha.8":"2022-08-31T12:20:28.572Z","4.0.0-beta.5":"2022-08-31T12:22:02.314Z","4.0.0-feature-be33b5-l7hldv1n":"2022-08-31T12:26:35.793Z","4.0.0-feature-257126-l7j2dzch":"2022-09-01T13:10:18.981Z","4.0.0-feature-fab61a-l7j5001j":"2022-09-01T14:23:24.609Z","4.0.0-feature-251a63-l7j580ht":"2022-09-01T14:29:33.320Z","4.0.0-feature-03a9d4-l7onrna6":"2022-09-05T11:07:37.817Z","4.0.0-feature-fb289a-l7sunn97":"2022-09-08T09:31:30.306Z","4.0.0-alpha.9":"2022-09-08T10:08:30.361Z","4.0.0":"2022-09-08T10:28:30.753Z","4.0.0-feature-eb49d5-l7swx3b2":"2022-09-08T10:34:55.121Z","4.1.0-alpha.1":"2022-09-08T10:35:57.892Z","4.1.0-feature-434606-l7sxik2i":"2022-09-08T10:51:30.035Z","4.1.0-feature-070269-l7t7p40j":"2022-09-08T15:36:32.734Z","4.1.0-feature-b43459-l7udvh9o":"2022-09-09T11:17:14.038Z","4.1.0-feature-40aad9-l7ueyx8d":"2022-09-09T11:48:00.391Z","4.1.0-alpha.2":"2022-09-09T11:49:31.358Z","4.1.0-feature-dce56f-l802hd20":"2022-09-13T10:45:00.017Z","4.1.0-feature-3c3f48-l803xu7y":"2022-09-13T11:25:51.504Z","4.1.0-feature-3c3f48-l80461z8":"2022-09-13T11:32:07.872Z","4.1.0-feature-0fd57d-l805wmc0":"2022-09-13T12:20:55.323Z","4.1.0-feature-6782f6-l81gcz7w":"2022-09-14T10:01:17.058Z","4.1.0-feature-ca600c-l81gfa4o":"2022-09-14T10:03:04.159Z","4.1.0-feature-5bcf33-l81gyv9g":"2022-09-14T10:18:17.908Z","4.1.0-alpha.3":"2022-09-14T12:02:42.767Z","4.1.0-beta.1":"2022-09-14T14:08:42.285Z","4.1.0-feature-8f43aa-l8cqwg7w":"2022-09-22T07:41:45.402Z","4.1.0-feature-fb623f-l8cqzrg7":"2022-09-22T07:44:14.556Z","4.1.0-feature-35001c-l8cx0iq7":"2022-09-22T10:32:50.025Z","4.1.0-alpha.4":"2022-09-22T10:34:18.707Z","4.1.0-feature-446265-l8lelp73":"2022-09-28T09:07:22.276Z","4.1.0-feature-f86d0b-l8lh48w2":"2022-09-28T10:17:48.262Z","4.1.0-feature-6dd3ff-l8lhua0f":"2022-09-28T10:37:57.141Z","4.1.0-feature-de2f5b-l8lillgd":"2022-09-28T10:59:17.027Z","4.1.0-feature-6362c4-l8lo8f9e":"2022-09-28T13:36:56.902Z","4.1.0-feature-c57ba8-l8lp8km5":"2022-09-28T14:05:03.389Z","4.1.0-feature-08c391-l8lptppc":"2022-09-28T14:21:33.359Z","4.1.0-feature-54881d-l8lrg8qj":"2022-09-28T15:07:01.655Z","4.1.0-feature-388d2e-l8mtzhfy":"2022-09-29T09:05:41.672Z","4.1.0-feature-13d355-l8mu4zp5":"2022-09-29T09:09:59.880Z","4.1.0-feature-c41be1-l8o95qmm":"2022-09-30T08:58:19.263Z","4.1.0-feature-647e58-l8ofvqyp":"2022-09-30T12:06:33.381Z","4.1.0-feature-a79d1d-l8tyk69d":"2022-10-04T08:48:09.322Z","4.1.0-feature-bc2a6a-l92k2gnd":"2022-10-10T09:12:28.353Z","4.1.0-alpha.5":"2022-10-10T13:01:25.264Z","4.1.0-feature-7de74c-l92scbkv":"2022-10-10T13:04:01.351Z","4.1.0-feature-f43890-l95b6wmp":"2022-10-12T07:27:16.979Z","4.1.0-feature-774983-l95b7mtu":"2022-10-12T07:27:47.678Z","4.1.0-alpha.6":"2022-10-12T07:28:34.387Z","4.1.0-feature-86badb-l95bcla4":"2022-10-12T07:31:44.574Z","4.1.0-feature-9fcc1c-l95i8zk5":"2022-10-12T10:44:48.469Z","4.1.0-alpha.7":"2022-10-12T10:45:12.866Z","4.1.0-beta.2":"2022-10-12T10:50:30.849Z","4.1.0-alpha.8":"2022-10-12T11:42:01.654Z","4.1.0-beta.3":"2022-10-12T11:42:09.698Z","4.1.0-beta.4":"2022-10-19T07:14:50.557Z","4.1.0-alpha.9":"2022-10-19T07:18:06.188Z","4.1.0-feature-9c11bf-l9nsp9c0":"2022-10-25T05:57:17.056Z","4.1.0-feature-fde9ba-l9o43es0":"2022-10-25T11:16:10.293Z","4.0.0-hotfix-a0a95a-l9pn56cg":"2022-10-26T12:57:15.186Z","4.0.0-hotfix-34771d-l9qtvvrb":"2022-10-27T08:53:45.516Z","4.0.0-hotfix-6ad79a-l9r46ot1":"2022-10-27T13:42:05.791Z","4.0.1-release-687db6-l9s5as1a":"2022-10-28T07:01:07.619Z","4.0.1-hotfix-054a4f-l9s5fpbf":"2022-10-28T07:04:53.616Z","4.0.1-hotfix-91e544-l9sfh9gg":"2022-10-28T11:46:06.560Z","4.0.1-release-1f4370-l9sfj6o6":"2022-10-28T11:47:30.655Z","4.0.1":"2022-10-28T11:48:47.328Z","4.1.0-beta.5":"2022-10-28T11:52:22.907Z","4.1.0-alpha.11":"2022-10-31T08:13:20.306Z","4.1.0-feature-21dabd-l9zedcio":"2022-11-02T08:49:19.139Z","4.1.0-feature-baeefb-l9zha7i9":"2022-11-02T10:10:55.189Z","4.1.0-alpha.12":"2022-11-02T10:13:07.128Z","4.1.0-feature-9cc08e-la0uot0o":"2022-11-03T09:13:53.167Z","4.1.0-feature-d21198-la0vasco":"2022-11-03T09:30:58.675Z","4.1.0-beta.6":"2022-11-03T09:36:26.349Z","4.1.0-feature-6a20e3-la0vynb0":"2022-11-03T09:49:31.762Z","4.1.0-feature-803efe-la0whqz9":"2022-11-03T10:04:23.144Z","4.1.0-feature-153458-la28cjxz":"2022-11-04T08:23:57.886Z","4.1.0-feature-13d52f-la28ig70":"2022-11-04T08:28:37.483Z","4.1.0-feature-91d658-la2hapmj":"2022-11-04T12:34:28.411Z","4.1.0-feature-58d275-la6ittuz":"2022-11-07T08:28:28.889Z","4.1.0-feature-55e9a7-la6m0p3l":"2022-11-07T09:57:50.057Z","4.1.0-feature-e87fd0-la6mirbf":"2022-11-07T10:11:52.786Z","4.1.0-feature-98dcc2-la7xn8mm":"2022-11-08T08:11:07.087Z","4.1.0-alpha.13":"2022-11-08T08:14:15.929Z","4.1.0":"2022-11-09T07:49:24.731Z","4.2.0-alpha.1":"2022-11-09T07:53:02.973Z","4.2.0-feature-624583-la9oqhst":"2022-11-09T13:37:14.458Z","4.1.0-feature-75f182-lac8x4ea":"2022-11-11T08:37:47.654Z","4.2.0-alpha.2":"2022-11-14T08:27:34.986Z","4.2.0-feature-9cc81a-laglgx8t":"2022-11-14T09:40:14.011Z","4.2.0-feature-762a42-lagvww21":"2022-11-14T14:32:28.972Z","4.1.0-feature-0b4126-lahxc6pg":"2022-11-15T08:00:07.804Z","4.2.0-feature-26290f-lahxedo0":"2022-11-15T08:01:53.188Z","4.2.0-alpha.3":"2022-11-15T08:02:09.380Z","4.2.0-feature-b89c71-lajd1bv2":"2022-11-16T08:07:21.042Z","4.2.0-feature-8891c8-laql438k":"2022-11-21T09:27:52.800Z","4.2.0-alpha.4":"2022-11-21T09:30:50.124Z","4.2.0-feature-0a81a7-las9doly":"2022-11-22T13:34:56.979Z","4.2.0-beta.1":"2022-11-24T10:52:50.715Z","4.2.0-feature-712d0f-lb0lr7k1":"2022-11-28T09:43:30.781Z","4.2.0-feature-8c1ec0-lb28ttcj":"2022-11-29T13:17:10.377Z","4.2.0-feature-c66278-lb2ctwak":"2022-11-29T15:09:12.256Z","4.2.0-feature-d2f588-lb3g5u2l":"2022-11-30T09:30:17.780Z","4.2.0-feature-0c34df-lb3jlp33":"2022-11-30T11:06:39.375Z","4.2.0-alpha.5":"2022-11-30T11:08:23.798Z","4.2.0-beta.2":"2022-11-30T13:05:38.442Z","4.2.0-alpha.6":"2022-11-30T13:07:12.498Z","4.2.0-feature-55d50a-lb4tijdc":"2022-12-01T08:31:48.029Z","4.2.0-feature-78ef98-lb4tngzc":"2022-12-01T08:35:38.484Z","4.2.0-feature-9ca449-lbb52qba":"2022-12-05T18:42:02.977Z","4.2.0-feature-801784-lbb5n3ws":"2022-12-05T18:57:58.523Z","4.2.0-feature-c781c2-lbb7a9h9":"2022-12-05T19:43:53.787Z","4.2.0-feature-c781c2-lbbz2f48":"2022-12-06T08:41:37.067Z","4.2.0-feature-35e5ae-lbbz3ecx":"2022-12-06T08:42:23.007Z","4.2.0-feature-cc6af2-lbbz7w9d":"2022-12-06T08:45:52.672Z","4.2.0-feature-d38803-lbgncy7q":"2022-12-09T15:12:45.085Z","4.2.0-feature-da80ad-lbkol67f":"2022-12-12T10:58:12.090Z","4.2.0-feature-1cdf24-lbm84n3t":"2022-12-13T12:52:59.748Z","4.2.0-feature-8ac43d-lbng999d":"2022-12-14T09:28:17.394Z","4.2.0-feature-40fdb6-lbngymg0":"2022-12-14T09:48:00.947Z","4.2.0-feature-ed00dd-lbnihoav":"2022-12-14T10:30:49.653Z","4.2.0-feature-e5cdec-lbnkrlw5":"2022-12-14T11:34:31.847Z","4.2.0-feature-866055-lbnnd0db":"2022-12-14T12:47:11.063Z","4.2.0-feature-73acce-lbnoqb14":"2022-12-14T13:25:29.687Z","4.2.0-feature-43deaf-lbnoqu3l":"2022-12-14T13:25:54.660Z","4.2.0-feature-a708bd-lbnpojqg":"2022-12-14T13:52:08.038Z","4.2.0-feature-4741ee-lbnux61n":"2022-12-14T16:18:48.071Z","4.2.0-alpha.7":"2022-12-14T16:24:55.727Z","4.2.0-beta.3":"2022-12-14T16:27:32.746Z","4.2.0-beta.4":"2022-12-15T13:16:13.534Z","4.2.0-alpha.8":"2022-12-15T13:18:42.422Z","4.2.0-alpha.9":"2023-01-10T11:03:26.009Z","4.2.0-alpha.10":"2023-01-10T11:12:27.575Z","4.2.0-beta.5":"2023-01-10T13:31:35.123Z","4.2.0":"2023-01-10T13:42:48.708Z","4.3.0-alpha.1":"2023-01-10T13:44:50.796Z","4.2.1":"2023-01-10T14:25:58.715Z","4.3.0-alpha.2":"2023-01-10T14:29:28.694Z","4.2.2":"2023-01-10T16:08:18.825Z","4.3.0-alpha.3":"2023-01-10T16:09:57.054Z","4.3.0-feature-971706-lcrmdsad":"2023-01-11T12:10:34.498Z","4.3.0-develop-786537-lct30sgu":"2023-01-12T12:44:07.692Z","4.3.0-alpha.4":"2023-01-12T12:46:48.590Z","4.2.3-hotfix-7b6689-ld4kyfs8":"2023-01-20T13:51:38.287Z","4.2.3-hotfix-b92f33-ld4lkojq":"2023-01-20T14:09:02.756Z","4.2.3":"2023-01-20T14:11:56.328Z","4.3.0-develop-5dc4ba-ld4p62zw":"2023-01-20T15:49:33.073Z","4.3.0-alpha.5":"2023-01-20T15:52:41.211Z","4.2.4-hotfix-5f539d-ldbk9xtz":"2023-01-25T11:07:03.270Z","4.2.4-hotfix-1c167e-ldbr3t07":"2023-01-25T14:18:09.480Z","4.2.4":"2023-01-25T14:19:28.807Z","4.3.0-develop-168112-ldbr7v4l":"2023-01-25T14:21:18.908Z","4.3.0-alpha.6":"2023-01-27T08:05:55.995Z","4.3.0-develop-e25a54-ldithlak":"2023-01-30T12:59:15.314Z","4.3.0-develop-39d67b-ldiup347":"2023-01-30T13:33:04.183Z","4.2.5":"2023-02-09T08:25:23.604Z","4.3.0-develop-991a5a-ldwuames":"2023-02-09T08:30:37.795Z","4.3.0-alpha.7":"2023-02-09T08:32:11.245Z","4.2.6-release-410c76-lemo6mls":"2023-02-27T10:21:32.304Z","4.2.6-feature-f38f9c-lemocqt5":"2023-02-27T10:26:19.842Z","4.2.6-feature-893e7d-lemqgudw":"2023-02-27T11:25:30.355Z","4.2.6-feature-bdac69-lemr92b5":"2023-02-27T11:47:29.307Z","4.2.6-feature-40396a-lephgdtt":"2023-03-01T09:36:29.519Z","4.2.6":"2023-03-01T09:37:18.238Z","4.3.0-alpha.8":"2023-03-01T09:45:25.534Z","4.3.0-develop-3229d8-lephu9y9":"2023-03-01T09:47:31.655Z","4.3.0-feature-8b1d1b-lezqknzx":"2023-03-08T13:49:27.597Z","4.3.0-feature-8b1d1b-lezqm09n":"2023-03-08T13:50:30.053Z","4.3.0-feature-612cb7-lezrq4kw":"2023-03-08T14:21:47.773Z","4.3.0-feature-d97b7e-lf0u69cu":"2023-03-09T08:18:00.858Z","4.3.0-develop-418ccc-lf0vrc7a":"2023-03-09T09:02:23.196Z","4.3.0-feature-aea29a-lf0y8stv":"2023-03-09T10:12:01.546Z","4.3.0-alpha.9":"2023-03-09T11:07:08.291Z","4.3.0-develop-c5da88-lf10lsb2":"2023-03-09T11:18:07.144Z","4.3.0-feature-ff2066-lf6xpfmp":"2023-03-13T14:43:31.560Z","4.2.7-hotfix-292cd6-lf8ij74h":"2023-03-14T17:14:23.962Z","4.2.7-hotfix-e13805-lf9fits0":"2023-03-15T08:37:47.366Z","4.2.7-hotfix-b6c504-lfaxdg5z":"2023-03-16T09:45:19.269Z","4.2.7":"2023-03-16T09:46:20.267Z","4.3.0-develop-ef8745-lfaxiai6":"2023-03-16T09:49:04.347Z","4.3.0-alpha.10":"2023-03-16T09:49:23.580Z","4.3.0-feature-3aa9d1-lfcku1x4":"2023-03-17T13:29:52.408Z","4.3.0-feature-24fa48-lfgplxbr":"2023-03-20T10:54:31.035Z","4.3.0-feature-62da7b-lfl2r1un":"2023-03-23T12:13:30.513Z","4.3.0-feature-57a4f9-lfqvqr12":"2023-03-27T13:44:00.523Z","4.3.0-develop-01b3b4-lfqweb44":"2023-03-27T14:02:15.187Z","4.3.0-feature-240a0c-lfqxi8l8":"2023-03-27T14:33:17.942Z","4.3.0-feature-86966c-lfv1q4cq":"2023-03-30T11:42:30.864Z","4.3.0-develop-89284e-lfv1rxtn":"2023-03-30T11:43:53.972Z","4.3.0-alpha.11":"2023-03-30T11:44:20.921Z","4.3.0-develop-a22e64-lgmbkbyt":"2023-04-18T13:47:40.859Z","4.3.0-develop-a8b3cb-lgmclrhc":"2023-04-18T14:16:53.934Z","4.3.0-feature-e166dc-lgmdevuo":"2023-04-18T14:39:26.648Z","4.3.0-feature-007a92-lgmdpum1":"2023-04-18T14:47:57.858Z","4.3.0-feature-075940-lgne23rg":"2023-04-19T07:45:18.946Z","4.3.0-feature-65849d-lgne9ow6":"2023-04-19T07:51:09.865Z","4.3.0-feature-4ab62a-lgnegkgg":"2023-04-19T07:56:30.463Z","4.3.0-feature-4c49f5-lgnhf4c7":"2023-04-19T09:19:27.581Z","4.3.0-feature-91ad42-lgnhmn5e":"2023-04-19T09:25:12.755Z","4.3.0-develop-8e0e9e-lgnijqyr":"2023-04-19T09:50:58.322Z","4.3.0-develop-a8b3cb-lgnj7lpr":"2023-04-19T10:09:36.257Z","4.3.0-feature-883c6c-lgnvfyrz":"2023-04-19T15:52:06.321Z","4.3.0-develop-f1649c-lgqbycoj":"2023-04-21T09:09:44.806Z","4.3.0-beta.1":"2023-04-21T10:25:20.363Z","4.3.0-alpha.12":"2023-04-21T10:26:49.467Z","4.3.0-feature-acc21d-lgyunr3i":"2023-04-27T08:15:27.496Z","4.3.0-feature-1772a0-lh0cstey":"2023-04-28T09:31:07.758Z","4.3.0-develop-475589-lh0cts5p":"2023-04-28T09:31:47.867Z","4.3.0-beta.2":"2023-04-28T09:32:34.199Z","4.3.0-feature-8dc180-lhkbx2we":"2023-05-12T09:01:46.097Z","4.3.0-develop-3edc26-lhru6r08":"2023-05-17T15:07:39.235Z","4.3.0-beta.3":"2023-05-19T07:31:19.206Z","4.3.0-beta.4":"2023-05-25T14:31:42.952Z","4.3.0":"2023-05-30T09:14:43.130Z","4.4.0-alpha.1":"2023-05-30T09:19:34.194Z","4.3.1":"2023-05-30T11:19:12.131Z","4.4.0-develop-b60523-liu6rxos":"2023-06-13T11:15:13.096Z","4.3.3-hotfix-b4c82b-ll204dqx":"2023-08-08T07:50:39.935Z","4.3.3-hotfix-48bfe1-ll6ekw9r":"2023-08-11T09:46:34.484Z","4.3.3-hotfix-d805ae-ll6etdb6":"2023-08-11T09:53:02.873Z","4.3.3-hotfix-c9f91b-llc464d4":"2023-08-15T09:41:44.456Z","4.3.3-hotfix-b50325-llcidshi":"2023-08-15T16:19:36.424Z","4.3.3":"2023-08-15T16:21:25.149Z","4.3.4-feature-fdec9d-llkqx388":"2023-08-21T10:40:43.311Z","4.3.4-feature-30916d-llmaydqv":"2023-08-22T12:49:20.827Z","4.3.4":"2023-08-22T12:50:26.978Z","4.3.6-hotfix-42ad31-lm4v2mgb":"2023-09-04T12:32:25.114Z","4.3.5-hotfix-0a8209-lm4v5vx9":"2023-09-04T12:34:51.374Z","4.3.5":"2023-09-04T12:35:45.799Z"},"bugs":{"url":"https://github.com/atlas-engine/Client.ts/issues"},"author":{"name":"5Minds IT-Solutions GmbH & Co. KG"},"license":"MIT","homepage":"https://github.com/atlas-engine/Client.ts#readme","repository":{"url":"git+https://github.com/atlas-engine/Client.ts.git","type":"git"},"description":"Contains a typescript based client for accessing the Engine.","maintainers":[{"email":"alex@kasten.pw","name":"alexanderkasten"},{"email":"sebastian.griesa@5minds.de","name":"s3bastiangriesa5minds"}],"readme":"# Engine Client.ts\n\nEin NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.\n\nCodebeispiele zur Verwendung des Clients und der External Task Worker [finden sich hier](./samples).\n\n## Schnelleinstieg\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n## Wie kann ich den Client verwenden?\n\nMan benötigt lediglich die URL der anzusteuernden Engine.\nMit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.\n\nEs gibt verschiedene Wege sich Clients anzulegen.\n\n### EngineClient\n\nMan kann eine Instanz des `EngineClients` direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst processInstancesInCorrelation = await client.processInstances.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\n### Client Factory\n\nOder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.\n\nBeispiel:\n\n```ts\nimport { ClientFactory } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);\n\nconst processInstances = await processInstanceClient.query({\n  correlationid: 'my-correlation-id',\n});\n```\n\nHier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.\n\n## Anwendungsbeispiele\n\nNachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.\n\n### Prozesse starten\n\nDas Starten von Prozessinstanzen kann über die `EngineClient.processModels` Fachlichkeit realisiert werden.\n\nProzesse lassen sich auf mehrere Arten starten.\n\n#### Einfacher Prozessstart\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({processModelId: 'myProcessModelId'});\n```\n\nDie `processModelId` ist der einzige erforderliche Parameter für diesen Request.\n\nDer Client wartet in diesem Szenario nur, bis die Engine den _Start_ des Prozesses bestätigt hat.\n\n#### Konfigurierter Prozessstart\n\nNeben der `processModelId` können folgende Paramter mitgegeben werden:\n- `startEventId`: Die ID des Start Events von welchem aus der Prozess losgehen soll\n    - **Hinweis:** Bei Prozessen mit mehreren Start Events ist dieser Parameter ebenfalls erforderlich!\n- `correlationId`: Gibt an, in welcher Correlation die Prozessinstanz laufen soll\n- `initialToken`: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen soll\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstance({\n  processModelId: 'myProcessModelId',\n  startEventId: 'StartEvent_1',\n  correlationId: 'MyCorrelatioNid',\n  initialToken: {\n    hello: 'world',\n  },\n});\n```\n\n#### Prozess starten und auf dessen Ende warten\n\n```ts\nimport { EngineClient } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nawait client.processModels.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});\n```\n\nHier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.\n\nDie Methode akzeptiert dieselben Parameter wie `processModels.startProcessInstance`.\n\n## Query UserTasks\n\nAbfragen aller User Tasks eines bestimmten Prozesses, die sich in einem \"suspended\" State befinden:\n\n```ts\nimport { EngineClient, DataModels } from '@5minds/processcube_engine_client';\n\nconst engineUri = 'http://localhost:10560';\n\nconst client = new EngineClient(engineUri);\n\nconst userTasks = await client.userTasks.query({\n  processModelId: 'myProcessModelId',\n  state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,\n});\n\nconsole.log(userTasks);\n```\n\n## External Task Worker\n\nExternal Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden `External Service Tasks` zu verarbeiten.\n\nEin Worker benötigt minimal die folgenden 3 Einstellungen\n- Die URL der Ziel-Engine\n- Das Topic der abzuarbeitenden External Tasks\n- Eine Handler Funktion zum Verarbeiten der External Tasks\n\nBeispiel:\n\n```ts\nimport {ExternalTaskWorker} from '@5minds/processcube_engine_client';\n\ninterface AddPayload {\n  number1: number;\n  number2: number;\n}\n\ninterface AddResult {\n  sum: number;\n}\n\nconst engineUri = 'http://localhost:10560';\nconst topic = 'sum_numbers';\n\nconst externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);\n\nexternalTaskWorker.start();\n\nasync function doAdd(\n  payload: AddPayload,\n  externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,\n): Promise<AddResult> {\n  const result: AddResult = {\n    sum: payload.number1 + payload.number2,\n  };\n\n  return result;\n}\n\n```\n\nDer Worker lässt sich mit folgendem Befehl starten:\n\n```ts\nexternalTaskWorker.start();\n```\n\nund mit folgendem Befehl stoppen:\n\n```ts\nexternalTaskWorker.stop();\n```\n\nEin ausführbares Code-Beispiel [findet sich hier](./samples/external_task_worker/).\n","readmeFilename":"README.md"}